protected void GV_BatchTrigger_RowCreated(object sender, GridViewRowEventArgs e) { if ((e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit) { com.Sconit.Control.CodeMstrDropDownList ddlIntervalType = (com.Sconit.Control.CodeMstrDropDownList)e.Row.FindControl("ddlIntervalType"); if (e.Row.DataItem != null) { BatchTrigger batchTrigger = (BatchTrigger)e.Row.DataItem; ddlIntervalType.DataBind(); ddlIntervalType.DefaultSelectedValue = batchTrigger.IntervalType; } } }
protected void FV_FlowDetail_DataBound(object sender, EventArgs e) { if (FlowDetailId == 0) { return; } FlowDetail flowDetail = TheFlowDetailMgr.LoadFlowDetail(FlowDetailId); Flow flow = flowDetail.Flow; ((Controls_TextBox)(this.FV_FlowDetail.FindControl("tbItemCode"))).Text = flowDetail.Item.Code; if (flowDetail.Uom != null) { ((Controls_TextBox)(this.FV_FlowDetail.FindControl("tbUom"))).Text = flowDetail.Uom.Code; } Controls_TextBox tbRefItemCode = (Controls_TextBox)(this.FV_FlowDetail.FindControl("tbRefItemCode")); tbRefItemCode.Text = flowDetail.ReferenceItemCode;//djin 20120802 参考物料号 tbRefItemCode.ServiceParameter = "string:#tbItemCode,string:" + flow.PartyFrom.Code + ",string:" + flow.PartyTo.Code; tbRefItemCode.DataBind(); if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PROCUREMENT || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_CUSTOMERGOODS || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_SUBCONCTRACTING) { this.FV_FlowDetail.FindControl("fdProcurement").Visible = true; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProcurementLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = flowDetail.LocationTo == null ? string.Empty : flowDetail.LocationTo.Code; if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PROCUREMENT || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_SUBCONCTRACTING) { BillSettleTermDataBind(); DropDownList ddlBillSettleTerm = (DropDownList)this.FV_FlowDetail.FindControl("ddlBillSettleTerm"); ddlBillSettleTerm.Text = flowDetail.BillSettleTerm; ddlBillSettleTerm.Visible = true; this.FV_FlowDetail.FindControl("lblBillSettleTerm").Visible = true; ((Literal)this.FV_FlowDetail.FindControl("lblNeedInspect")).Visible = true; ((CheckBox)(this.FV_FlowDetail.FindControl("cbNeedInspect"))).Visible = true; Literal lblIdMark = ((Literal)this.FV_FlowDetail.FindControl("lblIdMark")); TextBox tbIdMark = ((TextBox)this.FV_FlowDetail.FindControl("tbIdMark")); Literal lblBarCodeType = ((Literal)this.FV_FlowDetail.FindControl("lblBarCodeType")); com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); lblIdMark.Visible = true; tbIdMark.Visible = true; lblBarCodeType.Visible = true; ddlBarCodeType.Visible = true; if (flowDetail.BarCodeType != string.Empty) { ddlBarCodeType.Text = flowDetail.BarCodeType; } } } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_DISTRIBUTION) { BillSettleTermDataBind(); DropDownList ddlBillSettleTerm = (DropDownList)this.FV_FlowDetail.FindControl("ddlBillSettleTerm"); ddlBillSettleTerm.Text = flowDetail.BillSettleTerm; ddlBillSettleTerm.Visible = true; this.FV_FlowDetail.FindControl("lblBillSettleTerm").Visible = true; DropDownList ddlOddShipOption = (DropDownList)this.FV_FlowDetail.FindControl("ddlOddShipOption"); ddlOddShipOption.Text = flowDetail.OddShipOption; ddlOddShipOption.Visible = true; this.FV_FlowDetail.FindControl("lblOddShipOption").Visible = true; this.FV_FlowDetail.FindControl("fdDistribution").Visible = true; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbDistributionLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = flowDetail.LocationFrom == null ? string.Empty : flowDetail.LocationFrom.Code; this.FV_FlowDetail.FindControl("fdFordEDIOption").Visible = true; ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbPackagingCode")).Value = flowDetail.PackagingCode; ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbTransModeCode")).Value = flowDetail.TransModeCode; } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PRODUCTION) { this.FV_FlowDetail.FindControl("fdProduction").Visible = true; this.FV_FlowDetail.FindControl("trBom").Visible = true; this.FV_FlowDetail.FindControl("lblCustomer").Visible = true; this.FV_FlowDetail.FindControl("lblCustomerItemCode").Visible = true; this.FV_FlowDetail.FindControl("tbCustomerItemCode").Visible = true; ((Controls_TextBox)this.FV_FlowDetail.FindControl("tbBom")).Text = flowDetail.Bom == null ? string.Empty : flowDetail.Bom.Code; ((TextBox)(this.FV_FlowDetail.FindControl("tbBatchSize"))).Text = string.Empty; Controls_TextBox tbCustomer = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbCustomer"); tbCustomer.ServiceParameter = "string:" + BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_CUSTOMERGOODS + ",string:" + this.CurrentUser.Code; tbCustomer.DataBind(); tbCustomer.Visible = true; tbCustomer.Text = flowDetail.Customer == null ? string.Empty : flowDetail.Customer.Code; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = flowDetail.LocationFrom == null ? string.Empty : flowDetail.LocationFrom.Code; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = flowDetail.LocationTo == null ? string.Empty : flowDetail.LocationTo.Code; ((Literal)this.FV_FlowDetail.FindControl("lblNeedInspect")).Visible = true; ((CheckBox)(this.FV_FlowDetail.FindControl("cbNeedInspect"))).Visible = true; Literal lblIdMark = ((Literal)this.FV_FlowDetail.FindControl("lblIdMark")); TextBox tbIdMark = ((TextBox)this.FV_FlowDetail.FindControl("tbIdMark")); Literal lblBarCodeType = ((Literal)this.FV_FlowDetail.FindControl("lblBarCodeType")); com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); lblIdMark.Visible = true; tbIdMark.Visible = true; lblBarCodeType.Visible = true; ddlBarCodeType.Visible = true; lblIdMark.Text = "${MasterData.Flow.FlowDetail.IdMark.Production}"; ddlBarCodeType.Code = "FGBarCodeType"; ddlBarCodeType.DataBind(); if (flowDetail.BarCodeType != string.Empty) { ddlBarCodeType.Text = flowDetail.BarCodeType; } } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_TRANSFER) { this.FV_FlowDetail.FindControl("fdTransfer").Visible = true; DropDownList ddlOddShipOption = (DropDownList)this.FV_FlowDetail.FindControl("ddlOddShipOption"); ddlOddShipOption.Text = flowDetail.OddShipOption; ddlOddShipOption.Visible = true; this.FV_FlowDetail.FindControl("lblOddShipOption").Visible = true; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = flowDetail.LocationFrom == null ? string.Empty : flowDetail.LocationFrom.Code; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = flowDetail.LocationTo == null ? string.Empty : flowDetail.LocationTo.Code; this.FV_FlowDetail.FindControl("lblIsMrp").Visible = true; this.FV_FlowDetail.FindControl("cbIsMrp").Visible = true; } }
private void PageCleanup() { ((Controls_TextBox)(this.FV_FlowDetail.FindControl("tbRefItemCode"))).Text = string.Empty; ((Controls_TextBox)this.FV_FlowDetail.FindControl("tbItemCode")).Text = string.Empty; ((Controls_TextBox)this.FV_FlowDetail.FindControl("tbUom")).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbUC"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbSeq"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbSafeStock"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbMaxStock"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbMinLotSize"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbOrderLotSize"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbOrderGoodsReceiptLotSize"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbRoundUpOpt"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbPackageVol"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbHuLotSize"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbProjectDescription"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbRemark"))).Text = string.Empty; ((CheckBox)(this.FV_FlowDetail.FindControl("cbIsAutoCreate"))).Checked = true; ((CheckBox)(this.FV_FlowDetail.FindControl("cbIsMrp"))).Checked = true; ((TextBox)(this.FV_FlowDetail.FindControl("tbMRPWeight"))).Text = "1"; #region EDI Option ((TextBox)(this.FV_FlowDetail.FindControl("tbGrossWeight"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbNetWeight"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbWeightUom"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbCarrierCode"))).Text = string.Empty; ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbTransModeCode")).Value = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbConveyanceNumber"))).Text = string.Empty; //((TextBox)(this.FV_FlowDetail.FindControl("tbReceivingPlant"))).Text = string.Empty; //((TextBox)(this.FV_FlowDetail.FindControl("tbShipFrom"))).Text = string.Empty; ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbPackagingCode")).Value = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbLadingQuantity"))).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbUnitsPerContainer"))).Text = string.Empty; #endregion Literal lblBillSettleTerm = (Literal)this.FV_FlowDetail.FindControl("lblBillSettleTerm"); DropDownList ddlBillSettleTerm = (DropDownList)this.FV_FlowDetail.FindControl("ddlBillSettleTerm"); if (ddlBillSettleTerm.Visible) { ddlBillSettleTerm.SelectedIndex = 0; } Literal lblOddShipOption = (Literal)this.FV_FlowDetail.FindControl("lblOddShipOption"); DropDownList ddlOddShipOption = (DropDownList)this.FV_FlowDetail.FindControl("ddlOddShipOption"); if (ddlOddShipOption.Visible) { ddlOddShipOption.SelectedIndex = 0; } Flow flow = TheFlowMgr.LoadFlow(FlowCode); Controls_TextBox tbRefItemCode = (Controls_TextBox)(this.FV_FlowDetail.FindControl("tbRefItemCode")); tbRefItemCode.ServiceParameter = "string:#tbItemCode,string:" + flow.PartyFrom.Code + ",string:" + flow.PartyTo.Code; tbRefItemCode.DataBind(); if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PROCUREMENT || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_CUSTOMERGOODS || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_SUBCONCTRACTING) { this.FV_FlowDetail.FindControl("fdProcurement").Visible = true; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProcurementLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = string.Empty; if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PROCUREMENT || this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_SUBCONCTRACTING) { lblBillSettleTerm.Visible = true; ddlBillSettleTerm.Visible = true; BillSettleTermDataBind(); ((Literal)this.FV_FlowDetail.FindControl("lblNeedInspect")).Visible = true; ((CheckBox)(this.FV_FlowDetail.FindControl("cbNeedInspect"))).Visible = true; Literal lblIdMark = ((Literal)this.FV_FlowDetail.FindControl("lblIdMark")); TextBox tbIdMark = ((TextBox)this.FV_FlowDetail.FindControl("tbIdMark")); Literal lblBarCodeType = ((Literal)this.FV_FlowDetail.FindControl("lblBarCodeType")); com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); lblIdMark.Visible = true; tbIdMark.Visible = true; lblBarCodeType.Visible = true; ddlBarCodeType.Visible = true; } } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_DISTRIBUTION) { lblBillSettleTerm.Visible = true; ddlBillSettleTerm.Visible = true; lblOddShipOption.Visible = true; ddlOddShipOption.Visible = true; BillSettleTermDataBind(); this.FV_FlowDetail.FindControl("fdDistribution").Visible = true; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbDistributionLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = string.Empty; this.FV_FlowDetail.FindControl("fdFordEDIOption").Visible = true; } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PRODUCTION) { this.FV_FlowDetail.FindControl("fdProduction").Visible = true; this.FV_FlowDetail.FindControl("trBom").Visible = true; this.FV_FlowDetail.FindControl("lblCustomer").Visible = true; this.FV_FlowDetail.FindControl("lblCustomerItemCode").Visible = true; this.FV_FlowDetail.FindControl("tbCustomerItemCode").Visible = true; ((Controls_TextBox)this.FV_FlowDetail.FindControl("tbBom")).Text = string.Empty; ((TextBox)(this.FV_FlowDetail.FindControl("tbBatchSize"))).Text = string.Empty; Controls_TextBox tbCustomer = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbCustomer"); tbCustomer.ServiceParameter = "string:" + BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_CUSTOMERGOODS + ",string:" + this.CurrentUser.Code; tbCustomer.DataBind(); tbCustomer.Visible = true; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = string.Empty; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = string.Empty; ((Literal)this.FV_FlowDetail.FindControl("lblNeedInspect")).Visible = true; ((CheckBox)(this.FV_FlowDetail.FindControl("cbNeedInspect"))).Visible = true; Literal lblIdMark = ((Literal)this.FV_FlowDetail.FindControl("lblIdMark")); TextBox tbIdMark = ((TextBox)this.FV_FlowDetail.FindControl("tbIdMark")); Literal lblBarCodeType = ((Literal)this.FV_FlowDetail.FindControl("lblBarCodeType")); com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); lblIdMark.Visible = true; tbIdMark.Visible = true; lblBarCodeType.Visible = true; ddlBarCodeType.Visible = true; lblIdMark.Text = "${MasterData.Flow.FlowDetail.IdMark.Production}"; ddlBarCodeType.Code = "FGBarCodeType"; ddlBarCodeType.DataBind(); } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_TRANSFER) { lblOddShipOption.Visible = true; ddlOddShipOption.Visible = true; this.FV_FlowDetail.FindControl("fdTransfer").Visible = true; Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocFrom"); tbLocFrom.ServiceParameter = "string:" + flow.PartyFrom.Code; tbLocFrom.DataBind(); tbLocFrom.Text = string.Empty; Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocTo"); tbLocTo.ServiceParameter = "string:" + flow.PartyTo.Code; tbLocTo.DataBind(); tbLocTo.Text = string.Empty; this.FV_FlowDetail.FindControl("lblIsMrp").Visible = true; this.FV_FlowDetail.FindControl("cbIsMrp").Visible = true; } }