123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591 |
- $PBExportHeader$w_aifmb_addcuscomm.srw
- forward
- global type w_aifmb_addcuscomm from window
- end type
- type sle_sptcode from singlelineedit within w_aifmb_addcuscomm
- end type
- type sle_sptname from singlelineedit within w_aifmb_addcuscomm
- end type
- type st_sptcode from statictext within w_aifmb_addcuscomm
- end type
- type st_sptname from statictext within w_aifmb_addcuscomm
- end type
- type st_lcusname from statictext within w_aifmb_addcuscomm
- end type
- type st_lcuscode from statictext within w_aifmb_addcuscomm
- end type
- type sle_lcusname from singlelineedit within w_aifmb_addcuscomm
- end type
- type sle_lcuscode from singlelineedit within w_aifmb_addcuscomm
- end type
- type cb_exit from commandbutton within w_aifmb_addcuscomm
- end type
- type cb_ok from commandbutton within w_aifmb_addcuscomm
- end type
- type sle_cusname from singlelineedit within w_aifmb_addcuscomm
- end type
- type sle_cuscode from singlelineedit within w_aifmb_addcuscomm
- end type
- type st_3 from statictext within w_aifmb_addcuscomm
- end type
- type st_2 from statictext within w_aifmb_addcuscomm
- end type
- type st_1 from statictext within w_aifmb_addcuscomm
- end type
- type ddlb_custype from dropdownlistbox within w_aifmb_addcuscomm
- end type
- end forward
- global type w_aifmb_addcuscomm from window
- integer width = 1143
- integer height = 1064
- boolean titlebar = true
- string title = "添加合作关系"
- boolean controlmenu = true
- windowtype windowtype = response!
- long backcolor = 67108864
- string icon = "AppIcon!"
- boolean center = true
- sle_sptcode sle_sptcode
- sle_sptname sle_sptname
- st_sptcode st_sptcode
- st_sptname st_sptname
- st_lcusname st_lcusname
- st_lcuscode st_lcuscode
- sle_lcusname sle_lcusname
- sle_lcuscode sle_lcuscode
- cb_exit cb_exit
- cb_ok cb_ok
- sle_cusname sle_cusname
- sle_cuscode sle_cuscode
- st_3 st_3
- st_2 st_2
- st_1 st_1
- ddlb_custype ddlb_custype
- end type
- global w_aifmb_addcuscomm w_aifmb_addcuscomm
- type variables
- string ins_cusid
- s_aifmb_addcuscomm s_parm
- end variables
- on w_aifmb_addcuscomm.create
- this.sle_sptcode=create sle_sptcode
- this.sle_sptname=create sle_sptname
- this.st_sptcode=create st_sptcode
- this.st_sptname=create st_sptname
- this.st_lcusname=create st_lcusname
- this.st_lcuscode=create st_lcuscode
- this.sle_lcusname=create sle_lcusname
- this.sle_lcuscode=create sle_lcuscode
- this.cb_exit=create cb_exit
- this.cb_ok=create cb_ok
- this.sle_cusname=create sle_cusname
- this.sle_cuscode=create sle_cuscode
- this.st_3=create st_3
- this.st_2=create st_2
- this.st_1=create st_1
- this.ddlb_custype=create ddlb_custype
- this.Control[]={this.sle_sptcode,&
- this.sle_sptname,&
- this.st_sptcode,&
- this.st_sptname,&
- this.st_lcusname,&
- this.st_lcuscode,&
- this.sle_lcusname,&
- this.sle_lcuscode,&
- this.cb_exit,&
- this.cb_ok,&
- this.sle_cusname,&
- this.sle_cuscode,&
- this.st_3,&
- this.st_2,&
- this.st_1,&
- this.ddlb_custype}
- end on
- on w_aifmb_addcuscomm.destroy
- destroy(this.sle_sptcode)
- destroy(this.sle_sptname)
- destroy(this.st_sptcode)
- destroy(this.st_sptname)
- destroy(this.st_lcusname)
- destroy(this.st_lcuscode)
- destroy(this.sle_lcusname)
- destroy(this.sle_lcuscode)
- destroy(this.cb_exit)
- destroy(this.cb_ok)
- destroy(this.sle_cusname)
- destroy(this.sle_cuscode)
- destroy(this.st_3)
- destroy(this.st_2)
- destroy(this.st_1)
- destroy(this.ddlb_custype)
- end on
- event open;
- s_parm = Message.PowerObjectParm
- ins_cusid = s_parm.cusid
- sle_cuscode.Text = s_parm.cuscode
- sle_cusname.Text = s_parm.cusname
- IF s_parm.lb_readonly THEN
- sle_cuscode.Enabled = False
- sle_cusname.Enabled = False
- END IF
- IF s_parm.ll_cusid > 0 THEN
- sle_lcuscode.Text = s_parm.ls_cuscode
- sle_lcusname.Text = s_parm.ls_cusname
- END IF
- IF s_parm.ll_sptid > 0 THEN
- sle_sptcode.Text = s_parm.ls_sptcode
- sle_sptname.Text = s_parm.ls_sptname
- END IF
- IF s_parm.ll_cusid <= 0 And s_parm.ll_sptid <= 0 THEN
- This.Height = sle_lcusname.Y + This.Height - This.WorkSpaceHeight()
- cb_ok.Y = sle_lcuscode.Y
- cb_exit.Y = sle_lcuscode.Y
- st_lcuscode.Visible = False
- st_lcusname.Visible = False
- sle_lcuscode.Visible = False
- sle_lcusname.Visible = False
- st_sptcode.Visible = False
- st_sptname.Visible = False
- sle_sptcode.Visible = False
- sle_sptname.Visible = False
- ELSEIF s_parm.ll_cusid > 0 And s_parm.ll_sptid <= 0 THEN
- This.Height = sle_sptname.Y + This.Height - This.WorkSpaceHeight()
- cb_ok.Y = sle_sptcode.Y
- cb_exit.Y = sle_sptcode.Y
- st_sptcode.Visible = False
- st_sptname.Visible = False
- sle_sptcode.Visible = False
- sle_sptname.Visible = False
-
- ddlb_custype.Enabled = false
- ddlb_custype.Text = '[2]经销商/客户'
- ELSEIF s_parm.ll_sptid > 0 And s_parm.ll_cusid <= 0 THEN
- This.Height = sle_sptname.Y + This.Height - This.WorkSpaceHeight()
- cb_ok.Y = sle_sptcode.Y
- cb_exit.Y = sle_sptcode.Y
- st_lcuscode.Visible = False
- st_lcusname.Visible = False
- sle_lcuscode.Visible = False
- sle_lcusname.Visible = False
- st_sptcode.Y = st_lcuscode.Y
- st_sptname.Y = st_lcusname.Y
- sle_sptcode.Y = sle_lcuscode.Y
- sle_sptname.Y = sle_lcusname.Y
- ddlb_custype.Enabled = false
- ddlb_custype.Text = '[1]供应商'
- ELSE
- ddlb_custype.Enabled = false
- ddlb_custype.Text = '[3]客户/供应商'
- END IF
- end event
- type sle_sptcode from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 632
- integer width = 549
- integer height = 88
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type sle_sptname from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 752
- integer width = 549
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type st_sptcode from statictext within w_aifmb_addcuscomm
- integer x = 41
- integer y = 652
- integer width = 402
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "供应商编码"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_sptname from statictext within w_aifmb_addcuscomm
- integer x = 41
- integer y = 768
- integer width = 402
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "供应商名称"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_lcusname from statictext within w_aifmb_addcuscomm
- integer x = 41
- integer y = 532
- integer width = 402
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "客户名称"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_lcuscode from statictext within w_aifmb_addcuscomm
- integer x = 41
- integer y = 416
- integer width = 402
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "客户编码"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_lcusname from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 516
- integer width = 549
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type sle_lcuscode from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 396
- integer width = 549
- integer height = 88
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_exit from commandbutton within w_aifmb_addcuscomm
- integer x = 782
- integer y = 868
- integer width = 242
- integer height = 84
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "取消"
- boolean cancel = true
- end type
- event clicked;close(parent)
- end event
- type cb_ok from commandbutton within w_aifmb_addcuscomm
- integer x = 517
- integer y = 868
- integer width = 242
- integer height = 84
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "确认"
- boolean default = true
- end type
- event clicked;Int rslt = 1
- String arg_msg
- Long ll_custype, ll_cuscommid
- String ls_cuscode
- String ls_cusname
- ls_cuscode = sle_cuscode.Text
- ls_cusname = sle_cusname.Text
- uo_aifmb = Create uo_aifmb
- IF ls_cuscode = '' THEN
- rslt = 0
- arg_msg = '请填写企业代码'
- GOTO ext
- END IF
- IF ls_cusname = '' THEN
- rslt = 0
- arg_msg = '请填写企业名称'
- GOTO ext
- END IF
- IF ddlb_custype.Text = '[1]供应商' THEN
- ll_custype = 1
- ELSEIF ddlb_custype.Text = '[2]经销商/客户' THEN
- ll_custype = 2
- ELSE
- ll_custype = 3
- END IF
- Long ll_cnt
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM LJFIEB_CusComm
- WHERE CusID = :ins_cusid
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询关系是否已经添加失败,' + sys_email_sqlca.SQLErrText
- GOTO ext
- END IF
- IF ll_cnt = 0 THEN
- SELECT COUNT(0)
- INTO :ll_cnt
- FROM LJFIEB_CusComm
- WHERE cuscode = :ls_cuscode
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询企业代号是否重复失败,' + sys_email_sqlca.SQLErrText
- GOTO ext
- END IF
-
- IF ll_cnt > 0 THEN
- rslt = 0
- arg_msg = '企业代号'+ls_cuscode+'重复请修改后再试'
- GOTO ext
- END IF
-
- SELECT isnull(max(CusCommID),10)
- INTO :ll_cuscommid
- FROM LJFIEB_CusComm
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询企业最大企业编码失败,' + sys_email_sqlca.SQLErrText
- GOTO ext
- END IF
- ll_cuscommid++
-
- INSERT INTO LJFIEB_CusComm(CusCommID,CusType,CusCode,CusName,CusID,Accept,IfDynamic)
- VALUES(:ll_cuscommid,:ll_custype,:ls_cuscode,:ls_cusname,:ins_cusid,1,2)
- Using sys_email_sqlca;
- IF sys_email_sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '添加合作关系失败,' + sys_email_sqlca.SQLErrText
- GOTO ext
- END IF
-
- END IF
- IF s_parm.ll_CusID > 0 THEN
- UPDATE u_cust SET commcode = :ls_cuscode, ifecomm = 1, commsccode = ''
- Where CusID = :s_parm.ll_CusID;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '绑定客户失败,' + sqlca.SQLErrText
- GOTO ext
- END IF
- END IF
- IF s_parm.ll_sptid > 0 THEN
- UPDATE u_spt SET commcode = :ls_cuscode, ifecomm = 1, commsccode = ''
- Where sptid = :s_parm.ll_sptid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '绑定供应商失败,' + sqlca.SQLErrText
- GOTO ext
- END IF
- END IF
- IF uo_aifmb.uf_addcuscomm(ins_cusid, ll_custype, arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- ext:
- Destroy uo_aifmb
- IF rslt = 1 THEN
- COMMIT;
- COMMIT Using sys_email_sqlca;
- Close(Parent)
- ELSE
- ROLLBACK;
- ROLLBACK Using sys_email_sqlca;
- MessageBox('ERROR', arg_msg)
- END IF
- end event
- type sle_cusname from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 280
- integer width = 549
- integer height = 84
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type sle_cuscode from singlelineedit within w_aifmb_addcuscomm
- integer x = 471
- integer y = 164
- integer width = 549
- integer height = 84
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type st_3 from statictext within w_aifmb_addcuscomm
- integer x = 101
- integer y = 296
- integer width = 343
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "企业本地名称"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_2 from statictext within w_aifmb_addcuscomm
- integer x = 101
- integer y = 180
- integer width = 343
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "企业本地代码"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_1 from statictext within w_aifmb_addcuscomm
- integer x = 197
- integer y = 64
- integer width = 247
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "关系"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ddlb_custype from dropdownlistbox within w_aifmb_addcuscomm
- integer x = 471
- integer y = 48
- integer width = 549
- integer height = 452
- integer taborder = 10
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "[1]供应商"
- string item[] = {"[1]供应商","[2]经销商/客户","[3]客户/供应商"}
- borderstyle borderstyle = stylelowered!
- end type
|