$PBExportHeader$w_rep_group.srw forward global type w_rep_group from w_publ_choice end type type cb_1 from uo_imflatbutton within w_rep_group end type type cb_2 from uo_imflatbutton within w_rep_group end type type cb_3 from uo_imflatbutton within w_rep_group end type type cb_4 from uo_imflatbutton within w_rep_group end type type dw_1 from u_dw_rbtnfilter within w_rep_group end type type dw_2 from u_dw_rbtnfilter within w_rep_group end type type cb_5 from uo_imflatbutton within w_rep_group end type type cb_7 from uo_imflatbutton within w_rep_group end type type cb_ext from uo_imflatbutton within w_rep_group end type type cb_13 from uo_imflatbutton within w_rep_group end type type cb_8 from uo_imflatbutton within w_rep_group end type type cb_9 from uo_imflatbutton within w_rep_group end type type cb_6 from uo_imflatbutton within w_rep_group end type type cb_10 from uo_imflatbutton within w_rep_group end type type dw_3 from u_dw_rbtnfilter within w_rep_group end type type cb_11 from uo_imflatbutton within w_rep_group end type type st_2 from statictext within w_rep_group end type type ln_3 from line within w_rep_group end type type s_kh from structure within w_rep_group end type type s_group_cust_spt from structure within w_rep_group end type end forward type s_kh from structure integer l_star integer l_end end type type s_group_cust_spt from structure string name string email string phone end type global type w_rep_group from w_publ_choice integer width = 4398 integer height = 2956 string title = "邮件短信接收人自定义分组" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true windowtype windowtype = main! windowstate windowstate = maximized! cb_1 cb_1 cb_2 cb_2 cb_3 cb_3 cb_4 cb_4 dw_1 dw_1 dw_2 dw_2 cb_5 cb_5 cb_7 cb_7 cb_ext cb_ext cb_13 cb_13 cb_8 cb_8 cb_9 cb_9 cb_6 cb_6 cb_10 cb_10 dw_3 dw_3 cb_11 cb_11 st_2 st_2 ln_3 ln_3 end type global w_rep_group w_rep_group type variables string s_col="",s_text="" integer l_row=0 long groupid datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep end variables forward prototypes public subroutine p_clearmx () public function integer cancel (ref string arg_msg) public function integer acceptmx (long arg_rpid, integer arg_rowcode, string arg_rowname, integer arg_rowtype, integer arg_rowcmpltype, string arg_rowformula1, string arg_rowformula2) public subroutine f_bulid_rp (integer row) public function string of_globalreplace (string as_source, string as_old, string as_new) public function integer f_writefile (blob ib_file, string is_filename) public function integer f_get_rpid () public subroutine f_readfile () public subroutine f_create_zcfzb () public subroutine f_creat_lrb () public subroutine wf_face () public function string of_globalreplace1 (string as_source, string as_old, string as_new) public function integer save () public subroutine f_add (integer arg_i, string arg_s) public subroutine wf_init_dw () public subroutine wf_init (integer arg_dw) public function s_group_cust_spt wf_cusorspt_name (long arg_reltype, long arg_relid, long arg_repid) end prototypes public subroutine p_clearmx ();groupid=0 end subroutine public function integer cancel (ref string arg_msg);int rslt=1 return rslt end function public function integer acceptmx (long arg_rpid, integer arg_rowcode, string arg_rowname, integer arg_rowtype, integer arg_rowcmpltype, string arg_rowformula1, string arg_rowformula2);Int rslt = 1 p_clearmx() // //if isnull(arg_rpid) then arg_rpid=0 //if isnull(arg_rowcode) then arg_rowcode=0 //if isnull(arg_rowname) then arg_rowname="" //if isnull( arg_rowtype ) then arg_rowtype=0 //if isnull(rowcmpltype) then rowcmpltype=0 //if isnull(arg_Rowformula1) then arg_Rowformula1="" //if isnull(arg_Rowformula2) then arg_Rowformula2="" // // //rpid = arg_rpid //rowcode = arg_rowcode //rowname = arg_rowname //rowtype = arg_rowtype //rowcmpltype = arg_rowcmpltype //Rowformula1 = arg_Rowformula1 //Rowformula2 = arg_Rowformula2 // //IF rpid = 0 THEN // MessageBox("Error","报表id错误") // rslt = 0 // GOTO ext //END IF // // // // // // // // //ext: IF rslt = 0 THEN p_clearmx() RETURN rslt end function public subroutine f_bulid_rp (integer row); end subroutine public function string of_globalreplace (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos ll_pos = Pos(as_source,as_old) IF ll_pos > 0 Then ll_oldlen = Len(as_old) ll_newlen = Len(as_new) as_source = Replace(as_source,ll_pos,ll_oldlen,as_new) ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen) END IF RETURN as_source end function public function integer f_writefile (blob ib_file, string is_filename);uLONG ll_len,li_count,loops int li_FileNum blob lblb_b,b_x int liResult = 1 ////f_readfile(b_x,is_filename) ////ib_file=blob(string(ib_file) +char(13) +char(10) + string(b_x)) ////////////////////////////////////////////////////////////// //ll_len=len(ib_file) //IF ll_len > 32765 THEN // IF Mod(ll_len, 32765) = 0 THEN // loops = ll_len/32765 // ELSE // loops = (ll_len/32765) + 1 // END IF //ELSE // loops = 1 //END IF // // //li_FileNum = FileOpen(is_filename,StreamMode!, write!, shared!,Replace!) //if li_FileNum = -1 then // messagebox("系统提示","无法打开文件"+is_filename) // return 0 //end if //FOR li_count = 1 to loops // lblb_b = blobmid( ib_file , ( li_count - 1) * 32765 + 1 , 32765 ) // if FileWrite(li_FileNum, lblb_b) = -1 then // messagebox("系统提示","写文件" + is_filename+"失败") // liResult=0 // exit // end if//8010 //NEXT //Fileclose(li_FileNum) // ////if liResult=1 then //// liResult = gf_setfiletime(is_filename,idt_file_time) ////end if // return liResult end function public function integer f_get_rpid ();Long ll_row, ll_i FOR ll_i = dw_1.RowCount() To 1 Step -1 IF dw_1.IsSelected(ll_i) THEN ll_row = ll_i END IF NEXT IF ll_row <= 0 THEN RETURN 0 groupid = dw_1.Object.groupid[ll_row] end function public subroutine f_readfile (); end subroutine public subroutine f_create_zcfzb (); end subroutine public subroutine f_creat_lrb (); end subroutine public subroutine wf_face ();Int LS_INT IF dw_edit_mode = True THEN cb_1.Enabled = False cb_2.Enabled = False cb_3.Enabled = False cb_4.Enabled = False cb_5.Enabled = True cb_6.Enabled = True cb_7.Enabled = True cb_8.Enabled = True cb_9.Enabled = True cb_10.Enabled = True dw_1.Enabled = False FOR LS_INT = 1 To 20 dw_2.SetTabOrder (LS_INT,LS_INT*0 ) NEXT ELSE cb_1.Enabled = True cb_2.Enabled = True cb_3.Enabled = True cb_4.Enabled = True cb_5.Enabled = False cb_6.Enabled = False cb_7.Enabled = False cb_8.Enabled = False cb_9.Enabled = False cb_10.Enabled = False dw_1.Enabled = True FOR LS_INT = 1 To 20 dw_2.SetTabOrder (LS_INT,LS_INT*0 ) NEXT END IF IF dw_1.Object.if_parent[dw_1.GetRow()] = 1 THEN cb_10.Enabled = False END IF dw_2.Retrieve(groupid) wf_init(0) end subroutine public function string of_globalreplace1 (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos ll_pos = Pos(as_source,as_old) IF ll_pos > 0 Then ll_oldlen = Len(as_old) ll_newlen = Len(as_new) DO WHILE ll_pos > 0 as_source = Replace(as_source,ll_pos,ll_oldlen,as_new) ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen) LOOP END IF RETURN as_source end function public function integer save ();Integer rslt = 1 string ls_errmsg dw_2.AcceptText() IF dw_2.Update() = -1 THEN ROLLBACK; rslt=0 RETURN rslt ELSE COMMIT; END IF RETURN rslt end function public subroutine f_add (integer arg_i, string arg_s); end subroutine public subroutine wf_init_dw ();//datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep open(w_sys_wait) dw_group_u_cust = Create datastore dw_group_u_cust.DataObject = 'dw_group_u_cust' dw_group_u_cust.SetTransObject(sqlca) dw_group_u_cust.Retrieve() // dw_group_u_cust_rep = Create datastore dw_group_u_cust_rep.DataObject = 'dw_group_u_cust_rep' dw_group_u_cust_rep.SetTransObject(sqlca) dw_group_u_cust_rep.Retrieve() // dw_group_u_spt = Create datastore dw_group_u_spt.DataObject = 'dw_group_u_spt' dw_group_u_spt.SetTransObject(sqlca) dw_group_u_spt.Retrieve() // dw_group_u_spt_rep = Create datastore dw_group_u_spt_rep.DataObject = 'dw_group_u_spt_rep' dw_group_u_spt_rep.SetTransObject(sqlca) dw_group_u_spt_rep.Retrieve() close(w_sys_wait) end subroutine public subroutine wf_init (integer arg_dw);Long i,reltype,relid,repid s_group_cust_spt ss_group_cust_spt IF arg_dw = 0 THEN FOR i = 1 To dw_2.RowCount() reltype = dw_2.Object.reltype[i] relid = dw_2.Object.relid[i] repid = dw_2.Object.repid[i] ss_group_cust_spt=wf_cusorspt_name( reltype, relid , repid ) dw_2.Object.Name[i] = ss_group_cust_spt.name dw_2.Object.email[i] = ss_group_cust_spt.email dw_2.Object.phone[i] = ss_group_cust_spt.phone NEXT END IF IF arg_dw = 1 THEN FOR i = 1 To dw_3.RowCount() reltype = dw_3.Object.reltype[i] relid = dw_3.Object.relid[i] repid = dw_3.Object.repid[i] ss_group_cust_spt=wf_cusorspt_name( reltype, relid , repid ) dw_3.Object.Name[i] = ss_group_cust_spt.name dw_3.Object.email[i] = ss_group_cust_spt.email dw_3.Object.phone[i] = ss_group_cust_spt.phone NEXT END IF // // end subroutine public function s_group_cust_spt wf_cusorspt_name (long arg_reltype, long arg_relid, long arg_repid);//datastore dw_group_u_cust,dw_group_u_cust_rep,dw_group_u_spt,dw_group_u_spt_rep String ls_name,ls_name1,ls_name2 String Name,tele,email s_group_cust_spt ss_group_cust_spt Long i IF arg_reltype = 0 THEN IF arg_repid = 0 THEN FOR i = 1 To dw_group_u_cust.RowCount() IF dw_group_u_cust.Object.cusid[i] = arg_relid THEN ss_group_cust_spt.Name = dw_group_u_cust.Object.Name[i]+'_' +dw_group_u_cust.Object.rep[i] ss_group_cust_spt.phone = dw_group_u_cust.Object.tele1[i] ss_group_cust_spt.email = dw_group_u_cust.Object.email[i] EXIT END IF NEXT ELSE FOR i = 1 To dw_group_u_cust.RowCount() IF dw_group_u_cust.Object.cusid[i] = arg_relid THEN ls_name1 = dw_group_u_cust.Object.Name[i] EXIT END IF NEXT FOR i = 1 To dw_group_u_cust_rep.RowCount() IF dw_group_u_cust_rep.Object.cusid[i] = arg_relid And dw_group_u_cust_rep.Object.repid[i] = arg_repid THEN ls_name2 = dw_group_u_cust_rep.Object.repname[i] ss_group_cust_spt.Name = ls_name1+'_' +ls_name2 ss_group_cust_spt.phone = dw_group_u_cust_rep.Object.handtel[i] ss_group_cust_spt.email = dw_group_u_cust_rep.Object.email[i] EXIT END IF NEXT END IF ELSEIF arg_reltype = 1 THEN IF arg_repid = 0 THEN FOR i = 1 To dw_group_u_spt.RowCount() IF dw_group_u_spt.Object.sptid[i] = arg_relid THEN ss_group_cust_spt.Name = dw_group_u_spt.Object.Name[i]+'_' +dw_group_u_spt.Object.rep[i] ss_group_cust_spt.phone = dw_group_u_spt.Object.tele1[i] ss_group_cust_spt.email = dw_group_u_spt.Object.email[i] EXIT END IF NEXT ELSE FOR i = 1 To dw_group_u_spt.RowCount() IF dw_group_u_spt.Object.sptid[i] = arg_relid THEN ls_name1 = dw_group_u_spt.Object.Name[i] EXIT END IF NEXT FOR i = 1 To dw_group_u_spt_rep.RowCount() IF dw_group_u_spt_rep.Object.sptid[i] = arg_relid And dw_group_u_spt_rep.Object.repid[i] = arg_repid THEN ls_name2 = dw_group_u_spt_rep.Object.repname[i] ss_group_cust_spt.Name = ls_name1+'_' +ls_name2 ss_group_cust_spt.phone = dw_group_u_spt_rep.Object.handtel[i] ss_group_cust_spt.email = dw_group_u_spt_rep.Object.email[i] EXIT END IF NEXT END IF ELSEIF arg_reltype = 2 THEN SELECT u_rep_group.groupname Into :ls_name2 From u_rep_group Where u_rep_group.groupid = :arg_relid; ls_name = '自定义组_' +ls_name2 ss_group_cust_spt.Name = ls_name ss_group_cust_spt.phone = '' ss_group_cust_spt.email = '' END IF return ss_group_cust_spt end function on w_rep_group.create int iCurrent call super::create this.cb_1=create cb_1 this.cb_2=create cb_2 this.cb_3=create cb_3 this.cb_4=create cb_4 this.dw_1=create dw_1 this.dw_2=create dw_2 this.cb_5=create cb_5 this.cb_7=create cb_7 this.cb_ext=create cb_ext this.cb_13=create cb_13 this.cb_8=create cb_8 this.cb_9=create cb_9 this.cb_6=create cb_6 this.cb_10=create cb_10 this.dw_3=create dw_3 this.cb_11=create cb_11 this.st_2=create st_2 this.ln_3=create ln_3 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_1 this.Control[iCurrent+2]=this.cb_2 this.Control[iCurrent+3]=this.cb_3 this.Control[iCurrent+4]=this.cb_4 this.Control[iCurrent+5]=this.dw_1 this.Control[iCurrent+6]=this.dw_2 this.Control[iCurrent+7]=this.cb_5 this.Control[iCurrent+8]=this.cb_7 this.Control[iCurrent+9]=this.cb_ext this.Control[iCurrent+10]=this.cb_13 this.Control[iCurrent+11]=this.cb_8 this.Control[iCurrent+12]=this.cb_9 this.Control[iCurrent+13]=this.cb_6 this.Control[iCurrent+14]=this.cb_10 this.Control[iCurrent+15]=this.dw_3 this.Control[iCurrent+16]=this.cb_11 this.Control[iCurrent+17]=this.st_2 this.Control[iCurrent+18]=this.ln_3 end on on w_rep_group.destroy call super::destroy destroy(this.cb_1) destroy(this.cb_2) destroy(this.cb_3) destroy(this.cb_4) destroy(this.dw_1) destroy(this.dw_2) destroy(this.cb_5) destroy(this.cb_7) destroy(this.cb_ext) destroy(this.cb_13) destroy(this.cb_8) destroy(this.cb_9) destroy(this.cb_6) destroy(this.cb_10) destroy(this.dw_3) destroy(this.cb_11) destroy(this.st_2) destroy(this.ln_3) end on event resize;call super::resize;dw_1.Height = This.Height -dw_1.Y - 200 dw_2.Height = dw_1.Height dw_2.Width = This.Width -dw_2.X - 50 dw_3.x=dw_2.x+500 dw_3.Height=dw_2.Height dw_3.Width=dw_2.Width - 500 //cb_ext.x=this.width - cb_ext.width st_2.y =dw_1.y + dw_1.Height + 10 end event event open;call super::open;dw_1.SetTransObject (sqlca) dw_1.Retrieve() dw_2.SetTransObject (sqlca) dw_3.SetTransObject (sqlca) //rb_1.TriggerEvent(Clicked!) dw_3.Visible = False wf_init_dw() Int LS_INT FOR LS_INT = 1 To 20 dw_2.SetTabOrder (LS_INT,0 ) NEXT end event type cb_func from w_publ_choice`cb_func within w_rep_group boolean visible = false end type type cb_exit from w_publ_choice`cb_exit within w_rep_group boolean visible = false end type type sle_ch from w_publ_choice`sle_ch within w_rep_group boolean visible = false end type type dw_ch from w_publ_choice`dw_ch within w_rep_group boolean visible = false end type type st_1 from w_publ_choice`st_1 within w_rep_group boolean visible = false end type type cb_retrieve from w_publ_choice`cb_retrieve within w_rep_group boolean visible = false end type type cb_choice from w_publ_choice`cb_choice within w_rep_group boolean visible = false end type type ln_bar from w_publ_choice`ln_bar within w_rep_group integer beginx = 5 integer endx = 2011 end type type ln_bar2 from w_publ_choice`ln_bar2 within w_rep_group integer beginx = 9 integer endx = 2048 end type type r_bar from w_publ_choice`r_bar within w_rep_group integer x = 1595 end type type ln_1 from w_publ_choice`ln_1 within w_rep_group integer beginx = 14 integer beginy = 192 integer endx = 2030 integer endy = 192 end type type ln_2 from w_publ_choice`ln_2 within w_rep_group integer beginx = 9 integer beginy = 184 integer endx = 2057 integer endy = 184 end type type cb_1 from uo_imflatbutton within w_rep_group integer width = 192 integer height = 164 integer taborder = 130 boolean bringtotop = true string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;dw_1.Retrieve() end event type cb_2 from uo_imflatbutton within w_rep_group integer x = 192 integer width = 192 integer height = 164 integer taborder = 180 boolean bringtotop = true string text = "新建&S" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not IsValid(w_rep_group_add) THEN String s s = "new" OpenWithParm(w_rep_group_add,s ) cb_1.TriggerEvent(Clicked!) END IF end event type cb_3 from uo_imflatbutton within w_rep_group integer x = 384 integer width = 192 integer height = 164 integer taborder = 190 boolean bringtotop = true string text = "修改&E" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Long ll_row, ll_i IF Not IsValid(w_rep_group_add) THEN String s FOR ll_i = dw_1.RowCount() To 1 Step -1 IF dw_1.IsSelected(ll_i) THEN ll_row = ll_i END IF NEXT IF ll_row <= 0 THEN RETURN s = String(dw_1.Object.groupid[ll_row]) OpenWithParm(w_rep_group_add,s ) cb_1.TriggerEvent(Clicked!) END IF end event type cb_4 from uo_imflatbutton within w_rep_group integer x = 576 integer width = 197 integer height = 164 integer taborder = 200 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Long ll_row,l_groupid,ll_i String arG_MSG //ll_row = dw_1.GetRow() FOR ll_i = dw_1.RowCount() TO 1 STEP -1 IF dw_1.IsSelected(ll_i) THEN ll_row=ll_i END IF NEXT IF ll_row <= 0 THEN RETURN IF MessageBox('提示信息','确定删除当前选中组?', Question! ,YesNo! , 1 ) = 1 THEN ELSE RETURN END IF l_groupid = dw_1.Object.groupid[ll_row] DELETE From u_rep_group Where u_rep_group.groupid = :l_groupid; IF sqlca.SQLCode <> 0 THEN arG_MSG = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText MessageBox("Error",arG_MSG) ROLLBACK Using sqlca; GOTO ext END IF COMMIT Using sqlca; dw_1.DeleteRow(ll_row) dw_1.SelectRow(dw_1.rowcount(),true) dw_1.SetRow(dw_1.rowcount()) ext: RETURN end event type dw_1 from u_dw_rbtnfilter within w_rep_group integer x = 5 integer y = 208 integer width = 1403 integer height = 1632 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_rep_group" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;long ll_groupid IF row <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(row,True) This.SetRow(row) IF dw_1.GetRow() <= 0 THEN ll_groupid = 0 ELSE ll_groupid = dw_1.Object.groupid[dw_1.GetRow()] END IF dw_2.reset() dw_2.Retrieve(ll_groupid) //dw_3.reset() //dw_3.Retrieve(ll_groupid) wf_init(0) //IF cb_8.Enabled = True THEN // IF MessageBox('提示信息','是否保存报表设计?', Question! ,YesNo! , 1 ) = 1 THEN // cb_8.TriggerEvent(Clicked!) // END IF //END IF //rp_dw_row=row //f_bulid_rp(rp_dw_row) //Int LS_INT //FOR LS_INT = 1 To 20 // dw_2.SetTabOrder (LS_INT,0 ) //NEXT end event type dw_2 from u_dw_rbtnfilter within w_rep_group integer x = 1422 integer y = 204 integer width = 1755 integer height = 1640 integer taborder = 30 boolean bringtotop = true string dataobject = "dw_rep_groupmx" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event itemchanged;call super::itemchanged; //s_text="" //IF s_col = "" Or l_row = 0 THEN // s_col = dwo.Name // l_row = row // GOTO ext //END IF // //IF s_col = "sql_l1" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_l1[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_l1[l_row] = mle_1.Text // END IF // //ELSEIF dwo.Name = "sql_l2" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_l2[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_l2[l_row] = mle_1.Text // END IF //ELSEIF dwo.Name = "sql_r1" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_r1[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_r1[l_row] = mle_1.Text // END IF //ELSEIF dwo.Name = "sql_r2" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_r2[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_r2[l_row] = mle_1.Text // END IF //END IF //s_col = dwo.Name //l_row = row //ext: //RETURN // // // // // // // // // // // // end event event clicked;call super::clicked;IF row <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(row,True) end event type cb_5 from uo_imflatbutton within w_rep_group integer x = 3383 integer width = 192 integer height = 164 integer taborder = 210 boolean bringtotop = true boolean enabled = false string text = "删行" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;dw_2.DeleteRow(dw_2.GetRow()) end event type cb_7 from uo_imflatbutton within w_rep_group integer x = 2112 integer width = 384 integer height = 164 integer taborder = 220 boolean bringtotop = true boolean enabled = false string text = "增客户联系人" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;s_rep_group_parm s_sendmx, s_return Long i, j,ll_row s_edit_index_tran ss_tran OpenWithParm(w_email_seach_cust_group,ss_tran) s_return = Message.PowerObjectParm IF Not IsValid(s_return) THEN RETURN FOR i = 1 To UpperBound(s_return.s_group) FOR j = 1 To dw_2.RowCount() IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN GOTO ext1 END IF NEXT ll_row = dw_2.InsertRow(0) dw_2.Object.groupid[ll_row] = groupid dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype dw_2.Object.relid[ll_row] = s_return.s_group[i].relid dw_2.Object.repid[ll_row] = s_return.s_group[i].repid ext1: NEXT wf_init(0) end event type cb_ext from uo_imflatbutton within w_rep_group integer x = 777 integer width = 210 integer height = 164 integer taborder = 220 boolean bringtotop = true string text = "退出" string normalpicname = "exit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;close(parent) end event type cb_13 from uo_imflatbutton within w_rep_group integer x = 1426 integer width = 192 integer height = 164 integer taborder = 190 boolean bringtotop = true string text = "修改" string normalpicname = "audit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;groupid = 0 f_get_rpid() IF groupid = 0 Or IsNull(groupid) THEN MessageBox("error","请选择组") return END IF dw_edit_mode = Not dw_edit_mode Int LS_INT FOR LS_INT = 1 To 20 dw_2.SetTabOrder (LS_INT,LS_INT*10 ) NEXT wf_face() end event type cb_8 from uo_imflatbutton within w_rep_group integer x = 1623 integer width = 192 integer height = 164 integer taborder = 200 boolean bringtotop = true boolean enabled = false string text = "保存" string normalpicname = "save.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;if save()=0 then MessageBox (publ_operator,"保存操作失败!",Exclamation!,OK!) dw_2.reset() dw_2.Retrieve(groupid) else MessageBox (publ_operator,"保存成功!",Exclamation!,OK!) end if dw_edit_mode = Not dw_edit_mode wf_face() end event type cb_9 from uo_imflatbutton within w_rep_group integer x = 1819 integer width = 192 integer height = 164 integer taborder = 210 boolean bringtotop = true boolean enabled = false string text = "放弃" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;dw_edit_mode = Not dw_edit_mode wf_face() end event type cb_6 from uo_imflatbutton within w_rep_group integer x = 2505 integer width = 439 integer height = 164 integer taborder = 230 boolean bringtotop = true boolean enabled = false string text = "增供应商联系人" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; s_rep_group_parm s_sendmx, s_return Long i,j, ll_row s_edit_index_tran ss_tran OpenWithParm(w_email_seach_spt_group,ss_tran) s_return = Message.PowerObjectParm IF Not IsValid(s_return) THEN RETURN FOR i = 1 To UpperBound(s_return.s_group) FOR j = 1 To dw_2.RowCount() IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN GOTO ext1 END IF NEXT ll_row = dw_2.InsertRow(0) dw_2.Object.groupid[ll_row] = groupid dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype dw_2.Object.relid[ll_row] = s_return.s_group[i].relid dw_2.Object.repid[ll_row] = s_return.s_group[i].repid ext1: NEXT wf_init(0) end event type cb_10 from uo_imflatbutton within w_rep_group integer x = 2944 integer width = 439 integer height = 164 integer taborder = 240 boolean bringtotop = true boolean enabled = false string text = "增自定义组" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; s_rep_group_parm s_sendmx, s_return Long i,j, ll_row s_edit_index_tran ss_tran OpenWithParm(w_email_seach_self_group,ss_tran) s_return = Message.PowerObjectParm IF Not IsValid(s_return) THEN RETURN FOR i = 1 To UpperBound(s_return.s_group) FOR j = 1 To dw_2.RowCount() IF dw_2.Object.reltype[j] = s_return.s_group[i].reltype And dw_2.Object.relid[j] = s_return.s_group[i].relid And dw_2.Object.repid[j] = s_return.s_group[i].repid THEN GOTO ext1 END IF NEXT ll_row = dw_2.InsertRow(0) dw_2.Object.groupid[ll_row] = groupid dw_2.Object.reltype[ll_row] = s_return.s_group[i].reltype dw_2.Object.relid[ll_row] = s_return.s_group[i].relid dw_2.Object.repid[ll_row] = s_return.s_group[i].repid ext1: NEXT wf_init(0) end event type dw_3 from u_dw_rbtnfilter within w_rep_group integer x = 1824 integer y = 208 integer width = 1755 integer height = 1640 integer taborder = 40 boolean bringtotop = true boolean titlebar = true string dataobject = "dw_rep_groupmx_copy" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;IF row <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(row,True) end event event itemchanged;call super::itemchanged; //s_text="" //IF s_col = "" Or l_row = 0 THEN // s_col = dwo.Name // l_row = row // GOTO ext //END IF // //IF s_col = "sql_l1" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_l1[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_l1[l_row] = mle_1.Text // END IF // //ELSEIF dwo.Name = "sql_l2" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_l2[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_l2[l_row] = mle_1.Text // END IF //ELSEIF dwo.Name = "sql_r1" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_r1[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_r1[l_row] = mle_1.Text // END IF //ELSEIF dwo.Name = "sql_r2" THEN // IF rb_1.Checked = True THEN // dw_2.Object.sql_r2[l_row] = sle_1.Text // ELSE // dw_2.Object.sql_r2[l_row] = mle_1.Text // END IF //END IF //s_col = dwo.Name //l_row = row //ext: //RETURN // // // // // // // // // // // // end event type cb_11 from uo_imflatbutton within w_rep_group integer x = 3808 integer width = 439 integer height = 164 integer taborder = 250 boolean bringtotop = true string text = "展开所有分组" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;datastore dw_x Long i,j,ll_groupid dw_x = Create datastore dw_x.DataObject = 'dw_rep_groupmx' dw_x.SetTransObject(sqlca) IF dw_2.RowCount() <= 0 THEN RETURN dw_3.Visible = Not dw_3.Visible IF dw_3.Visible = True THEN This.Text = "收起所有分组" ELSE This.Text = "展开所有分组" END IF IF dw_3.Visible = True THEN dw_3.Reset() FOR i = 1 To dw_2.RowCount() IF dw_2.Object.reltype[i] <> 2 THEN dw_2.RowsCopy (i,i,Primary!,dw_3,dw_3.RowCount() + 1,Primary!) ELSE dw_x.Reset() ll_groupid = dw_2.Object.relid[i] dw_x.Retrieve(ll_groupid) dw_x.RowsCopy (1,dw_x.RowCount(),Primary!,dw_3,dw_3.RowCount() + 1,Primary!) END IF NEXT wf_init(1) END IF end event type st_2 from statictext within w_rep_group integer x = 23 integer y = 2772 integer width = 2089 integer height = 72 boolean bringtotop = true integer textsize = -9 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 134217857 long backcolor = 67108864 string text = "提示:只有父项可添加子项,子项不能添加子项" boolean focusrectangle = false end type type ln_3 from line within w_rep_group long linecolor = 268435456 integer linethickness = 18 integer beginx = 1413 integer beginy = 4 integer endx = 1413 integer endy = 160 end type