123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627 |
- $PBExportHeader$w_aifmb_querycom.srw
- forward
- global type w_aifmb_querycom from window
- end type
- type cb_addcusspt from commandbutton within w_aifmb_querycom
- end type
- type cb_addspt from commandbutton within w_aifmb_querycom
- end type
- type cb_addcus from commandbutton within w_aifmb_querycom
- end type
- type cb_1 from commandbutton within w_aifmb_querycom
- end type
- type sle_1 from singlelineedit within w_aifmb_querycom
- end type
- type dw_1 from u_dw_rbtnfilter within w_aifmb_querycom
- end type
- end forward
- global type w_aifmb_querycom from window
- integer width = 3351
- integer height = 1968
- windowtype windowtype = child!
- long backcolor = 67108864
- string icon = "AppIcon!"
- boolean center = true
- cb_addcusspt cb_addcusspt
- cb_addspt cb_addspt
- cb_addcus cb_addcus
- cb_1 cb_1
- sle_1 sle_1
- dw_1 dw_1
- end type
- global w_aifmb_querycom w_aifmb_querycom
- forward prototypes
- public function integer wf_retrieve_type (ref string arg_msg)
- end prototypes
- public function integer wf_retrieve_type (ref string arg_msg);Int rslt = 1
- String ls_CusID
- Long ll_custype
- String ls_cuscode
- String ls_cusname
- Long i
- FOR i = 1 To dw_1.RowCount()
- ls_CusID = dw_1.Object.CusID[i]
- IF IsNull(ls_CusID) THEN CONTINUE
- IF ls_CusID = '' THEN CONTINUE
-
- SELECT top 1 custype, cuscode, cusname
- INTO :ll_custype, :ls_cuscode, :ls_cusname
- FROM LJFIEB_CusComm
- WHERE CusID = :ls_CusID
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN CONTINUE
-
- dw_1.Object.custype[i] = ll_custype
- dw_1.Object.cuscode[i] = ls_cuscode
- dw_1.Object.cusname[i] = ls_cusname
-
- NEXT
- RETURN rslt
- end function
- on w_aifmb_querycom.create
- this.cb_addcusspt=create cb_addcusspt
- this.cb_addspt=create cb_addspt
- this.cb_addcus=create cb_addcus
- this.cb_1=create cb_1
- this.sle_1=create sle_1
- this.dw_1=create dw_1
- this.Control[]={this.cb_addcusspt,&
- this.cb_addspt,&
- this.cb_addcus,&
- this.cb_1,&
- this.sle_1,&
- this.dw_1}
- end on
- on w_aifmb_querycom.destroy
- destroy(this.cb_addcusspt)
- destroy(this.cb_addspt)
- destroy(this.cb_addcus)
- destroy(this.cb_1)
- destroy(this.sle_1)
- destroy(this.dw_1)
- end on
- event resize;
- dw_1.Width = This.WorkSpaceWidth() - dw_1.X
- dw_1.Height = This.WorkSpaceHeight() - dw_1.Y
- end event
- type cb_addcusspt from commandbutton within w_aifmb_querycom
- integer x = 1641
- integer y = 40
- integer width = 439
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "加为客户供应商"
- end type
- event clicked;Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示', '请选择添加对象')
- RETURN
- END IF
- s_aifmb_addcuscomm s_parm
- s_parm.cusid = dw_1.Object.cusid[ll_row]
- s_parm.cuscode = dw_1.Object.usercode[ll_row]
- s_parm.cusname = dw_1.Object.username[ll_row]
- s_parm.lb_readonly = False
- s_parm.custype = 3
- IF s_parm.cusid = '' THEN
- MessageBox('提示', '对方唯一码为空不能添加')
- RETURN
- END IF
- IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
- MessageBox('提示', '对方唯一码为零不能添加')
- RETURN
- END IF
- //查询是否已经绑定客户
- Long ll_cnt
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
- String ls_cuscode
- String ls_cusname
- IF ll_cnt > 0 THEN
-
- SELECT top 1 cuscode, cusname
- INTO :ls_cuscode, :ls_cusname
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- s_parm.cuscode = ls_cuscode
- s_parm.cusname = ls_cusname
- s_parm.lb_readonly = True
-
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM u_cust
- Where commcode = :ls_cuscode;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询已绑定客户个数失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- IF ll_cnt > 0 THEN
- IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个客户,是否继续?', Question!, YesNo!, 1) <> 1 THEN
- RETURN
- END IF
- END IF
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM u_spt
- Where commcode = :ls_cuscode;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询已绑定供应商个数失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- IF ll_cnt > 0 THEN
- IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个供应商,是否继续?', Question!, YesNo!, 1) <> 1 THEN
- RETURN
- END IF
- END IF
-
- END IF
- s_custom s_cust
- s_cust.cuscode = dw_1.Object.usercode[ll_row]
- s_cust.Name = dw_1.Object.username[ll_row]
- s_cust.tele = dw_1.Object.tele[ll_row]
- s_cust.tele1 = dw_1.Object.phone[ll_row]
- s_cust.Address = dw_1.Object.Address[ll_row]
- s_cust.email = dw_1.Object.email[ll_row]
- s_cust.dscrp = dw_1.Object.dscrp[ll_row]
- s_edit_index_tran s_tran
- s_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
- s_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.e_long = 1
- s_tran.a_any = s_cust
- OpenWithParm(w_cust_edit, s_tran)
- s_custom S_INSCUST
- S_INSCUST = Message.PowerObjectParm //接受返回结构
- IF S_INSCUST.cusid <= 0 THEN RETURN
- s_parm.ll_cusid = S_INSCUST.cusid
- s_parm.ls_cuscode = S_INSCUST.cuscode
- s_parm.ls_cusname = S_INSCUST.Name
- s_spt s_spt_tran
- s_spt_tran.sptcode = dw_1.Object.usercode[ll_row]
- s_spt_tran.Name = dw_1.Object.username[ll_row]
- s_spt_tran.tele = dw_1.Object.tele[ll_row]
- s_spt_tran.tele1 = dw_1.Object.phone[ll_row]
- s_spt_tran.Address = dw_1.Object.Address[ll_row]
- s_spt_tran.email = dw_1.Object.email[ll_row]
- s_spt_tran.dscrp = dw_1.Object.dscrp[ll_row]
- s_edit_index_tran s_tran_spt
- s_tran_spt.if_retrieve_all = False //是否一次RETRIEVE所有行
- s_tran_spt.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_tran_spt.arg_pkid = 0 //目标定位PKID (备用)
- s_tran_spt.e_long = 1
- s_tran_spt.a_any = s_spt_tran
- OpenWithParm(w_spt_edit, s_tran_spt)
- s_spt S_INSSPT
- S_INSSPT = Message.PowerObjectParm //接受返回结构
- IF S_INSSPT.sptid <= 0 THEN RETURN
- s_parm.ll_sptid = S_INSSPT.sptid
- s_parm.ls_sptcode = S_INSSPT.sptcode
- s_parm.ls_sptname = S_INSSPT.Name
- OpenWithParm(w_aifmb_addcuscomm,s_parm)
- end event
- type cb_addspt from commandbutton within w_aifmb_querycom
- integer x = 1298
- integer y = 40
- integer width = 329
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "加为供应商"
- end type
- event clicked;Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示', '请选择添加对象')
- RETURN
- END IF
- s_aifmb_addcuscomm s_parm
- s_parm.cusid = dw_1.Object.cusid[ll_row]
- s_parm.cuscode = dw_1.Object.usercode[ll_row]
- s_parm.cusname = dw_1.Object.username[ll_row]
- s_parm.lb_readonly = False
- s_parm.custype = 1
- IF s_parm.cusid = '' THEN
- MessageBox('提示', '对方唯一码为空不能添加')
- RETURN
- END IF
- IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
- MessageBox('提示', '对方唯一码为零不能添加')
- RETURN
- END IF
- //查询是否已经绑定客户
- Long ll_cnt
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
- String ls_cuscode
- String ls_cusname
- IF ll_cnt > 0 THEN
-
- SELECT top 1 cuscode, cusname
- INTO :ls_cuscode, :ls_cusname
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- s_parm.cuscode = ls_cuscode
- s_parm.cusname = ls_cusname
- s_parm.lb_readonly = True
-
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM u_spt
- Where commcode = :ls_cuscode;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询已绑定供应商个数失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- IF ll_cnt > 0 THEN
- IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个供应商,是否继续?', Question!, YesNo!, 1) <> 1 THEN
- RETURN
- END IF
- END IF
-
- END IF
- s_spt s_spt_tran
- s_spt_tran.sptcode = dw_1.Object.usercode[ll_row]
- s_spt_tran.Name = dw_1.Object.username[ll_row]
- s_spt_tran.tele = dw_1.Object.tele[ll_row]
- s_spt_tran.tele1 = dw_1.Object.phone[ll_row]
- s_spt_tran.Address = dw_1.Object.Address[ll_row]
- s_spt_tran.email = dw_1.Object.email[ll_row]
- s_spt_tran.dscrp = dw_1.Object.dscrp[ll_row]
- s_edit_index_tran s_tran_spt
- s_tran_spt.if_retrieve_all = False //是否一次RETRIEVE所有行
- s_tran_spt.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_tran_spt.arg_pkid = 0 //目标定位PKID (备用)
- s_tran_spt.e_long = 1
- s_tran_spt.a_any = s_spt_tran
- OpenWithParm(w_spt_edit, s_tran_spt)
- s_spt S_INSSPT
- S_INSSPT = Message.PowerObjectParm //接受返回结构
- IF S_INSSPT.sptid <= 0 THEN RETURN
- s_parm.ll_sptid = S_INSSPT.sptid
- s_parm.ls_sptcode = S_INSSPT.sptcode
- s_parm.ls_sptname = S_INSSPT.Name
- OpenWithParm(w_aifmb_addcuscomm,s_parm)
- end event
- type cb_addcus from commandbutton within w_aifmb_querycom
- integer x = 1010
- integer y = 40
- integer width = 274
- integer height = 84
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "加为客户"
- end type
- event clicked;Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示', '请选择添加对象')
- RETURN
- END IF
- s_aifmb_addcuscomm s_parm
- s_parm.cusid = dw_1.Object.cusid[ll_row]
- s_parm.cuscode = dw_1.Object.usercode[ll_row]
- s_parm.cusname = dw_1.Object.username[ll_row]
- s_parm.lb_readonly = False
- s_parm.custype = 2
- IF s_parm.cusid = '' THEN
- MessageBox('提示', '对方唯一码为空不能添加')
- RETURN
- END IF
- IF s_parm.cusid = '00000000-0000-0000-0000-000000000000' THEN
- MessageBox('提示', '对方唯一码为零不能添加')
- RETURN
- END IF
- //查询是否已经绑定客户
- Long ll_cnt
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询企业是否有本地信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
- String ls_cuscode
- String ls_cusname
- IF ll_cnt > 0 THEN
-
- SELECT top 1 cuscode, cusname
- INTO :ls_cuscode, :ls_cusname
- FROM LJFIEB_CusComm
- WHERE CusID = :s_parm.cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询本地企业信息失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- s_parm.cuscode = ls_cuscode
- s_parm.cusname = ls_cusname
- s_parm.lb_readonly = True
-
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM u_cust
- Where commcode = :ls_cuscode;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('提示', '查询已绑定客户个数失败,' + sys_email_sqlca.SQLErrText)
- RETURN
- END IF
-
- IF ll_cnt > 0 THEN
- IF MessageBox('提问', '本企业已经绑定了' + String(ll_cnt) + '个客户,是否继续?', Question!, YesNo!, 1) <> 1 THEN
- RETURN
- END IF
- END IF
-
- END IF
- s_custom s_cust
- s_cust.cuscode = dw_1.Object.usercode[ll_row]
- s_cust.Name = dw_1.Object.username[ll_row]
- s_cust.tele = dw_1.Object.tele[ll_row]
- s_cust.tele1 = dw_1.Object.phone[ll_row]
- s_cust.Address = dw_1.Object.Address[ll_row]
- s_cust.email = dw_1.Object.email[ll_row]
- s_cust.dscrp = dw_1.Object.dscrp[ll_row]
- s_edit_index_tran s_tran
- s_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
- s_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.e_long = 1
- s_tran.a_any = s_cust
- OpenWithParm(w_cust_edit, s_tran)
- s_custom S_INSCUST
- S_INSCUST = Message.PowerObjectParm //接受返回结构
- IF S_INSCUST.cusid <= 0 THEN RETURN
- s_parm.ll_cusid = S_INSCUST.cusid
- s_parm.ls_cuscode = S_INSCUST.cuscode
- s_parm.ls_cusname = S_INSCUST.Name
- OpenWithParm(w_aifmb_addcuscomm,s_parm)
- end event
- type cb_1 from commandbutton within w_aifmb_querycom
- integer x = 654
- integer y = 40
- integer width = 206
- integer height = 84
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "查找"
- end type
- event clicked;Int rslt = 1
- String arg_msg = ''
- uo_aifmbproxy ll_proxyfactory
- ll_proxyfactory = Create uo_aifmbproxy
- oleobject lo_proxy
- IF ll_proxyfactory.getproxy(lo_proxy, arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- oleobject request
- request = lo_proxy.NewQueryEntRequest()
- request.QueryStr = sle_1.Text
- oleobject response
- response = lo_proxy.QueryEnt(request)
- IF Not IsNull(response.ErrMsg) THEN
- rslt = 0
- arg_msg = response.ErrMsg
- GOTO ext
- END IF
- Long cnt
- cnt = response.Ents.Count
- dw_1.Reset()
- Long i, row
- oleobject lo_ent
- oleobject lo_status
- FOR i = 0 To cnt - 1
- lo_ent = response.Ents.GetItem(i)
- row = dw_1.InsertRow(0)
- dw_1.Object.UserID[row] = lo_ent.UserID
- dw_1.Object.CusID[row] = lo_ent.CusID
- dw_1.Object.usercode[row] = lo_ent.usercode
- dw_1.Object.username[row] = lo_ent.username
- dw_1.Object.tele[row] = lo_ent.tele
- dw_1.Object.phone[row] = lo_ent.phone
- dw_1.Object.Address[row] = lo_ent.Address
- dw_1.Object.email[row] = lo_ent.email
- dw_1.Object.dscrp[row] = lo_ent.dscrp
- dw_1.Object.comcode[row] = lo_ent.comcode
-
- IF Not IsNull(response.LinkStatus) THEN
- lo_status = response.LinkStatus.GetItem(i)
- dw_1.Object.SoftType[row] = lo_status.SoftType
- dw_1.Object.LinkType[row] = lo_status.LinkType
- END IF
-
- NEXT
- IF wf_retrieve_type(arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- ext:
- Destroy ll_proxyfactory
- IF rslt = 0 THEN
- MessageBox('ERROR', arg_msg)
- END IF
- end event
- type sle_1 from singlelineedit within w_aifmb_querycom
- integer x = 18
- integer y = 40
- integer width = 626
- integer height = 80
- integer taborder = 10
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type dw_1 from u_dw_rbtnfilter within w_aifmb_querycom
- integer y = 152
- integer width = 2446
- integer height = 1212
- string dataobject = "dw_aifmb_querycom"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;this.selectrow(0, false)
- if currentrow > 0 then
- this.selectrow(currentrow,true)
- end if
- end event
- event clicked;call super::clicked;if row > 0 then
- this.setrow(row)
- end if
- end event
|