123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- $PBExportHeader$w_cust_rep_add.srw
- forward
- global type w_cust_rep_add from w_publ_base
- end type
- type dw_1 from datawindow within w_cust_rep_add
- end type
- type cb_2 from uo_imflatbutton within w_cust_rep_add
- end type
- type cb_1 from uo_imflatbutton within w_cust_rep_add
- end type
- end forward
- global type w_cust_rep_add from w_publ_base
- integer width = 1774
- integer height = 1516
- string title = "客户联系人"
- boolean minbox = false
- windowtype windowtype = response!
- dw_1 dw_1
- cb_2 cb_2
- cb_1 cb_1
- end type
- global w_cust_rep_add w_cust_rep_add
- type variables
- s_cust_rep s_rep_open
- uo_crm uo_cus
- end variables
- forward prototypes
- public function integer wf_save ()
- public function integer wf_insertrow ()
- end prototypes
- public function integer wf_save ();Int rslt = 1
- Long li_row
- dw_1.AcceptText()
- li_row = dw_1.GetRow()
- IF li_row <= 0 THEN
- MessageBox('提示','记录错误',information!,ok!)
- rslt = 0
- GOTO ext
- END IF
- s_cust_rep s_rep
- String arg_msg
- s_rep.repid = dw_1.Object.repid[li_row]
- s_rep.cusid = dw_1.Object.cusid[li_row]
- s_rep.repname = Trim(dw_1.Object.repname[li_row])
- s_rep.deptname = Trim(dw_1.Object.deptname[li_row])
- s_rep.duty = Trim(dw_1.Object.duty[li_row])
- s_rep.sex = Trim(dw_1.Object.sex[li_row])
- s_rep.officetel = Trim(dw_1.Object.officetel[li_row])
- s_rep.handtel = Trim(dw_1.Object.handtel[li_row])
- s_rep.faxno = Trim(dw_1.Object.faxno[li_row])
- s_rep.email = Trim(dw_1.Object.email[li_row])
- s_rep.interest = Trim(dw_1.Object.interest[li_row])
- s_rep.mainproduct = Trim(dw_1.Object.mainproduct[li_row])
- s_rep.dscrp = Trim(dw_1.Object.dscrp[li_row])
- IF uo_cus.uof_add_rep(s_rep,publ_operator,arg_msg,TRUE) = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,ok!)
- rslt = 0
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
- public function integer wf_insertrow ();Long ll_row
- ll_row = dw_1.InsertRow(0)
- dw_1.Object.cusid[ll_row] = s_rep_open.cusid
- dw_1.SetFocus()
- dw_1.SetColumn('repname')
- RETURN 1
- end function
- on w_cust_rep_add.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.cb_2=create cb_2
- this.cb_1=create cb_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.cb_2
- this.Control[iCurrent+3]=this.cb_1
- end on
- on w_cust_rep_add.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_2)
- destroy(this.cb_1)
- end on
- event open;call super::open;dw_1.SetTransObject(sqlca)
- s_rep_open = Message.PowerObjectParm
- uo_cus = CREATE uo_crm
- IF s_rep_open.repid = 0 THEN
- wf_insertrow()
- ELSE
- dw_1.Retrieve(s_rep_open.repid)
- END IF
- end event
- event close;call super::close;destroy uo_cus
- end event
- type cb_func from w_publ_base`cb_func within w_cust_rep_add
- boolean visible = false
- integer x = 1056
- integer y = 580
- boolean enabled = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_cust_rep_add
- integer x = 1335
- integer y = 1296
- integer taborder = 30
- string text = "取消"
- end type
- type dw_1 from datawindow within w_cust_rep_add
- event key pbm_dwnkey
- event dwnkey pbm_dwnkey
- integer x = 41
- integer y = 48
- integer width = 1669
- integer height = 1172
- integer taborder = 10
- boolean bringtotop = true
- string dataobject = "dw_cust_crm_rep_add"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event dwnkey;IF Key = KeyDownArrow! THEN RETURN 1
- IF Key = keyenter! OR Key = KeyDownArrow! THEN //
- keybd_event ( 9, 0, 0 , 0 ) // 按下tab
- keybd_event ( 9, 0, 2, 0 ) // 释放tab
- RETURN 0
- ELSEIF Key = keyuparrow! THEN
- keybd_event ( 16, 0, 0 , 0 )
- keybd_event ( 9, 0, 0 , 0 )
- keybd_event ( 9, 0, 2, 0 )
- keybd_event ( 16, 0, 2, 0 )
- RETURN 0
- END IF
- end event
- event rbuttondown;Long ll_row,ll_column
- ll_row = THIS.GetRow()
- ll_column = THIS.GetColumn()
- IF ll_row <= 0 THEN RETURN
- IF ll_column <= 0 THEN RETURN
- IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
- s_calender_arg s_calender
-
- s_calender.PointerX = THIS.PointerX()
- s_calender.PointerY = THIS.PointerY()
- s_calender.X = THIS.X + PARENT.X
- s_calender.Y = THIS.Y + PARENT.Y
-
- OpenWithParm(w_calendar,s_calender)
- THIS.SetItem(ll_row,ll_column,id_date_selected)
- end if
- end event
- type cb_2 from uo_imflatbutton within w_cust_rep_add
- integer x = 763
- integer y = 1296
- integer width = 407
- integer height = 96
- integer taborder = 40
- string text = "保存[C^+S]"
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;if wf_save() = 0 then return
- close(parent)
- end event
- type cb_1 from uo_imflatbutton within w_cust_rep_add
- integer x = 110
- integer y = 1296
- integer width = 489
- integer height = 96
- integer taborder = 40
- string text = "保存&新增[&S]"
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;IF wf_save() = 0 THEN RETURN
- wf_insertrow()
- end event
|