$PBExportHeader$w_cus_ecomm_cus_rep_edit.srw forward global type w_cus_ecomm_cus_rep_edit from w_publ_base end type type dw_cus_user from u_dw_rbtnfilter within w_cus_ecomm_cus_rep_edit end type type tab_1 from tab within w_cus_ecomm_cus_rep_edit end type type tabpage_1 from userobject within tab_1 end type type tv_2 from uo_ljfieb_tv_pwr within tabpage_1 end type type tabpage_1 from userobject within tab_1 tv_2 tv_2 end type type tabpage_2 from userobject within tab_1 end type type dw_cm from u_dw_rbtnfilter within tabpage_2 end type type cb_add_cm from uo_imflatbutton within tabpage_2 end type type cb_del_cm from uo_imflatbutton within tabpage_2 end type type cb_undo_cm from uo_imflatbutton within tabpage_2 end type type cb_new_cm from uo_imflatbutton within tabpage_2 end type type r_bar_cm from rectangle within tabpage_2 end type type ln_3 from line within tabpage_2 end type type ln_4 from line within tabpage_2 end type type tabpage_2 from userobject within tab_1 dw_cm dw_cm cb_add_cm cb_add_cm cb_del_cm cb_del_cm cb_undo_cm cb_undo_cm cb_new_cm cb_new_cm r_bar_cm r_bar_cm ln_3 ln_3 ln_4 ln_4 end type type tab_1 from tab within w_cus_ecomm_cus_rep_edit tabpage_1 tabpage_1 tabpage_2 tabpage_2 end type type cb_retrievemx from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_add from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_edit from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_del from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_copy from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_copy_p from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_reset from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_help from uo_imflatbutton within w_cus_ecomm_cus_rep_edit end type type cb_view_all from commandbutton within w_cus_ecomm_cus_rep_edit end type type ln_bar from line within w_cus_ecomm_cus_rep_edit end type type ln_bar2 from line within w_cus_ecomm_cus_rep_edit end type type r_bar from rectangle within w_cus_ecomm_cus_rep_edit end type end forward global type w_cus_ecomm_cus_rep_edit from w_publ_base integer width = 3611 integer height = 2380 string title = "客户协同用户资料" windowstate windowstate = maximized! event ue_help ( ) event ue_send_cust ( ) event ue_send_cust_rep ( ) event ue_send_funcpwreb ( ) event retrieve_cus_rep_pwr ( ) dw_cus_user dw_cus_user tab_1 tab_1 cb_retrievemx cb_retrievemx cb_add cb_add cb_edit cb_edit cb_del cb_del cb_copy cb_copy cb_copy_p cb_copy_p cb_reset cb_reset cb_help cb_help cb_view_all cb_view_all ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar end type global w_cus_ecomm_cus_rep_edit w_cus_ecomm_cus_rep_edit type variables long ins_cusid = -1 long copy_repid uo_ljfieb_tv_pwr tv_2 datawindow dw_cm end variables forward prototypes public function integer wf_save (ref string arg_msg) public subroutine wf_facecm () public subroutine wf_retrievecm () end prototypes event ue_help();htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".htm") end event event ue_send_cust();uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca Long ll_cusid_arr[] String arg_msg Integer rslt = 1 Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN rslt = 0 arg_msg = '选择要发送的客户' GOTO ext END IF ll_cusid_arr[1] = dw_cus_user.Object.cusid[ll_row] IF uo_fieb.send_cust(0, ll_cusid_arr, '', '', '', arg_msg, True) = 0 THEN rslt = 0 GOTO ext END IF ext: Destroy uo_fieb IF rslt = 0 THEN MessageBox('系统提示',arg_msg) ELSE MessageBox('系统提示',"发送电子商务客户成功") END IF RETURN end event event ue_send_cust_rep();uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca Long ll_repid_arr[] String arg_msg Integer rslt = 1 Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN rslt = 0 arg_msg = '请选择用户' GOTO ext END IF ll_repid_arr[1] = dw_cus_user.Object.repid[ll_row] IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '',False, arg_msg, True) = 0 THEN rslt = 0 GOTO ext END IF ext: Destroy uo_fieb IF rslt = 0 THEN MessageBox('系统提示',arg_msg) ELSE MessageBox('系统提示',"发送电子商务用户成功") END IF RETURN end event event ue_send_funcpwreb();Int rslt = 1 String arg_msg uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca IF uo_fieb.send_funcpwreb(0, 0, '', '', '', arg_msg, True) = 0 THEN rslt = 0 GOTO ext END IF ext: Destroy uo_fieb IF rslt = 0 THEN MessageBox('系统提示',arg_msg) ELSE MessageBox('系统提示',"发送权限树成功") END IF RETURN end event event retrieve_cus_rep_pwr();long ll_row ll_row = dw_cus_user.GetRow() if ll_row <= 0 then return Long ll_repid ll_repid = dw_cus_user.Object.repid[ll_row] SetPointer(HourGlass!) string ls_Permissions IF ll_repid > 0 THEN SELECT Permissions INTO :ls_Permissions FROM ros_cust_rep Where repid = :ll_repid; IF sqlca.SQLCode <> 0 THEN ls_Permissions = '' END IF ELSE ls_Permissions = '' END IF //刷新权限 Long ll_handl ll_handl = tv_2.FindItem(RootTreeItem!,0) IF ll_handl > 0 THEN tv_2.pf_refresh_value(ll_handl,ls_Permissions) //刷新联系用户 wf_retrievecm() SetPointer(Arrow!) end event public function integer wf_save (ref string arg_msg);Int rslt = 1 Long ll_repid Long i, cnt String ls_ljemail_arr[] s_cus_rep_cm_ljfieb s_mx uo_ljfieb_cus uo_ljc uo_ljc = Create uo_ljfieb_cus uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN rslt = 0 arg_msg = '没有选中用户' GOTO ext END IF ll_repid = dw_cus_user.Object.repid[ll_row] FOR i = 1 To dw_cm.RowCount() s_mx.repid = ll_repid s_mx.ljemail = dw_cm.Object.ljemail[i] s_mx.username = dw_cm.Object.username[i] s_mx.cmtype = dw_cm.Object.cmtype[i] s_mx.dscrp = '' IF uo_ljc.uof_add_cust_rep_cm(s_mx, arg_msg, False) = 0 THEN arg_msg = '行:'+String(i)+','+arg_msg rslt = 0 GOTO ext END IF cnt++ ls_ljemail_arr[cnt] = dw_cm.Object.ljemail[i] NEXT IF uo_fieb.send_cust_rep_cm(0, ll_repid, ls_ljemail_arr, '', '', '', arg_msg, False) = 0 THEN arg_msg = '发送数据失败,'+arg_msg rslt = 0 GOTO ext END IF ext: Destroy uo_ljc Destroy uo_fieb IF rslt = 0 THEN ROLLBACK Using sqlca; ROLLBACK Using sys_email_sqlca; ELSE COMMIT Using sqlca; COMMIT Using sys_email_sqlca; END IF RETURN rslt end function public subroutine wf_facecm ();tab_1.tabpage_2.cb_new_cm.Enabled = (dw_cus_user.GetRow() > 0) tab_1.tabpage_2.cb_undo_cm.Enabled = dw_edit_mode AND (dw_cus_user.GetRow() > 0) tab_1.tabpage_2.cb_add_cm.Enabled = dw_edit_mode AND (dw_cus_user.GetRow() > 0) tab_1.tabpage_2.cb_del_cm.Enabled = Not dw_edit_mode AND (dw_cus_user.GetRow() > 0) IF dw_edit_mode THEN tab_1.tabpage_2.cb_new_cm.Text = '保存' tab_1.tabpage_2.cb_new_cm.normalpicname = 'save.bmp' ELSE tab_1.tabpage_2.cb_new_cm.Text = '修改' tab_1.tabpage_2.cb_new_cm.normalpicname = 'open.bmp' END IF tab_1.tabpage_2.cb_new_cm.of_init_draw() tab_1.tabpage_2.cb_new_cm.of_paint() tab_1.tabpage_2.cb_new_cm.TriggerEvent('ue_textchange') end subroutine public subroutine wf_retrievecm ();Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN dw_cm.Reset() RETURN END IF Long ll_repid ll_repid = dw_cus_user.Object.repid[ll_row] dw_cm.Retrieve(ll_repid) end subroutine on w_cus_ecomm_cus_rep_edit.create int iCurrent call super::create this.dw_cus_user=create dw_cus_user this.tab_1=create tab_1 this.cb_retrievemx=create cb_retrievemx this.cb_add=create cb_add this.cb_edit=create cb_edit this.cb_del=create cb_del this.cb_copy=create cb_copy this.cb_copy_p=create cb_copy_p this.cb_reset=create cb_reset this.cb_help=create cb_help this.cb_view_all=create cb_view_all this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_cus_user this.Control[iCurrent+2]=this.tab_1 this.Control[iCurrent+3]=this.cb_retrievemx this.Control[iCurrent+4]=this.cb_add this.Control[iCurrent+5]=this.cb_edit this.Control[iCurrent+6]=this.cb_del this.Control[iCurrent+7]=this.cb_copy this.Control[iCurrent+8]=this.cb_copy_p this.Control[iCurrent+9]=this.cb_reset this.Control[iCurrent+10]=this.cb_help this.Control[iCurrent+11]=this.cb_view_all this.Control[iCurrent+12]=this.ln_bar this.Control[iCurrent+13]=this.ln_bar2 this.Control[iCurrent+14]=this.r_bar end on on w_cus_ecomm_cus_rep_edit.destroy call super::destroy destroy(this.dw_cus_user) destroy(this.tab_1) destroy(this.cb_retrievemx) destroy(this.cb_add) destroy(this.cb_edit) destroy(this.cb_del) destroy(this.cb_copy) destroy(this.cb_copy_p) destroy(this.cb_reset) destroy(this.cb_help) destroy(this.cb_view_all) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) end on event resize;call super::resize;Long w_width,w_height w_width = 3600 w_height = 2300 IF newwidth < w_width THEN This.Width = w_width IF newheight < w_height THEN This.Height = w_height r_bar.Width = This.Width ln_bar.EndX = This.Width ln_bar2.EndX = This.Width dw_cus_user.Width = This.WorkSpaceWidth() - dw_cus_user.X - tab_1.Width tab_1.X = dw_cus_user.Width + dw_cus_user.X dw_cus_user.Height = This.WorkSpaceHeight() - dw_cus_user.Y tab_1.Height = This.WorkSpaceHeight() - tab_1.Y tv_2.Width = tab_1.Width - 37 tv_2.Height = tab_1.Height - 112 tab_1.tabpage_2.ln_3.EndX = tab_1.Width tab_1.tabpage_2.ln_4.EndX = tab_1.Width tab_1.tabpage_2.r_bar_cm.width = tab_1.width dw_cm.Width = tv_2.Width dw_cm.Height = tv_2.Height - dw_cm.Y end event event open;call super::open;s_edit_index_tran s_tran s_tran = Message.PowerObjectParm IF Not IsNull(s_tran) And IsValid(s_tran) THEN ins_cusid = s_tran.b_long END IF if ins_cusid > 0 then cb_view_all.Visible = true else ins_cusid = -1 cb_view_all.Visible = false end if tv_2 = tab_1.tabpage_1.tv_2 dw_cm = tab_1.tabpage_2.dw_cm dw_cus_user.SetTransObject(sqlca) dw_cm.SetTransObject(sqlca) cb_retrievemx.TriggerEvent(Clicked!) end event type cb_func from w_publ_base`cb_func within w_cus_ecomm_cus_rep_edit integer x = 1248 integer width = 151 integer height = 164 end type event cb_func::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=发送电子商务权限树~tEvent=ue_send_FuncPwrEB" menustr = menustr + "|" + "Text=发送电子商务客户~tEvent=ue_Send_cust" menustr = menustr + "|" + "Text=发送电子商务用户~tEvent=ue_Send_cust_rep" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu END IF end event type cb_exit from w_publ_base`cb_exit within w_cus_ecomm_cus_rep_edit integer x = 1550 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type dw_cus_user from u_dw_rbtnfilter within w_cus_ecomm_cus_rep_edit integer y = 184 integer width = 2427 integer height = 644 integer taborder = 40 boolean bringtotop = true boolean titlebar = true string title = "客户协同用户资料" string dataobject = "dw_cust_ecomm_cus_rep" boolean maxbox = true boolean hscrollbar = true boolean vscrollbar = true boolean resizable = true boolean hsplitscroll = true borderstyle borderstyle = stylebox! boolean rbutton_filter_use = true boolean titleclick_sort_use = true end type event clicked;IF row > 0 THEN This.SetRow(row) This.SelectRow(0,False) This.SelectRow(row,True) END IF end event event rowfocuschanged;IF currentrow <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(currentrow,True) Parent.TriggerEvent("retrieve_cus_rep_pwr") wf_facecm() end event event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1 end event type tab_1 from tab within w_cus_ecomm_cus_rep_edit integer x = 2441 integer y = 184 integer width = 1166 integer height = 1200 integer taborder = 50 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean raggedright = true boolean focusonbuttondown = true integer selectedtab = 1 tabpage_1 tabpage_1 tabpage_2 tabpage_2 end type on tab_1.create this.tabpage_1=create tabpage_1 this.tabpage_2=create tabpage_2 this.Control[]={this.tabpage_1,& this.tabpage_2} end on on tab_1.destroy destroy(this.tabpage_1) destroy(this.tabpage_2) end on type tabpage_1 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 1129 integer height = 1088 long backcolor = 16777215 string text = "权限" long tabbackcolor = 134217739 long picturemaskcolor = 553648127 tv_2 tv_2 end type on tabpage_1.create this.tv_2=create tv_2 this.Control[]={this.tv_2} end on on tabpage_1.destroy destroy(this.tv_2) end on type tv_2 from uo_ljfieb_tv_pwr within tabpage_1 integer width = 1129 integer height = 1088 integer taborder = 50 end type type tabpage_2 from userobject within tab_1 event create ( ) event destroy ( ) integer x = 18 integer y = 96 integer width = 1129 integer height = 1088 long backcolor = 16777215 string text = "用户联系" long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_cm dw_cm cb_add_cm cb_add_cm cb_del_cm cb_del_cm cb_undo_cm cb_undo_cm cb_new_cm cb_new_cm r_bar_cm r_bar_cm ln_3 ln_3 ln_4 ln_4 end type on tabpage_2.create this.dw_cm=create dw_cm this.cb_add_cm=create cb_add_cm this.cb_del_cm=create cb_del_cm this.cb_undo_cm=create cb_undo_cm this.cb_new_cm=create cb_new_cm this.r_bar_cm=create r_bar_cm this.ln_3=create ln_3 this.ln_4=create ln_4 this.Control[]={this.dw_cm,& this.cb_add_cm,& this.cb_del_cm,& this.cb_undo_cm,& this.cb_new_cm,& this.r_bar_cm,& this.ln_3,& this.ln_4} end on on tabpage_2.destroy destroy(this.dw_cm) destroy(this.cb_add_cm) destroy(this.cb_del_cm) destroy(this.cb_undo_cm) destroy(this.cb_new_cm) destroy(this.r_bar_cm) destroy(this.ln_3) destroy(this.ln_4) end on type dw_cm from u_dw_rbtnfilter within tabpage_2 integer y = 184 integer width = 1605 integer height = 644 integer taborder = 100 boolean bringtotop = true string title = "用户联系表" string dataobject = "dw_cust_ecomm_cus_rep_cm" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true borderstyle borderstyle = stylebox! boolean titleclick_sort_use = true end type event clicked;IF row > 0 THEN This.SetRow(row) This.SelectRow(0,False) This.SelectRow(row,True) IF dwo.Name = 'ch' THEN This.SetTabOrder('ch',10) ELSE This.SetTabOrder('ch',0) END IF END IF end event event constructor;call super::constructor; RBUTTON_FILTER_USE=true //右键查询功能开关 end event event rowfocuschanged;IF currentrow <=0 THEN RETURN this.selectrow(0,false) this.selectrow(currentrow,true) end event event dwnkey;call super::dwnkey;parent.triggerevent('user_key') end event type cb_add_cm from uo_imflatbutton within tabpage_2 integer x = 302 integer width = 151 integer height = 164 integer taborder = 80 boolean bringtotop = true boolean enabled = false string text = "增加" string normalpicname = "mx.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not dw_edit_mode THEN RETURN Long i, ll_row Long ll_repid ll_row = dw_cus_user.GetRow() ll_repid = dw_cus_user.Object.repid[ll_row] OpenWithParm(w_cus_ecomm_rep_cm_ch, ll_repid) s_cus_rep_cm_ljfieb_arr s_mx_arr s_mx_arr = Message.PowerObjectParm FOR i = 1 To UpperBound(s_mx_arr.ljemail) ll_row = dw_cm.Find("ljemail = '"+s_mx_arr.ljemail[i]+"'", 1, dw_cm.RowCount()) IF ll_row > 0 THEN CONTINUE ll_row = dw_cm.InsertRow(0) dw_cm.Object.ljemail[ll_row] = s_mx_arr.ljemail[i] dw_cm.Object.username[ll_row] = s_mx_arr.username[i] dw_cm.Object.cmtype[ll_row] = s_mx_arr.cmtype[i] NEXT dw_cm.AcceptText() end event type cb_del_cm from uo_imflatbutton within tabpage_2 integer x = 453 integer width = 151 integer height = 164 integer taborder = 80 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 ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN RETURN END IF dw_cm.AcceptText() IF sys_email_sqlca.DBHandle() = 0 THEN MessageBox('Error','电子商务数据库连接未设置或失败,请检查') RETURN END IF Long ll_rows[] Long i,j = 0 FOR i = 1 To dw_cm.RowCount() IF dw_cm.Object.ch[i] = 1 THEN j++ ll_rows[j] = i END IF NEXT IF j <= 0 THEN i = dw_cm.GetRow() IF i <= 0 THEN MessageBox('Error','请选择要删除的用户联系人') RETURN END IF j++ ll_rows[j] = i END IF IF MessageBox('确定','是否确定删除当前勾选的用户联系人?',Question!, YesNo!) = 2 THEN RETURN END IF Int rslt = 1 String arg_msg Long ll_cnt Long ll_repid String ls_ljemail String ls_ljemail_arr[] ll_repid = dw_cus_user.Object.repid[ll_row] uo_ljfieb_cus uo_ljc uo_ljc = Create uo_ljfieb_cus uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca FOR i = 1 To UpperBound(ll_rows) ls_ljemail = dw_cm.Object.ljemail[ll_rows[i]] IF uo_ljc.uof_del_cust_rep_cm(ll_repid, ls_ljemail, arg_msg, False) = 0 THEN arg_msg = '行:'+String(ll_rows[i])+','+arg_msg rslt = 0 GOTO ext END IF NEXT j = 0 FOR i = 1 To UpperBound(ll_rows) j++ ls_ljemail_arr[j] = dw_cm.Object.ljemail[ll_rows[i]] NEXT IF uo_fieb.send_cust_rep_cm(0, ll_repid, ls_ljemail_arr, '', '', '', arg_msg, False) = 0 THEN arg_msg = '发送数据失败,'+arg_msg rslt = 0 GOTO ext END IF dw_cm.Retrieve(ll_repid) ext: Destroy uo_ljc Destroy uo_fieb IF rslt = 0 THEN ROLLBACK Using sqlca; ROLLBACK Using sys_email_sqlca; MessageBox('错误',arg_msg) RETURN ELSE COMMIT Using sqlca; COMMIT Using sys_email_sqlca; MessageBox('系统提示','删除联系人成功') END IF end event type cb_undo_cm from uo_imflatbutton within tabpage_2 integer x = 151 integer width = 151 integer height = 164 integer taborder = 20 boolean bringtotop = true boolean enabled = false string text = "取消" string normalpicname = "undo.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;//IF sys_email_sqlca.DBHandle() = 0 THEN // MessageBox('Error','电子商务数据库连接失败,请检查') // RETURN //END IF IF MessageBox('确定','是否确定放弃保存?',Question!, YesNo!) = 2 THEN RETURN END IF dw_edit_mode = not dw_edit_mode wf_facecm() wf_retrievecm() end event type cb_new_cm from uo_imflatbutton within tabpage_2 integer width = 151 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "修改" 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_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN RETURN END IF IF sys_email_sqlca.DBHandle() = 0 THEN MessageBox('Error','电子商务数据库连接失败,请检查') RETURN END IF String ls_msg IF dw_edit_mode THEN IF wf_save(ls_msg) <> 1 THEN MessageBox('Error', ls_msg) RETURN END IF END IF dw_edit_mode = Not dw_edit_mode wf_facecm() wf_retrievecm() end event type r_bar_cm from rectangle within tabpage_2 long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 581 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_4.beginy - 5 end event type ln_3 from line within tabpage_2 long linecolor = 16777215 integer linethickness = 4 integer beginy = 176 integer endx = 2039 integer endy = 176 end type type ln_4 from line within tabpage_2 long linecolor = 268435456 integer linethickness = 4 integer beginy = 172 integer endx = 2007 integer endy = 172 end type type cb_retrievemx from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer width = 151 integer height = 164 integer taborder = 30 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_cus_user.Retrieve(ins_cusid) end event type cb_add from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 151 integer width = 151 integer height = 164 integer taborder = 40 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;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF s_edit_index_tran s_tran Long ll_cusid, ll_repid ll_cusid = ins_cusid ll_repid = 0 IF ll_cusid <= 0 THEN // TODO: 选择客户协同的客户 END IF s_tran.b_long = ll_cusid s_tran.c_long = ll_repid s_tran.d_long = copy_repid OpenWithParm(w_cus_ecomm_edit_add, s_tran) cb_retrievemx.TriggerEvent(Clicked!) end event type cb_edit from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 302 integer width = 151 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "修改" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF s_edit_index_tran s_tran Long ll_cusid, ll_repid long ll_row ll_row = dw_cus_user.GetRow() if ll_row <= 0 then MessageBox("系统提示","请选择要修改的用户") RETURN end if ll_cusid = dw_cus_user.Object.cusid[ll_row] ll_repid = dw_cus_user.object.repid[ll_row] s_tran.b_long = ll_cusid s_tran.c_long = ll_repid s_tran.d_long = copy_repid OpenWithParm(w_cus_ecomm_edit_add, s_tran) cb_retrievemx.triggerevent(clicked!) end event type cb_del from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 453 integer width = 151 integer height = 164 integer taborder = 60 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;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF IF MessageBox("系统提示","是否确定要删除当前用户?", Question!, YesNo!) = 2 THEN RETURN Int rslt = 1 String arg_msg = '' uo_ljfieb_cus uo_ljc uo_ljc = Create uo_ljfieb_cus Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN rslt = 0 arg_msg = '请选择要删除的用户' GOTO ext END IF Long ll_repid ll_repid = dw_cus_user.Object.repid[ll_row] IF uo_ljc.uof_del_cust_rep(ll_repid,arg_msg,True) <> 1 THEN rslt = 0 GOTO ext END IF ext: Destroy uo_ljc IF rslt = 1 THEN cb_retrievemx.TriggerEvent(Clicked!) MessageBox('系统提示',"删除成功") ELSE MessageBox("系统提示", arg_msg) END IF end event type cb_copy from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 603 integer width = 151 integer height = 164 integer taborder = 70 boolean bringtotop = true string text = "复制" string normalpicname = "copy.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF Long ll_row ll_row = dw_cus_user.GetRow() IF ll_row <= 0 THEN MessageBox('系统提示',"请选择要复制的用户") RETURN END IF copy_repid = dw_cus_user.Object.repid[ll_row] String ls_loginname ls_loginname = dw_cus_user.Object.loginname[ll_row] MessageBox('系统提示',"复制用户["+String(ls_loginname)+"]权限成功") end event type cb_copy_p from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 754 integer width = 219 integer height = 164 integer taborder = 80 boolean bringtotop = true string text = "批复制" string normalpicname = "paste.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF long ll_row ll_row = dw_cus_user.GetRow() if ll_row <= 0 then MessageBox("系统提示","当前客户没有可复制的用户") RETURN 0 end if Long ll_cusid ll_cusid = dw_cus_user.Object.cusid[ll_row] openwithparm(w_cus_ecomm_edit_add_p, ll_cusid) end event type cb_reset from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 974 integer width = 274 integer height = 164 integer taborder = 90 boolean bringtotop = true string text = "恢复密码" string normalpicname = "key.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1561) THEN MessageBox(publ_operator,'没有使用权限!') RETURN END IF IF MessageBox("系统提示","是否确定要恢复当前用户密码?", Question!, YesNo!) = 2 THEN RETURN long ll_row ll_row = dw_cus_user.GetRow() if ll_row <= 0 then MessageBox("系统提示","请选择用户") RETURN end if int rslt = 1 Long ll_repid String arg_msg uo_ljfieb_cus uo_ljc uo_ljc = Create uo_ljfieb_cus uo_ljfieb uo_fieb uo_fieb = Create uo_ljfieb uo_fieb.commit_transaction = sys_email_sqlca ll_repid = dw_cus_user.Object.repid[ll_row] IF uo_ljc.uof_reset_pwd(ll_repid,arg_msg,False) = 0 THEN rslt = 0 goto ext END IF //发送电商数据库 boolean lb_SetPwd = true Long ll_repid_arr[] ll_repid_arr[1] = ll_repid IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '', lb_SetPwd, arg_msg, False) = 0 THEN rslt = 0 GOTO ext END IF ext: Destroy uo_ljc Destroy uo_fieb IF rslt = 0 THEN ROLLBACK Using sqlca; ROLLBACK Using sys_email_sqlca; MessageBox('系统提示',arg_msg) ELSE COMMIT Using sqlca; COMMIT Using sys_email_sqlca; MessageBox('系统提示',"恢复密码成功") END IF end event type cb_help from uo_imflatbutton within w_cus_ecomm_cus_rep_edit integer x = 1399 integer width = 151 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "帮助" string normalpicname = "help.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;PARENT.TriggerEvent('ue_help') end event type cb_view_all from commandbutton within w_cus_ecomm_cus_rep_edit boolean visible = false integer x = 1755 integer y = 80 integer width = 302 integer height = 84 integer taborder = 20 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "查看全部" end type event clicked;ins_cusid = -1 cb_view_all.Visible = false cb_retrievemx.triggerevent(clicked!) end event type ln_bar from line within w_cus_ecomm_cus_rep_edit long linecolor = 268435456 integer linethickness = 4 integer beginy = 172 integer endx = 2007 integer endy = 172 end type type ln_bar2 from line within w_cus_ecomm_cus_rep_edit long linecolor = 16777215 integer linethickness = 4 integer beginy = 176 integer endx = 2039 integer endy = 176 end type type r_bar from rectangle within w_cus_ecomm_cus_rep_edit long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 1147 integer y = 24 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