123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- $PBExportHeader$w_item_cust_spt_mx_add.srw
- forward
- global type w_item_cust_spt_mx_add from w_publ_base
- end type
- type cb_1 from uo_imflatbutton within w_item_cust_spt_mx_add
- end type
- type cb_2 from uo_imflatbutton within w_item_cust_spt_mx_add
- end type
- type sle_mxcode from singlelineedit within w_item_cust_spt_mx_add
- end type
- type sle_mxname from singlelineedit within w_item_cust_spt_mx_add
- end type
- type st_1 from statictext within w_item_cust_spt_mx_add
- end type
- type st_2 from statictext within w_item_cust_spt_mx_add
- end type
- end forward
- global type w_item_cust_spt_mx_add from w_publ_base
- integer width = 1641
- integer height = 812
- string title = "增项目"
- boolean minbox = false
- windowtype windowtype = response!
- cb_1 cb_1
- cb_2 cb_2
- sle_mxcode sle_mxcode
- sle_mxname sle_mxname
- st_1 st_1
- st_2 st_2
- end type
- global w_item_cust_spt_mx_add w_item_cust_spt_mx_add
- type variables
- Long il_itemid
- end variables
- forward prototypes
- public subroutine wf_new ()
- public function integer wf_save ()
- end prototypes
- public subroutine wf_new ();sle_mxcode.Text = ''
- sle_mxname.Text = ''
- sle_mxcode.SetFocus()
- end subroutine
- public function integer wf_save ();Int rslt = 1
- Long ll_mxid
- String arg_msg
- String ls_mxcode,ls_mxname
- Long cnt
- ls_mxcode = Trim(sle_mxcode.Text)
- ls_mxname = Trim(sle_mxname.Text)
- IF ls_mxcode = '' THEN
- arg_msg = '请输入编号'
- sle_mxcode.SetFocus()
- rslt = 0
- END IF
- IF ls_mxname = '' THEN
- arg_msg = '请输入名称'
- sle_mxname.SetFocus()
- rslt = 0
- END IF
- SELECT count(*) INTO :cnt
- FROM u_item_cust_spt_def
- Where itemid = :il_itemid;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = '查询项目资料失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF cnt <> 1 THEN
- arg_msg = '项目资料不存在或重复'
- rslt = 0
- GOTO ext
- END IF
- ll_mxid = f_sys_scidentity(0,"u_item_cust_spt_def_mx","mxid",arg_msg,TRUE,sqlca)
- IF ll_mxid <= 0 THEN
- rslt = 0
- GOTO ext
- END IF
- INSERT INTO u_item_cust_spt_def_mx
- (mxid,itemid,mxcode,mxname)
- Values(:ll_mxid,:il_itemid,:ls_mxcode,:ls_mxname);
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = '建立明细项目资料失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- MessageBox('错误',arg_msg,stopsign!,ok!)
- ELSE
- COMMIT;
- END IF
- RETURN rslt
- end function
- on w_item_cust_spt_mx_add.create
- int iCurrent
- call super::create
- this.cb_1=create cb_1
- this.cb_2=create cb_2
- this.sle_mxcode=create sle_mxcode
- this.sle_mxname=create sle_mxname
- this.st_1=create st_1
- this.st_2=create st_2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_1
- this.Control[iCurrent+2]=this.cb_2
- this.Control[iCurrent+3]=this.sle_mxcode
- this.Control[iCurrent+4]=this.sle_mxname
- this.Control[iCurrent+5]=this.st_1
- this.Control[iCurrent+6]=this.st_2
- end on
- on w_item_cust_spt_mx_add.destroy
- call super::destroy
- destroy(this.cb_1)
- destroy(this.cb_2)
- destroy(this.sle_mxcode)
- destroy(this.sle_mxname)
- destroy(this.st_1)
- destroy(this.st_2)
- end on
- event open;call super::open;il_itemid = Message.DoubleParm
- wf_new()
- end event
- type cb_func from w_publ_base`cb_func within w_item_cust_spt_mx_add
- boolean visible = false
- integer x = 517
- integer taborder = 40
- boolean enabled = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_item_cust_spt_mx_add
- integer x = 1065
- integer y = 476
- end type
- type cb_1 from uo_imflatbutton within w_item_cust_spt_mx_add
- integer x = 119
- integer y = 476
- integer width = 389
- integer taborder = 50
- boolean bringtotop = true
- string text = "保存&新增"
- string normalpicname = "new.bmp"
- end type
- event clicked;call super::clicked;IF wf_save( ) = 1 THEN
- wf_new()
- END IF
- end event
- type cb_2 from uo_imflatbutton within w_item_cust_spt_mx_add
- integer x = 585
- integer y = 476
- integer width = 402
- integer taborder = 60
- boolean bringtotop = true
- string text = "保存&退出"
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;IF wf_save( ) = 1 THEN
- Close(PARENT)
- END IF
- end event
- type sle_mxcode from singlelineedit within w_item_cust_spt_mx_add
- integer x = 549
- integer y = 160
- integer width = 366
- integer height = 84
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type sle_mxname from singlelineedit within w_item_cust_spt_mx_add
- integer x = 549
- integer y = 296
- integer width = 558
- integer height = 84
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type st_1 from statictext within w_item_cust_spt_mx_add
- integer x = 343
- integer y = 176
- integer width = 146
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "编号"
- alignment alignment = center!
- boolean focusrectangle = false
- end type
- type st_2 from statictext within w_item_cust_spt_mx_add
- integer x = 343
- integer y = 312
- integer width = 146
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "名称"
- alignment alignment = center!
- boolean focusrectangle = false
- end type
|