123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- $PBExportHeader$w_rp_combine_setting_add2.srw
- forward
- global type w_rp_combine_setting_add2 from w_publ_base
- end type
- type dw_1 from datawindow within w_rp_combine_setting_add2
- end type
- type cb_1 from uo_imflatbutton within w_rp_combine_setting_add2
- end type
- type cb_2 from uo_imflatbutton within w_rp_combine_setting_add2
- end type
- end forward
- global type w_rp_combine_setting_add2 from w_publ_base
- integer width = 2651
- integer height = 792
- 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_add2 w_rp_combine_setting_add2
- type variables
- s_rp_rowdef s_row_open
- end variables
- forward prototypes
- public function integer wf_save ()
- public subroutine wf_insertrow ()
- end prototypes
- public function integer wf_save ();Long ll_row
- Long ll_rpid,ll_rowid
- String ls_rowcode,ls_rowname
- Int li_rowtype,li_rowcmpltype
- 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]
- ll_rowid = dw_1.Object.rowid[ll_row]
- ls_rowcode = Trim(dw_1.Object.rowcode[ll_row])
- ls_rowname = dw_1.Object.rowname[ll_row]
- li_rowtype = dw_1.Object.rowtype[ll_row]
- li_rowcmpltype = dw_1.Object.rowcmpltype[ll_row]
- IF ls_rowcode = '' THEN
- MessageBox('提示','请输入行号')
- dw_1.SetFocus()
- dw_1.SetColumn('rowcode')
- rslt = 0
- GOTO ext
- END IF
- IF ls_rowname = '' AND li_rowcmpltype <> 0 THEN
- MessageBox('提示','请输入空行不能设置统计类型')
- dw_1.SetFocus()
- dw_1.SetColumn('rowcmpltype')
- rslt = 0
- GOTO ext
- END IF
- //IF ls_rowname <> '' AND li_rowcmpltype = 0 THEN
- // MessageBox('提示','请选择统计类型')
- // dw_1.SetFocus()
- // dw_1.SetColumn('rowcmpltype')
- // rslt = 0
- // GOTO ext
- //END IF
- IF ll_rowid = 0 THEN
- ll_rowid = f_sys_scidentity(0,"cw_rp_rowdef","rowid",errmsg,TRUE,id_sqlca)
- IF ll_rowid <= 0 THEN
- MessageBox('提示',errmsg)
- rslt = 0
- GOTO ext
- END IF
-
- INSERT INTO cw_rp_rowdef(rowid,rpid,rowcode,rowname,rowtype,rowcmpltype)
- Values(:ll_rowid,:ll_rpid,:ls_rowcode,:ls_rowname,:li_rowtype,:li_rowcmpltype);
- IF sqlca.SQLCode <> 0 THEN
- errmsg = sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示','增加资料失败,'+errmsg)
- rslt = 0
- GOTO ext
- END IF
- ELSE
- UPDATE cw_rp_rowdef SET
- rowcode = :ls_rowcode,
- rowname = :ls_rowname,
- rowcmpltype = :li_rowcmpltype
- Where rowid = :ll_rowid;
- 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.Object.rpid[ll_row] = s_row_open.rpid
- dw_1.Object.rowtype[ll_row] = s_row_open.rowtype
- dw_1.SetFocus()
- dw_1.SetColumn('rowcode')
- end subroutine
- on w_rp_combine_setting_add2.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_add2.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_1)
- destroy(this.cb_2)
- end on
- event open;call super::open;dw_1.SetTransObject(sqlca)
- s_row_open = Message.PowerObjectParm
- IF dw_1.Retrieve(s_row_open.rowid) = 0 THEN
- wf_insertrow()
- ELSE
- dw_1.SetColumn('rowcode')
- END IF
- end event
- type cb_func from w_publ_base`cb_func within w_rp_combine_setting_add2
- integer x = 549
- integer y = 156
- 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_add2
- integer x = 1627
- integer y = 508
- end type
- type dw_1 from datawindow within w_rp_combine_setting_add2
- integer x = 165
- integer y = 80
- integer width = 2258
- integer height = 340
- integer taborder = 30
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_rp_combine_setting_add2"
- boolean border = false
- boolean livescroll = true
- end type
- type cb_1 from uo_imflatbutton within w_rp_combine_setting_add2
- integer x = 841
- integer y = 508
- 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_add2
- integer x = 1234
- integer y = 508
- 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
|