$PBExportHeader$w_order_ml_mrp_changepz.srw forward global type w_order_ml_mrp_changepz from w_publ_base end type type cb_1 from uo_imflatbutton within w_order_ml_mrp_changepz end type type dw_2 from datawindow within w_order_ml_mrp_changepz end type end forward global type w_order_ml_mrp_changepz from w_publ_base integer width = 2226 integer height = 1024 string title = "修改配置" boolean minbox = false windowtype windowtype = response! event ue_allowedit ( ) cb_1 cb_1 dw_2 dw_2 end type global w_order_ml_mrp_changepz w_order_ml_mrp_changepz type variables s_order_ml_mrp_changepz s_rst,s_open end variables event ue_allowedit();Long Columns Int i String ls_modify_str Long ll_row Long ll_value Long ll_statusflag,ll_woodcodeflag,ll_pcodeflag String ls_status,ls_woodcode,ls_pcode String ls_data_type ll_row = dw_2.GetRow() IF ll_row <= 0 THEN RETURN Columns = Long(dw_2.Describe("DataWindow.Column.Count")) FOR i = 1 TO Columns ls_modify_str = dw_2.Describe("#" + String(i) + ".name") ls_modify_str = Lower(ls_modify_str) IF i = 1 THEN //第1个字段,约定物料ID ls_data_type = dw_2.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_value = dw_2.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'statusflag') > 0 THEN ls_data_type = dw_2.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_statusflag = dw_2.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'woodcodeflag') > 0 THEN ls_data_type = dw_2.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_woodcodeflag = dw_2.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'pcodeflag') > 0 THEN ls_data_type = dw_2.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_pcodeflag = dw_2.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'status') > 0 AND Pos(ls_modify_str,'statusflag') = 0 AND Pos(ls_modify_str,'statustype') = 0 THEN IF Len(ls_modify_str) = Len('status') OR Pos(ls_modify_str,'_status') > 0 THEN IF Not (Pos(ls_modify_str,'u_saletask_status') > 0 OR & Pos(ls_modify_str,'u_buytask_status') > 0 OR & Pos(ls_modify_str,'u_order_ml_status') > 0 OR & Pos(ls_modify_str,'u_order_wfjg_status') > 0 OR & Pos(ls_modify_str,'u_rs_empinfo_status') > 0 ) THEN ls_status = ls_modify_str END IF END IF END IF IF Pos(ls_modify_str,'woodcode') > 0 AND Pos(ls_modify_str,'woodcodeflag') = 0 AND Pos(ls_modify_str,'woodcodetype') = 0 THEN IF Len(ls_modify_str) = Len('woodcode') OR Pos(ls_modify_str,'_woodcode') > 0 THEN ls_woodcode = ls_modify_str END IF END IF IF Pos(ls_modify_str,'pcode') > 0 AND Pos(ls_modify_str,'pcodeflag') = 0 AND Pos(ls_modify_str,'pcodetype') = 0 THEN IF Len(ls_modify_str) = Len('pcode') OR Pos(ls_modify_str,'_pcode') > 0 THEN ls_pcode = ls_modify_str END IF END IF NEXT IF ls_status <> '' THEN IF ll_statusflag <> 0 OR ll_value = 0 THEN dw_2.Modify(ls_status+".dddw.allowedit = no") ELSE dw_2.Modify(ls_status+".dddw.allowedit = yes") END IF END IF IF ls_woodcode <> '' THEN IF ll_woodcodeflag <> 0 OR ll_value = 0 THEN dw_2.Modify(ls_woodcode+".dddw.allowedit = no") ELSE dw_2.Modify(ls_woodcode+".dddw.allowedit = yes") END IF END IF IF ls_pcode <> '' THEN IF ll_pcodeflag <> 0 OR ll_value = 0 THEN dw_2.Modify(ls_pcode+".dddw.allowedit = no") ELSE dw_2.Modify(ls_pcode+".dddw.allowedit = yes") END IF END IF end event on w_order_ml_mrp_changepz.create int iCurrent call super::create this.cb_1=create cb_1 this.dw_2=create dw_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_1 this.Control[iCurrent+2]=this.dw_2 end on on w_order_ml_mrp_changepz.destroy call super::destroy destroy(this.cb_1) destroy(this.dw_2) end on event open;call super::open;s_open = Message.PowerObjectParm f_title_change(dw_2) dw_2.SetTransObject(sqlca) IF dw_2.Retrieve(s_open.mtrlid) > 0 THEN dw_2.SetRow(1) dw_2.Object.status[1] = s_open.status dw_2.Object.woodcode[1] = s_open.woodcode dw_2.Object.pcode[1] = s_open.pcode END IF THIS.TriggerEvent('ue_allowedit') end event event close;call super::close;closewithreturn(this,s_rst) end event type cb_func from w_publ_base`cb_func within w_order_ml_mrp_changepz integer x = 448 integer y = 212 end type type cb_exit from w_publ_base`cb_exit within w_order_ml_mrp_changepz integer x = 1161 integer y = 740 string text = "取销" end type event cb_exit::clicked;s_rst.ifchange = 0 Close(PARENT) end event type cb_1 from uo_imflatbutton within w_order_ml_mrp_changepz integer x = 654 integer y = 740 integer width = 311 integer height = 96 integer taborder = 30 boolean bringtotop = true string normalpicname = "ok.bmp" end type event clicked;call super::clicked;Long ll_row ll_row = dw_2.GetRow() IF ll_row <= 0 THEN MessageBox('提示','请选择资料') RETURN END IF dw_2.accepttext() s_rst.ifchange = 1 s_rst.status = dw_2.Object.status[ll_row] s_rst.woodcode = dw_2.Object.woodcode[ll_row] s_rst.pcode = dw_2.Object.pcode[ll_row] Close(PARENT) end event type dw_2 from datawindow within w_order_ml_mrp_changepz integer x = 160 integer y = 60 integer width = 1920 integer height = 576 integer taborder = 20 boolean bringtotop = true string title = "none" string dataobject = "dw_order_ml_mrp_tree_changepz" boolean livescroll = true borderstyle borderstyle = stylelowered! end type