123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- $PBExportHeader$w_rp_combine_setting_add1.srw
- forward
- global type w_rp_combine_setting_add1 from w_publ_base
- end type
- type dw_1 from datawindow within w_rp_combine_setting_add1
- end type
- type cb_1 from uo_imflatbutton within w_rp_combine_setting_add1
- end type
- type cb_2 from uo_imflatbutton within w_rp_combine_setting_add1
- end type
- end forward
- global type w_rp_combine_setting_add1 from w_publ_base
- integer width = 1906
- integer height = 1384
- string title = "报表增加|修改"
- boolean minbox = false
- windowtype windowtype = response!
- dw_1 dw_1
- cb_1 cb_1
- cb_2 cb_2
- end type
- global w_rp_combine_setting_add1 w_rp_combine_setting_add1
- forward prototypes
- public function integer wf_save ()
- public subroutine wf_insertrow ()
- end prototypes
- public function integer wf_save ();Long ll_row
- Long ll_rpid
- String ls_rpcode,ls_rpname
- String ls_col1name,ls_col2name
- String ls_col1name_addname,ls_col2name_addname
- Int li_rptype
- String errmsg
- Int rslt = 1
- dw_1.AcceptText()
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择资料')
- rslt = 0
- GOTO ext
- END IF
- ll_rpid = dw_1.Object.rpid[ll_row]
- ls_rpcode = Trim(dw_1.Object.rpcode[ll_row])
- ls_rpname = Trim(dw_1.Object.rpname[ll_row])
- ls_col1name = Trim(dw_1.Object.col1name[ll_row])
- ls_col2name = Trim(dw_1.Object.col2name[ll_row])
- ls_col1name_addname = Trim(dw_1.Object.col1name_addname[ll_row])
- ls_col2name_addname = Trim(dw_1.Object.col2name_addname[ll_row])
- li_rptype = dw_1.Object.rptype[ll_row]
- IF ls_rpcode = '' THEN
- MessageBox('提示','请输入编号')
- dw_1.SetFocus()
- dw_1.SetColumn('rpcode')
- rslt = 0
- GOTO ext
- END IF
- IF ls_rpname = '' THEN
- MessageBox('提示','请输入报表名称')
- dw_1.SetFocus()
- dw_1.SetColumn('rpname')
- rslt = 0
- GOTO ext
- END IF
- IF ls_col1name = '' THEN
- MessageBox('提示','请输入列1标题')
- dw_1.SetFocus()
- dw_1.SetColumn('col1name')
- rslt = 0
- GOTO ext
- END IF
- IF li_rptype = 1 AND ls_col2name = '' THEN
- MessageBox('提示','请输入列2标题')
- dw_1.SetFocus()
- dw_1.SetColumn('col2name')
- rslt = 0
- GOTO ext
- END IF
- IF ll_rpid = 0 THEN
- ll_rpid = f_sys_scidentity(0,"cw_rp","rpid",errmsg,TRUE,id_sqlca)
- IF ll_rpid <= 0 THEN
- MessageBox('提示',errmsg)
- rslt = 0
- GOTO ext
- END IF
-
- INSERT INTO cw_rp(rpid,rpcode,rpname,rptype,col1name,col2name,col1name_addname,col2name_addname)
- Values(:ll_rpid,:ls_rpcode,:ls_rpname,:li_rptype,:ls_col1name,:ls_col2name,:ls_col1name_addname,:ls_col2name_addname);
- IF sqlca.SQLCode <> 0 THEN
- errmsg = sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示','增加报表失败,'+errmsg)
- rslt = 0
- GOTO ext
- END IF
- ELSE
- UPDATE cw_rp SET
- rpcode = :ls_rpcode,
- rpname = :ls_rpname,
- rptype = :li_rptype,
- col1name = :ls_col1name,
- col2name = :ls_col2name,
- col1name_addname = :ls_col1name_addname,
- col2name_addname = :ls_col2name_addname
- Where rpid = :ll_rpid;
- IF sqlca.SQLCode <> 0 THEN
- errmsg = sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示','修改报表失败,'+errmsg)
- rslt = 0
- GOTO ext
- END IF
- END IF
- COMMIT;
- ext:
- RETURN rslt
- end function
- public subroutine wf_insertrow ();long ll_row
- dw_1.reset()
- ll_row = dw_1.InsertRow(0)
- dw_1.SetRow(ll_row)
- dw_1.SetColumn('rpcode')
- end subroutine
- on w_rp_combine_setting_add1.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.cb_1=create cb_1
- this.cb_2=create cb_2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.cb_1
- this.Control[iCurrent+3]=this.cb_2
- end on
- on w_rp_combine_setting_add1.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_1)
- destroy(this.cb_2)
- end on
- event open;call super::open;Long ll_rpid
- dw_1.SetTransObject(sqlca)
- ll_rpid = Message.DoubleParm
- IF dw_1.Retrieve(ll_rpid) = 0 THEN
- wf_insertrow()
- ELSE
- dw_1.SetColumn('rpcode')
- END IF
- end event
- type cb_func from w_publ_base`cb_func within w_rp_combine_setting_add1
- integer x = 558
- integer y = 308
- integer width = 311
- integer height = 96
- string text = "功能"
- string normalpicname = ""
- integer picsize = 0
- toolbaralignment pic_align = alignatleft!
- boolean border = true
- end type
- type cb_exit from w_publ_base`cb_exit within w_rp_combine_setting_add1
- integer x = 1234
- integer y = 1096
- end type
- type dw_1 from datawindow within w_rp_combine_setting_add1
- integer x = 165
- integer y = 68
- integer width = 1518
- integer height = 956
- integer taborder = 30
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_rp_combine_setting_add1"
- boolean border = false
- boolean livescroll = true
- end type
- type cb_1 from uo_imflatbutton within w_rp_combine_setting_add1
- integer x = 448
- integer y = 1096
- integer width = 329
- integer height = 96
- integer taborder = 30
- boolean bringtotop = true
- string text = "保存并退出"
- end type
- event clicked;call super::clicked;IF wf_save() = 1 THEN CLOSE(PARENT)
- end event
- type cb_2 from uo_imflatbutton within w_rp_combine_setting_add1
- integer x = 841
- integer y = 1096
- integer width = 329
- integer height = 96
- integer taborder = 20
- boolean bringtotop = true
- string text = "保存并新增"
- end type
- event clicked;call super::clicked;IF wf_save() = 1 THEN wf_insertrow()
- end event
|