$PBExportHeader$w_cd_cust_ch.srw forward global type w_cd_cust_ch from w_publ_choice end type type tv_1 from uo_tv_cusarea within w_cd_cust_ch end type type dw_1 from u_dw_rbtnfilter within w_cd_cust_ch end type type cb_1 from commandbutton within w_cd_cust_ch end type type cb_2 from commandbutton within w_cd_cust_ch end type end forward global type w_cd_cust_ch from w_publ_choice integer width = 3611 integer height = 2380 string title = "客户选择" tv_1 tv_1 dw_1 dw_1 cb_1 cb_1 cb_2 cb_2 end type global w_cd_cust_ch w_cd_cust_ch type variables s_custom ins_rt_stru string obj_cuscode String ls_areaname = '' end variables on w_cd_cust_ch.create int iCurrent call super::create this.tv_1=create tv_1 this.dw_1=create dw_1 this.cb_1=create cb_1 this.cb_2=create cb_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.tv_1 this.Control[iCurrent+2]=this.dw_1 this.Control[iCurrent+3]=this.cb_1 this.Control[iCurrent+4]=this.cb_2 end on on w_cd_cust_ch.destroy call super::destroy destroy(this.tv_1) destroy(this.dw_1) destroy(this.cb_1) destroy(this.cb_2) end on event close;call super::close;CLOSEWITHRETURN(THIS,ins_rt_stru) end event event dw_filter;//string filterstr //filterstr=""+trim(sle_ch.text) // String obj_expr = '' IF Trim(sle_ch.Text) <> '' THEN IF Pos(Trim(sle_ch.Text),'%') = 0 THEN obj_expr = obj_expr+'( cuscode LIKE "%'+Trim(sle_ch.Text)+'%" )' ELSE obj_expr = obj_expr+'( Lower(cuscode) LIKE "'+Trim(sle_ch.Text)+'" )' END IF END IF IF Trim(sle_ch.Text) <> '' THEN IF obj_expr <> '' THEN obj_expr = obj_expr+ ' or ' IF Pos(Trim(sle_ch.Text),'%') = 0 THEN obj_expr = obj_expr+' ( name LIKE "%'+Trim(sle_ch.Text)+'%" )' ELSE obj_expr = obj_expr+'( name LIKE "'+Trim(sle_ch.Text)+'" )' END IF END IF dw_ch.SetFilter(obj_expr) dw_ch.SetRedraw(FALSE) dw_ch.Filter() IF dw_ch.RowCount() >= 1 THEN dw_ch.SelectRow(0,FALSE) dw_ch.SelectRow(1,TRUE) END IF dw_ch.SetRedraw(TRUE) end event event open;call super::open;//obj_cuscode = Message.StringParm //IF obj_cuscode <> '' THEN // sle_ch.Text = obj_cuscode // THIS.TriggerEvent("dw_filter") //END IF // //s_hide_col s_col_cusname //s_col_cusname.col_1 = 'name' //f_hide_col(1210,dw_ch,s_col_cusname) end event type cb_func from w_publ_choice`cb_func within w_cd_cust_ch end type type cb_exit from w_publ_choice`cb_exit within w_cd_cust_ch integer taborder = 50 end type type sle_ch from w_publ_choice`sle_ch within w_cd_cust_ch integer x = 379 integer y = 184 integer width = 955 end type type dw_ch from w_publ_choice`dw_ch within w_cd_cust_ch integer x = 997 integer width = 2587 integer height = 884 string dataobject = "dw_cust_ch" boolean hsplitscroll = false end type event dw_ch::rowfocuschanged;// end event event dw_ch::clicked;IF row > 0 THEN This.SelectRow(row, Not This.IsSelected(row)) END IF end event event dw_ch::doubleclicked;// end event type st_1 from w_publ_choice`st_1 within w_cd_cust_ch integer x = 18 integer y = 204 integer width = 343 string text = "编号/名称含:" alignment alignment = right! boolean righttoleft = false end type type cb_retrieve from w_publ_choice`cb_retrieve within w_cd_cust_ch integer taborder = 60 end type event cb_retrieve::clicked;dw_ch.retrieve(ls_areaname) THIS.TriggerEvent("dw_filter") end event type cb_choice from w_publ_choice`cb_choice within w_cd_cust_ch end type event cb_choice::clicked;Long LS_ROW long i = 0 for LS_ROW = 1 to dw_1.RowCount() i++ INS_RT_STRU.cusid_arr[i] = dw_1.Object.cusid[LS_ROW] next Close(PARENT) end event type ln_bar from w_publ_choice`ln_bar within w_cd_cust_ch end type type ln_bar2 from w_publ_choice`ln_bar2 within w_cd_cust_ch end type type r_bar from w_publ_choice`r_bar within w_cd_cust_ch end type type ln_1 from w_publ_choice`ln_1 within w_cd_cust_ch end type type ln_2 from w_publ_choice`ln_2 within w_cd_cust_ch end type type tv_1 from uo_tv_cusarea within w_cd_cust_ch integer y = 288 integer width = 997 integer height = 1996 integer taborder = 60 boolean bringtotop = true integer textsize = -9 fontcharset fontcharset = gb2312charset! fontfamily fontfamily = anyfont! string facename = "宋体" end type event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname ls_areaname = ls_areaname + '%' cb_retrieve.TriggerEvent(Clicked!) end event type dw_1 from u_dw_rbtnfilter within w_cd_cust_ch integer x = 997 integer y = 1296 integer width = 2587 integer height = 972 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_cust_ch" end type event clicked;IF row > 0 THEN This.SelectRow(row, Not This.IsSelected(row)) END IF end event type cb_1 from commandbutton within w_cd_cust_ch integer x = 2857 integer y = 1196 integer width = 261 integer height = 84 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "添加" end type event clicked;Long i,row dw_1.SelectRow(0, False) FOR i = 1 To dw_ch.RowCount() IF Not dw_ch.IsSelected(i) THEN CONTINUE row = dw_1.Find('cusid = ' + string(dw_ch.Object.cusid[i]), 1, dw_1.RowCount()) IF row > 0 THEN //dw_1.SelectRow(row, True) CONTINUE END IF dw_ch.RowsCopy(i,i,Primary!, dw_1, dw_1.RowCount() + 1, Primary!) dw_1.SelectRow(dw_1.RowCount(), True) NEXT end event type cb_2 from commandbutton within w_cd_cust_ch integer x = 3218 integer y = 1196 integer width = 261 integer height = 84 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "删除" end type event clicked;Long i FOR i = dw_1.RowCount() To 1 Step -1 IF Not dw_1.IsSelected(i) THEN CONTINUE dw_1.DeleteRow(i) NEXT end event