$PBExportHeader$w_trans_custoutrep.srw forward global type w_trans_custoutrep from w_publ_easyq end type type ddlb_1 from dropdownlistbox within w_trans_custoutrep end type type st_1 from statictext within w_trans_custoutrep end type type cb_ok from uo_imflatbutton within w_trans_custoutrep end type type tv_1 from uo_tv_cusarea within w_trans_custoutrep end type type cbx_1 from checkbox within w_trans_custoutrep end type type cbx_inuse from checkbox within w_trans_custoutrep end type type cb_3 from uo_imflatbutton within w_trans_custoutrep end type end forward global type w_trans_custoutrep from w_publ_easyq string title = "客户变更业务员" ddlb_1 ddlb_1 st_1 st_1 cb_ok cb_ok tv_1 tv_1 cbx_1 cbx_1 cbx_inuse cbx_inuse cb_3 cb_3 end type global w_trans_custoutrep w_trans_custoutrep type variables string ls_areaname string ls_area Int inuse = 1 end variables on w_trans_custoutrep.create int iCurrent call super::create this.ddlb_1=create ddlb_1 this.st_1=create st_1 this.cb_ok=create cb_ok this.tv_1=create tv_1 this.cbx_1=create cbx_1 this.cbx_inuse=create cbx_inuse this.cb_3=create cb_3 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.ddlb_1 this.Control[iCurrent+2]=this.st_1 this.Control[iCurrent+3]=this.cb_ok this.Control[iCurrent+4]=this.tv_1 this.Control[iCurrent+5]=this.cbx_1 this.Control[iCurrent+6]=this.cbx_inuse this.Control[iCurrent+7]=this.cb_3 end on on w_trans_custoutrep.destroy call super::destroy destroy(this.ddlb_1) destroy(this.st_1) destroy(this.cb_ok) destroy(this.tv_1) destroy(this.cbx_1) destroy(this.cbx_inuse) destroy(this.cb_3) end on event resize;call super::resize;tv_1.height=this.height - tv_1.y - 115 end event event open;call super::open;cb_1.triggerevent(clicked!) end event type cb_func from w_publ_easyq`cb_func within w_trans_custoutrep end type type cb_exit from w_publ_easyq`cb_exit within w_trans_custoutrep integer x = 1303 end type type cb_2 from w_publ_easyq`cb_2 within w_trans_custoutrep integer x = 1719 integer y = 404 end type type cb_psetup from w_publ_easyq`cb_psetup within w_trans_custoutrep integer x = 887 integer y = 412 end type type cb_1 from w_publ_easyq`cb_1 within w_trans_custoutrep end type event cb_1::clicked;call super::clicked;//ls_areaname dw_1.Retrieve(ls_areaname, inuse ) end event type st_3 from w_publ_easyq`st_3 within w_trans_custoutrep integer x = 1650 integer y = 204 integer width = 283 string text = "开始日期:" end type type st_4 from w_publ_easyq`st_4 within w_trans_custoutrep boolean visible = false integer x = 2016 integer y = 412 end type type em_1 from w_publ_easyq`em_1 within w_trans_custoutrep integer x = 1947 integer y = 188 boolean enabled = false end type type em_2 from w_publ_easyq`em_2 within w_trans_custoutrep boolean visible = false integer x = 2121 integer y = 464 end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_trans_custoutrep integer x = 1399 integer y = 416 end type type cbx_yl from w_publ_easyq`cbx_yl within w_trans_custoutrep integer x = 1179 integer y = 416 end type type dw_1 from w_publ_easyq`dw_1 within w_trans_custoutrep integer x = 736 integer y = 316 integer width = 2798 integer height = 1200 string dataobject = "dw_trans_custoutrep" end type event dw_1::rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN this.selectrow(0,false) this.selectrow(currentrow,true) end event type sle_mtrl from w_publ_easyq`sle_mtrl within w_trans_custoutrep end type type sle_cust from w_publ_easyq`sle_cust within w_trans_custoutrep end type type st_mtrl from w_publ_easyq`st_mtrl within w_trans_custoutrep end type type st_cust from w_publ_easyq`st_cust within w_trans_custoutrep end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_trans_custoutrep end type type pb_em1 from w_publ_easyq`pb_em1 within w_trans_custoutrep boolean visible = false end type type pb_em2 from w_publ_easyq`pb_em2 within w_trans_custoutrep boolean visible = false end type type pb_2 from w_publ_easyq`pb_2 within w_trans_custoutrep boolean visible = false end type type cb_help from w_publ_easyq`cb_help within w_trans_custoutrep integer x = 1152 end type type cb_copyself from w_publ_easyq`cb_copyself within w_trans_custoutrep end type type gb_1 from w_publ_easyq`gb_1 within w_trans_custoutrep end type type ln_bar from w_publ_easyq`ln_bar within w_trans_custoutrep end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_trans_custoutrep end type type r_bar from w_publ_easyq`r_bar within w_trans_custoutrep end type type ln_1 from w_publ_easyq`ln_1 within w_trans_custoutrep end type type ln_2 from w_publ_easyq`ln_2 within w_trans_custoutrep end type type ln_3 from w_publ_easyq`ln_3 within w_trans_custoutrep end type type ln_4 from w_publ_easyq`ln_4 within w_trans_custoutrep end type type ddlb_1 from dropdownlistbox within w_trans_custoutrep integer x = 521 integer y = 200 integer width = 530 integer height = 896 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true borderstyle borderstyle = stylelowered! end type event constructor;string ls_pf DECLARE pf_cur CURSOR FOR SELECT distinct u_outrepdef.outrepname FROM u_outrepdef where inuse = 1; open pf_cur; fetch pf_cur into :ls_pf; do while sqlca.sqlcode=0 ddlb_1.ADDItem(ls_pf) fetch pf_cur into :ls_pf; loop close pf_cur; end event type st_1 from statictext within w_trans_custoutrep integer x = 27 integer y = 212 integer width = 485 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 = "新业务员/上级经理" boolean focusrectangle = false end type type cb_ok from uo_imflatbutton within w_trans_custoutrep integer x = 306 integer width = 393 integer height = 164 integer taborder = 110 boolean bringtotop = true string text = "转换新业务员" string normalpicname = "update.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(714) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF Int rslt = 1 String arg_msg Long i,ll_cusid String ls_custype DateTime ldt_enddate String ls_msg dw_1.AcceptText() ldt_enddate = DateTime(Date(Trim(em_1.Text)),Time(0)) ls_custype = Trim(ddlb_1.Text) IF ls_custype = "" THEN MessageBox('提示','新业务员不能为空!', Information!, OK! ) RETURN END IF IF cbx_1.Checked THEN ls_msg = "是否确定要将以下客户资料转换新业务员?~r~n 当前操作同时将"+String(ldt_enddate, 'yyyy-mm-dd')+"后的销售单,应收帐转换新业务员?转换后将不能撤改" ELSE ls_msg = "是否确定要将以下客户资料转换新业务员?转换后将不能撤改" END IF IF MessageBox ("询问",ls_msg,Question!,YesNo! ) = 2 THEN RETURN END IF open(w_sys_wait_jdt) w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) FOR i = 1 To dw_1.RowCount() w_sys_wait_jdt.wf_inc(i) w_sys_wait_jdt.wf_set_msg('正在处理行:'+string(i)+"......") ll_cusid = dw_1.Object.cusid[i] UPDATE u_cust SET custype = :ls_custype Where cusid = :ll_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换客户表中新业务员失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF IF cbx_1.Checked THEN UPDATE u_saletask SET Assign_Emp = :ls_custype WHERE cusid = :ll_cusid AND taskdate >= :ldt_enddate; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换销售订单中新业务员失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF UPDATE u_outware SET outrep = :ls_custype WHERE cusid = :ll_cusid AND outdate >= :ldt_enddate; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换销售发货单中新业务员失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF UPDATE u_bmsttake SET inrep = :ls_custype WHERE buildtype = 1 AND cusid = :ll_cusid AND takedate >= :ldt_enddate; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换应收帐单中新业务员失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF UPDATE u_bmsttakemx SET inrep = :ls_custype WHERE buildtype = 1 AND cusid = :ll_cusid AND takedate >= :ldt_enddate; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换应收帐明细单中新业务员失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF END IF NEXT ext: close(w_sys_wait_jdt) IF rslt = 0 THEN ROLLBACK; MessageBox('提示',arg_msg, Information!, OK! ) ELSE IF cbx_1.Checked THEN ls_msg = '转换新业务员且更新'+String(ldt_enddate, 'yyyy-mm-dd')+'后的单据' ELSE ls_msg = '转换新业务员' END IF COMMIT; MessageBox('提示',ls_msg+'成功!', Information!, OK! ) //日志 // Long ls_id // String ls_code // ls_id = dw_pageretr.Object.inwareid[pagerert_row] // ls_code = dw_pageretr.Object.inwarecode[pagerert_row] f_setsysoplog('客户变更业务员',ls_msg,arg_msg,True) //-- cb_1.TriggerEvent(Clicked!) END IF end event type tv_1 from uo_tv_cusarea within w_trans_custoutrep integer y = 316 integer width = 736 integer height = 1200 integer taborder = 80 boolean bringtotop = true integer textsize = -9 fontcharset fontcharset = gb2312charset! fontfamily fontfamily = anyfont! string facename = "宋体" end type event selectionchanged; Long ll_hand Long ll_mtrltypeid TreeViewItem l_tvi ll_hand = THIS.FindItem(CurrentTreeItem!,0) IF THIS.GetItem(ll_hand,l_tvi) = 1 THEN IF ll_hand = 1 THEN ll_mtrltypeid = 0 ELSE ll_mtrltypeid = l_tvi.Data END IF f_getinfo(ll_mtrltypeid) THIS.ExpandItem(ll_hand) END IF ls_area=l_tvi.label ls_areaname = THIS.uo_cur_info.areaname ls_areaname = ls_areaname + '%' cb_1.TriggerEvent(Clicked!) end event type cbx_1 from checkbox within w_trans_custoutrep integer x = 1065 integer y = 204 integer width = 590 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 = 134217739 string text = "更新销售单据业务员" end type event clicked;IF This.Checked THEN em_1.Enabled = True ELSE em_1.Enabled = False END IF end event type cbx_inuse from checkbox within w_trans_custoutrep integer x = 2382 integer y = 204 integer width = 402 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 = 134217739 string text = "只显示有效" boolean checked = true end type event clicked;IF dw_edit_mode THEN RETURN IF THIS.Checked THEN inuse = 1 ELSE inuse = -1 END IF cb_1.TriggerEvent(Clicked!) end event type cb_3 from uo_imflatbutton within w_trans_custoutrep integer x = 704 integer width = 443 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "转换新上级经理" string normalpicname = "update.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(714) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF Int rslt = 1 String arg_msg Long i,ll_cusid String ls_upname DateTime ldt_enddate String ls_msg dw_1.AcceptText() ldt_enddate = DateTime(Date(Trim(em_1.Text)),Time(0)) ls_upname = Trim(ddlb_1.Text) IF ls_upname = "" THEN MessageBox('提示','新上级经理不能为空!', Information!, OK! ) RETURN END IF ls_msg = "是否确定要将以下客户资料转换上级经理?转换后将不能撤改" IF MessageBox ("询问",ls_msg,Question!,YesNo! ) = 2 THEN RETURN END IF open(w_sys_wait_jdt) w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) FOR i = 1 To dw_1.RowCount() w_sys_wait_jdt.wf_inc(i) w_sys_wait_jdt.wf_set_msg('正在处理行:'+string(i)+"......") ll_cusid = dw_1.Object.cusid[i] UPDATE u_cust SET upname = :ls_upname Where cusid = :ll_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '转换客户表中上级经理失败!'+sqlca.SQLErrText rslt = 0 GOTO ext END IF NEXT ext: close(w_sys_wait_jdt) IF rslt = 0 THEN ROLLBACK; MessageBox('提示',arg_msg, Information!, OK! ) ELSE ls_msg = '转换新上级经理' COMMIT; MessageBox('提示',ls_msg+'成功!', Information!, OK! ) //日志 // Long ls_id // String ls_code // ls_id = dw_pageretr.Object.inwareid[pagerert_row] // ls_code = dw_pageretr.Object.inwarecode[pagerert_row] f_setsysoplog('客户上级经理',ls_msg,arg_msg,True) //-- cb_1.TriggerEvent(Clicked!) END IF end event