123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- $PBExportHeader$w_rep_group_add.srw
- forward
- global type w_rep_group_add from w_publ_base
- end type
- type cb_save_add from uo_imflatbutton within w_rep_group_add
- end type
- type cb_save_exit from uo_imflatbutton within w_rep_group_add
- end type
- type cb_save_delet from uo_imflatbutton within w_rep_group_add
- end type
- type st_1 from statictext within w_rep_group_add
- end type
- type st_2 from statictext within w_rep_group_add
- end type
- type sle_1 from singlelineedit within w_rep_group_add
- end type
- type sle_2 from singlelineedit within w_rep_group_add
- end type
- type rb_1 from radiobutton within w_rep_group_add
- end type
- type rb_2 from radiobutton within w_rep_group_add
- end type
- type r_bar from rectangle within w_rep_group_add
- end type
- type s_u_rp from structure within w_rep_group_add
- end type
- end forward
- type s_u_rp from structure
- string rpcode
- string rpname
- integer rptype
- string col1name0
- string col1name1
- string col1name2
- string col2name0
- string col2name1
- string col2name2
- end type
- global type w_rep_group_add from w_publ_base
- integer width = 1847
- integer height = 420
- string title = "组增加"
- boolean minbox = false
- windowtype windowtype = response!
- long backcolor = 134217742
- cb_save_add cb_save_add
- cb_save_exit cb_save_exit
- cb_save_delet cb_save_delet
- st_1 st_1
- st_2 st_2
- sle_1 sle_1
- sle_2 sle_2
- rb_1 rb_1
- rb_2 rb_2
- r_bar r_bar
- end type
- global w_rep_group_add w_rep_group_add
- type variables
- public:
- long groupid,if_Parent
- string groupname
- private:
- s_u_rp ss_u_rp
- Boolean IT_NEWBEGIN = FALSE //新建标志
- Boolean IT_UPDATEBEGIN = FALSE//修改标志
- end variables
- forward prototypes
- public subroutine p_clearmx ()
- public function integer save (ref string arg_msg)
- public function integer acceptmx (string arg_rpcode, string arg_rpname, integer arg_rptype, string arg_col1name0, string arg_col1name1, string arg_col1name2, string arg_col2name0, string arg_col2name1, string arg_col2name2)
- end prototypes
- public subroutine p_clearmx ();groupname=''
- end subroutine
- public function integer save (ref string arg_msg);Int rslt = 1,i
- Long ll_count
- IF if_Parent = 1 THEN
- ll_count = 0
- SELECT count(*) Into :ll_count From u_rep_groupmx Where reltype = 3 And groupid = :groupid ;
- IF ll_count > 0 THEN
- rslt = 0
- arg_msg = "组明细包含组,不能改为父项,请先删除组明细再修改"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- END IF
- IF IT_NEWBEGIN = True And IT_UPDATEBEGIN = False THEN
- groupid = f_sys_scidentity(0,"u_rep_group","groupid",arg_msg,True,sqlca) //数据commit事务)
- IF groupid <= 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- INSERT INTO u_rep_group
- (groupid,
- groupname,
- if_Parent
- )
- VALUES (
- :groupid,
- :groupname,
- :if_Parent
- ) Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
-
- rslt = 0
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
- ROLLBACK Using sqlca;
- GOTO ext
- END IF
-
-
-
-
-
- END IF
- IF IT_UPDATEBEGIN = True And IT_NEWBEGIN = False THEN
- UPDATE u_rep_group
- SET
-
- groupname = :groupname,
- if_Parent = :if_Parent
- Where groupid = :groupid;
- IF sqlca.SQLCode <> 0 THEN
-
- rslt = 0
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
- ROLLBACK Using sqlca;
- GOTO ext
- END IF
-
- END IF
- ext:
- IF rslt = 0 THEN
- p_clearmx()
- ROLLBACK Using sqlca;
- ELSEIF rslt = 1 THEN
- COMMIT Using sqlca;
- END IF
- RETURN rslt
- end function
- public function integer acceptmx (string arg_rpcode, string arg_rpname, integer arg_rptype, string arg_col1name0, string arg_col1name1, string arg_col1name2, string arg_col2name0, string arg_col2name1, string arg_col2name2);Int rslt = 1
- IF Trim(arg_rpcode) = "" THEN arg_rpcode = ""
- IF Trim(arg_rpname) = "" THEN arg_rpname = ""
- IF Trim(arg_col1name0) = "" THEN arg_col1name0 = ""
- IF Trim(arg_col1name1) = "" THEN arg_col1name1 = ""
- IF Trim(arg_col1name2) = "" THEN arg_col1name2 = ""
- IF Trim(arg_col2name0) = "" THEN arg_col2name0 = ""
- IF Trim(arg_col2name1) = "" THEN arg_col2name1 = ""
- IF Trim(arg_col2name2) = "" THEN arg_col2name2 = ""
- IF arg_rpcode = "" THEN
- MessageBox("Error","报表编码不能为空")
- rslt = 0
- GOTO ext
- END IF
- IF arg_rpname = "" THEN
- MessageBox("Error","报表名称不能为空")
- rslt = 0
- GOTO ext
- END IF
- ss_u_rp.rpcode = arg_rpcode
- ss_u_rp.rpname = arg_rpname
- ss_u_rp.rptype = arg_rptype
- ss_u_rp.col1name0 = arg_col1name0
- ss_u_rp.col1name1 = arg_col1name1
- ss_u_rp.col1name2 = arg_col1name2
- ss_u_rp.col2name0 = arg_col2name0
- ss_u_rp.col2name1 = arg_col2name1
- ss_u_rp.col2name2 = arg_col2name2
-
- ext:
- IF rslt = 0 THEN p_clearmx()
- RETURN rslt
- end function
- on w_rep_group_add.create
- int iCurrent
- call super::create
- this.cb_save_add=create cb_save_add
- this.cb_save_exit=create cb_save_exit
- this.cb_save_delet=create cb_save_delet
- this.st_1=create st_1
- this.st_2=create st_2
- this.sle_1=create sle_1
- this.sle_2=create sle_2
- this.rb_1=create rb_1
- this.rb_2=create rb_2
- this.r_bar=create r_bar
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_save_add
- this.Control[iCurrent+2]=this.cb_save_exit
- this.Control[iCurrent+3]=this.cb_save_delet
- this.Control[iCurrent+4]=this.st_1
- this.Control[iCurrent+5]=this.st_2
- this.Control[iCurrent+6]=this.sle_1
- this.Control[iCurrent+7]=this.sle_2
- this.Control[iCurrent+8]=this.rb_1
- this.Control[iCurrent+9]=this.rb_2
- this.Control[iCurrent+10]=this.r_bar
- end on
- on w_rep_group_add.destroy
- call super::destroy
- destroy(this.cb_save_add)
- destroy(this.cb_save_exit)
- destroy(this.cb_save_delet)
- destroy(this.st_1)
- destroy(this.st_2)
- destroy(this.sle_1)
- destroy(this.sle_2)
- destroy(this.rb_1)
- destroy(this.rb_2)
- destroy(this.r_bar)
- end on
- event open;call super::open;String ls_groupname
- Integer ll_Parent
- IF String( Message.StringParm) = "new" THEN
- IT_NEWBEGIN = True
- IT_UPDATEBEGIN = False
- ELSE
- groupid = Long(Message.StringParm)
- IT_NEWBEGIN = False
- IT_UPDATEBEGIN = True
- SELECT groupname,if_Parent Into :ls_groupname,:ll_Parent From u_rep_group Where u_rep_group.groupid = :groupid;
- sle_2.Text = ls_groupname
- IF ll_Parent = 0 THEN
- rb_1.Checked = True
- ELSE
- rb_2.Checked = True
- END IF
- END IF
- end event
- type cb_func from w_publ_base`cb_func within w_rep_group_add
- boolean visible = false
- integer x = 2592
- integer y = 280
- end type
- type cb_exit from w_publ_base`cb_exit within w_rep_group_add
- boolean visible = false
- integer x = 2363
- integer y = 104
- end type
- type cb_save_add from uo_imflatbutton within w_rep_group_add
- integer x = 270
- integer y = 216
- integer width = 393
- integer height = 112
- integer taborder = 160
- boolean bringtotop = true
- string text = "保存并新增"
- string normalpicname = "new.bmp"
- integer picsize = 16
- end type
- event clicked;call super::clicked;Integer rp_type
- String arg_msg
- groupname = Trim(sle_2.Text)
- if rb_1.checked=true then
- if_Parent=0
- else
- if_Parent=1
- end if
- IF groupname = "" THEN
- MessageBox('Error!',"组名不能为空")
- RETURN
- END IF
- arg_msg = ""
- IF Save(arg_msg ) = 0 THEN //i 为printid
- MessageBox('Error!',arg_msg)
- RETURN
- END IF
- MessageBox(publ_operator,'保存操作成功!')
- IT_NEWBEGIN = True
- IT_UPDATEBEGIN = False
- sle_2.text=''
- sle_2.SetFocus()
- RETURN
- end event
- type cb_save_exit from uo_imflatbutton within w_rep_group_add
- integer x = 846
- integer y = 216
- integer width = 407
- integer height = 112
- integer taborder = 170
- boolean bringtotop = true
- string text = "保存并退出"
- boolean default = true
- string normalpicname = "open.bmp"
- integer picsize = 16
- end type
- event clicked;call super::clicked;Integer rp_type
- String arg_msg
- groupname = Trim(sle_2.Text)
- if rb_1.checked=true then
- if_Parent=0
- else
- if_Parent=1
- end if
- IF groupname = "" THEN
- MessageBox('Error!',"组名不能为空")
- RETURN
- END IF
- arg_msg = ""
- IF Save(arg_msg ) = 0 THEN //i 为printid
- MessageBox('Error!',arg_msg)
- RETURN
- END IF
- MessageBox(publ_operator,'保存操作成功!')
- Close(Parent)
- end event
- type cb_save_delet from uo_imflatbutton within w_rep_group_add
- integer x = 1394
- integer y = 216
- integer width = 393
- integer height = 112
- integer taborder = 180
- boolean bringtotop = true
- string text = "退出"
- boolean default = true
- string normalpicname = "delete.bmp"
- integer picsize = 16
- end type
- event clicked;call super::clicked;close(parent)
- end event
- type st_1 from statictext within w_rep_group_add
- boolean visible = false
- integer x = 32
- integer y = 36
- integer width = 507
- integer height = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "报表id:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_2 from statictext within w_rep_group_add
- integer x = 32
- integer y = 28
- integer width = 507
- integer height = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 134217751
- long backcolor = 134217748
- string text = "组名称:"
- boolean focusrectangle = false
- end type
- type sle_1 from singlelineedit within w_rep_group_add
- boolean visible = false
- integer x = 535
- integer y = 20
- integer width = 494
- integer height = 84
- integer taborder = 10
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- boolean border = false
- end type
- type sle_2 from singlelineedit within w_rep_group_add
- integer x = 288
- integer y = 24
- integer width = 1495
- 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
- long backcolor = 134217750
- boolean border = false
- end type
- type rb_1 from radiobutton within w_rep_group_add
- integer x = 293
- integer y = 132
- integer width = 233
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "父项"
- boolean checked = true
- end type
- type rb_2 from radiobutton within w_rep_group_add
- integer x = 713
- integer y = 132
- integer width = 233
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "子项"
- end type
- type r_bar from rectangle within w_rep_group_add
- boolean visible = false
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 4530
- integer y = 544
- integer width = 146
- integer height = 68
- end type
- event constructor;this.fillcolor = 14215660
- this.linecolor = 14215660
- this.x = -1
- this.y = -1
- //this.height = ln_bar.beginy - 5
- //
- end event
|