$PBExportHeader$w_cus_ecomm_edit_add_p.srw forward global type w_cus_ecomm_edit_add_p from w_publ_base end type type st_1 from statictext within w_cus_ecomm_edit_add_p end type type cb_save from uo_imflatbutton within w_cus_ecomm_edit_add_p end type type dw_cus from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p end type type dw_add from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p end type type cb_mx_ch from uo_imflatbutton within w_cus_ecomm_edit_add_p end type type cb_mx_del from uo_imflatbutton within w_cus_ecomm_edit_add_p end type type cb_1 from uo_imflatbutton within w_cus_ecomm_edit_add_p end type type cb_2 from uo_imflatbutton within w_cus_ecomm_edit_add_p end type type ln_bar from line within w_cus_ecomm_edit_add_p end type type ln_bar2 from line within w_cus_ecomm_edit_add_p end type type r_bar from rectangle within w_cus_ecomm_edit_add_p end type end forward global type w_cus_ecomm_edit_add_p from w_publ_base integer width = 3611 integer height = 2380 string title = "电子商务用户批复制" boolean minbox = false windowtype windowtype = response! st_1 st_1 cb_save cb_save dw_cus dw_cus dw_add dw_add cb_mx_ch cb_mx_ch cb_mx_del cb_mx_del cb_1 cb_1 cb_2 cb_2 ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar end type global w_cus_ecomm_edit_add_p w_cus_ecomm_edit_add_p type variables long cur_repid long cur_cusid datastore ds end variables forward prototypes public function integer wf_save () end prototypes public function integer wf_save ();Int rslt = 1 Long li_row 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 dw_add.AcceptText() li_row = dw_add.RowCount() IF li_row <= 0 THEN arg_msg = '没有保存内容' rslt = 0 GOTO ext END IF s_cus_rep_ljfieb s_rep String ls_Permissions Long ll_orirepid Long ll_repid_arr[] Long ll_cnt FOR li_row = 1 To dw_add.RowCount() IF Trim(dw_add.Object.loginname[li_row]) = "" THEN CONTINUE ll_orirepid = dw_add.Object.orirepid[li_row] SELECT Permissions INTO :ls_Permissions FROM ros_cust_rep Where repid = :ll_orirepid; IF sqlca.SQLCode <> 0 THEN arg_msg = "行:"+String(li_row)+", 查询复制用户信息失败,"+sqlca.SQLErrText rslt = 0 GOTO ext END IF s_rep.repid = dw_add.Object.repid[li_row] s_rep.cusid = dw_add.Object.cusid[li_row] s_rep.loginname = Trim(dw_add.Object.loginname[li_row]) s_rep.repname = Trim(dw_add.Object.repname[li_row]) s_rep.deptname = Trim(dw_add.Object.deptname[li_row]) s_rep.duty = Trim(dw_add.Object.duty[li_row]) s_rep.sex = Trim(dw_add.Object.sex[li_row]) s_rep.officetel = Trim(dw_add.Object.officetel[li_row]) s_rep.handtel = Trim(dw_add.Object.handtel[li_row]) s_rep.faxno = Trim(dw_add.Object.faxno[li_row]) s_rep.email = Trim(dw_add.Object.email[li_row]) s_rep.interest = Trim(dw_add.Object.interest[li_row]) s_rep.mainproduct = Trim(dw_add.Object.mainproduct[li_row]) s_rep.qqcode = Trim(dw_add.Object.qqcode[li_row]) s_rep.msncode = Trim(dw_add.Object.msncode[li_row]) s_rep.dscrp = Trim(dw_add.Object.dscrp[li_row]) s_rep.Address = Trim(dw_add.Object.Address[li_row]) s_rep.Permissions = ls_Permissions s_rep.reptype = 2 //1-供应商; 2-客户; s_rep.ljemail = Trim(dw_add.Object.ljemail[li_row]) IF uo_ljc.uof_add_cust_rep(s_rep,arg_msg,False) = 0 THEN arg_msg = "行:"+String(li_row)+","+arg_msg rslt = 0 GOTO ext END IF ll_cnt++ ll_repid_arr[ll_cnt] = uo_ljc.uo_repid NEXT IF uo_fieb.send_cust_rep(0, ll_repid_arr, '', '', '', True, 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 RETURN rslt end function on w_cus_ecomm_edit_add_p.create int iCurrent call super::create this.st_1=create st_1 this.cb_save=create cb_save this.dw_cus=create dw_cus this.dw_add=create dw_add this.cb_mx_ch=create cb_mx_ch this.cb_mx_del=create cb_mx_del this.cb_1=create cb_1 this.cb_2=create cb_2 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.st_1 this.Control[iCurrent+2]=this.cb_save this.Control[iCurrent+3]=this.dw_cus this.Control[iCurrent+4]=this.dw_add this.Control[iCurrent+5]=this.cb_mx_ch this.Control[iCurrent+6]=this.cb_mx_del this.Control[iCurrent+7]=this.cb_1 this.Control[iCurrent+8]=this.cb_2 this.Control[iCurrent+9]=this.ln_bar this.Control[iCurrent+10]=this.ln_bar2 this.Control[iCurrent+11]=this.r_bar end on on w_cus_ecomm_edit_add_p.destroy call super::destroy destroy(this.st_1) destroy(this.cb_save) destroy(this.dw_cus) destroy(this.dw_add) destroy(this.cb_mx_ch) destroy(this.cb_mx_del) destroy(this.cb_1) destroy(this.cb_2) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) end on event open;call super::open;cur_cusid = Message.DoubleParm dw_cus.Retrieve(cur_cusid) ds = Create datastore ds.DataObject = "dw_cust_ecomm_cus_rep" ds.SetTransObject(sqlca) ds.Retrieve(cur_cusid) Long i FOR i = 1 To 18 dw_add.SetTabOrder(i, i * 10) NEXT end event event close;call super::close;//closewithreturn(this,s_return) end event event resize;call super::resize;ln_bar.endx = this.width ln_bar2.endx = this.width r_bar.width = this.width dw_cus.width = this.width - dw_cus.x - 40 dw_add.width = this.width - dw_add.x - 40 dw_add.height = this.height - dw_add.y - 140 end event event ue_before_open;call super::ue_before_open;dw_cus.SetTransObject(sqlca) dw_add.SetTransObject(sqlca) end event type cb_func from w_publ_base`cb_func within w_cus_ecomm_edit_add_p boolean visible = false integer taborder = 30 end type type cb_exit from w_publ_base`cb_exit within w_cus_ecomm_edit_add_p integer x = 151 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type st_1 from statictext within w_cus_ecomm_edit_add_p boolean visible = false integer y = 32 integer width = 160 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "摘要" alignment alignment = right! boolean focusrectangle = false end type type cb_save from uo_imflatbutton within w_cus_ecomm_edit_add_p integer width = 151 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "保存" string normalpicname = "save.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF wf_save() = 1 THEN Close(Parent) END IF end event type dw_cus from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p integer y = 188 integer width = 1495 integer height = 644 integer taborder = 70 boolean bringtotop = true string title = "客户资料" string dataobject = "dw_cust_ecomm_edit_add_p" boolean maxbox = true boolean hscrollbar = true boolean vscrollbar = true boolean resizable = 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(row,Not This.IsSelected(row)) END IF end event event constructor;call super::constructor; RBUTTON_FILTER_USE=true //右键查询功能开关 end event type dw_add from u_dw_rbtnfilter within w_cus_ecomm_edit_add_p integer y = 976 integer width = 1495 integer height = 644 integer taborder = 80 boolean bringtotop = true string title = "客户资料" string dataobject = "dw_cust_ecomm_edit_add_p_rep" boolean maxbox = true boolean hscrollbar = true boolean vscrollbar = true boolean resizable = 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) END IF end event event constructor;call super::constructor; RBUTTON_FILTER_USE=true //右键查询功能开关 end event event doubleclicked;call super::doubleclicked;//IF Not dw_edit_mode THEN RETURN // //Long ll_row // //ll_row = dw_cus.GetRow() // //IF ll_row <= 0 THEN RETURN // //OpenWithParm(w_cuscomm_list_ch,2) // //s_cuscomm_ljfieb INS_RT_STRU // //INS_RT_STRU = Message.PowerObjectParm // //dw_cus.Object.ifecomm[ll_row] = 1 //dw_cus.Object.commcode[ll_row] = INS_RT_STRU.CusCode // // //dw_cus.accepttext() // // 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_mx_ch from uo_imflatbutton within w_cus_ecomm_edit_add_p integer y = 856 integer taborder = 230 boolean bringtotop = true string text = "↓ 选择" end type event clicked;call super::clicked;Long i, j, ll_row Long ll_cusid, ll_repid String ls_cuscode, ls_cusname FOR i = 1 To dw_cus.RowCount() IF dw_cus.IsSelected(i) THEN ll_cusid = dw_cus.Object.cusid[i] ls_cuscode = dw_cus.Object.cuscode[i] ls_cusname = dw_cus.Object.Name[i] FOR j = 1 To ds.RowCount() ll_repid = ds.Object.repid[j] ll_row = dw_add.Find("cusid = "+String(ll_cusid)+" and orirepid = "+ String(ll_repid), 1, dw_add.RowCount()) IF ll_row > 0 THEN CONTINUE ll_row = dw_add.InsertRow(0) dw_add.Object.orirepid[ll_row] = ll_repid dw_add.Object.orirepname[ll_row] = ds.Object.repname[j] dw_add.Object.oriloginname[ll_row] = ds.Object.loginname[j] dw_add.Object.cusid[ll_row] = ll_cusid dw_add.Object.cuscode[ll_row] = ls_cuscode dw_add.Object.cusname[ll_row] = ls_cusname NEXT END IF NEXT end event type cb_mx_del from uo_imflatbutton within w_cus_ecomm_edit_add_p integer x = 311 integer y = 856 integer width = 357 integer taborder = 240 boolean bringtotop = true string text = "↑ 删除选择" end type event clicked;call super::clicked;IF dw_add.GetRow() = 0 THEN MessageBox('NO','请选择删除的行对象!') RETURN END IF IF MessageBox("确定", "是否确定删除当前行?", Question!, YesNo!) = 2 THEN RETURN dw_add.DeleteRow (0) dw_add.TriggerEvent (RowFocusChanged!) end event type cb_1 from uo_imflatbutton within w_cus_ecomm_edit_add_p integer x = 677 integer y = 856 integer taborder = 240 boolean bringtotop = true string text = "全选" end type event clicked;call super::clicked;dw_cus.SelectRow(0, true) end event type cb_2 from uo_imflatbutton within w_cus_ecomm_edit_add_p integer x = 987 integer y = 856 integer taborder = 250 boolean bringtotop = true string text = "反选" end type event clicked;call super::clicked;long i for i = 1 to dw_cus.rowcount() dw_cus.SelectRow(i, not dw_cus.IsSelected(i)) next end event type ln_bar from line within w_cus_ecomm_edit_add_p 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_edit_add_p 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_edit_add_p long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 1531 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