$PBExportHeader$w_workprice_workproduce_ch.srw forward global type w_workprice_workproduce_ch from w_publ_choice end type type st_2 from statictext within w_workprice_workproduce_ch end type type sle_name from u_sleedit within w_workprice_workproduce_ch end type type cbx_1 from checkbox within w_workprice_workproduce_ch end type type cbx_all from checkbox within w_workprice_workproduce_ch end type end forward global type w_workprice_workproduce_ch from w_publ_choice integer width = 3611 integer height = 2340 string title = "工序选择" st_2 st_2 sle_name sle_name cbx_1 cbx_1 cbx_all cbx_all end type global w_workprice_workproduce_ch w_workprice_workproduce_ch type variables s_workpricetable_array s_select long obj_mtrlid Boolean if_changeselect = TRUE Int if_mlselect = 0 end variables on w_workprice_workproduce_ch.create int iCurrent call super::create this.st_2=create st_2 this.sle_name=create sle_name this.cbx_1=create cbx_1 this.cbx_all=create cbx_all iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.st_2 this.Control[iCurrent+2]=this.sle_name this.Control[iCurrent+3]=this.cbx_1 this.Control[iCurrent+4]=this.cbx_all end on on w_workprice_workproduce_ch.destroy call super::destroy destroy(this.st_2) destroy(this.sle_name) destroy(this.cbx_1) destroy(this.cbx_all) end on event close;call super::close;CLOSEWITHRETURN(THIS,s_select) 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+'( u_sc_workprice_procode LIKE "%'+trim(sle_ch.text)+'%" )' ELSE obj_expr=obj_expr+'( u_sc_workprice_procode LIKE "'+trim(sle_ch.text)+'" )' END IF end if if trim(sle_name.text)<>'' then if obj_expr<>'' then obj_expr=obj_expr+ ' and ' IF POS(trim(sle_ch.text),'%')=0 THEN obj_expr=obj_expr+' ( u_sc_workprice_proname LIKE "%'+trim(sle_name.text)+'%" )' ELSE obj_expr=obj_expr+'( u_sc_workprice_proname LIKE "'+trim(sle_name.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;if_ue_sort = TRUE dw_CH.SetTransObject (sqlca) s_workpricetable s_tmp_workpricetable s_tmp_workpricetable = Message.PowerObjectParm obj_mtrlid = s_tmp_workpricetable.mtrlid IF s_tmp_workpricetable.if_select_any = 0 THEN cbx_1.Enabled = FALSE if_mlselect = 0 cbx_1.checked = false cbx_all.enabled = false ELSE cbx_1.Enabled = TRUE END IF cb_retrieve.TriggerEvent(Clicked!) IF s_tmp_workpricetable.procode <> '' THEN sle_ch.Text = s_tmp_workpricetable.procode THIS.TriggerEvent("dw_filter") END IF IF s_tmp_workpricetable.proname <> '' THEN sle_name.Text = s_tmp_workpricetable.proname THIS.TriggerEvent("dw_filter") END IF end event type cb_func from w_publ_choice`cb_func within w_workprice_workproduce_ch end type type cb_exit from w_publ_choice`cb_exit within w_workprice_workproduce_ch integer taborder = 50 end type type sle_ch from w_publ_choice`sle_ch within w_workprice_workproduce_ch integer x = 238 integer width = 389 end type type dw_ch from w_publ_choice`dw_ch within w_workprice_workproduce_ch integer width = 3543 integer height = 1952 string dataobject = "dw_workprice_workproduce_ch" end type event dw_ch::rowfocuschanged;if if_mlselect=1 then if currentrow <=0 then return if keydown(keycontrol!) then if this.isselected(currentrow) then this.selectrow(currentrow,false) if_changeselect=false else if_changeselect=true end if else if not this.isselected(currentrow) then this.selectrow(currentrow,true) if_changeselect=false else if_changeselect=true end if end if else if dw_edit_mode then return if currentrow <=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end if end event event dw_ch::clicked;if row>0 then this.setrow(row) if if_mlselect=1 then if if_changeselect then this.selectrow(row,not this.IsSelected(row)) else if_changeselect=true end if else this.selectrow(0,false) this.selectrow(row,true) end if end if end event type st_1 from w_publ_choice`st_1 within w_workprice_workproduce_ch integer y = 200 integer width = 206 string text = "编号含:" boolean righttoleft = false end type type cb_retrieve from w_publ_choice`cb_retrieve within w_workprice_workproduce_ch integer taborder = 60 end type event cb_retrieve::clicked;dw_ch.retrieve(obj_mtrlid) end event type cb_choice from w_publ_choice`cb_choice within w_workprice_workproduce_ch end type event cb_choice::clicked;Long LS_ROW,chc = 0,ls_i LS_ROW = dw_CH.GetRow() IF LS_ROW <= 0 THEN MessageBox('系统提示','请先选择目标行!',StopSign!) RETURN END IF FOR ls_i = 1 TO dw_CH.RowCount() IF dw_CH.IsSelected(ls_i) THEN chc++ s_select.proid[chc] = dw_CH.Object.u_sc_workprice_proid[ls_i] s_select.procode[chc] = dw_CH.Object.u_sc_workprice_procode[ls_i] s_select.proname[chc] = dw_CH.Object.u_sc_workprice_proname[ls_i] s_select.worklevel[chc] = dw_CH.Object.u_sc_workprice_worklevel[ls_i] s_select.techlevel[chc] = dw_CH.Object.u_sc_workprice_techlevel[ls_i] s_select.workhour[chc] = dw_CH.Object.u_sc_workprice_workhour[ls_i] s_select.workprice[chc] = dw_CH.Object.u_sc_workprice_workprice[ls_i] s_select.status[chc] = dw_CH.Object.u_sc_workprice_status[ls_i] s_select.proorder[chc] = dw_CH.Object.u_sc_workprice_proorder[ls_i] END IF NEXT IF chc = 0 THEN MessageBox('系统提示','请至少选择一个目标行!',StopSign!) RETURN END IF Close(PARENT) end event type ln_bar from w_publ_choice`ln_bar within w_workprice_workproduce_ch end type type ln_bar2 from w_publ_choice`ln_bar2 within w_workprice_workproduce_ch end type type r_bar from w_publ_choice`r_bar within w_workprice_workproduce_ch end type type ln_1 from w_publ_choice`ln_1 within w_workprice_workproduce_ch end type type ln_2 from w_publ_choice`ln_2 within w_workprice_workproduce_ch end type type st_2 from statictext within w_workprice_workproduce_ch integer x = 722 integer y = 200 integer width = 206 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 boolean enabled = false string text = "名称含:" boolean focusrectangle = false end type type sle_name from u_sleedit within w_workprice_workproduce_ch integer x = 928 integer y = 180 integer width = 416 integer taborder = 20 boolean bringtotop = true end type event inputchanged;PARENT.POSTEVENT('DW_FILTER') end event type cbx_1 from checkbox within w_workprice_workproduce_ch integer x = 1431 integer y = 180 integer width = 251 integer height = 92 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 if_mlselect=1 cbx_all.enabled = true else if_mlselect=0 cbx_all.enabled = false cbx_all.checked = false long li FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT end if SetProfileString (sys_inifilename,dw_ch.DataObject, "if_mlselect", String(if_mlselect)) end event event constructor;if_mlselect=integer(ProfileString (sys_inifilename,dw_ch.DATAOBJECT, "if_mlselect", '0')) if if_mlselect =0 then this.checked=false else this.checked=true cbx_all.enabled = true end if end event type cbx_all from checkbox within w_workprice_workproduce_ch integer x = 1637 integer y = 180 integer width = 251 integer height = 92 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false string text = "全选" end type event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN Long li IF THIS.Checked THEN FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,TRUE) NEXT ELSE FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT END IF end event