protected void btnPickup_Click(object sender, EventArgs e) { try { // ExecuteSubmit(); DetachedCriteria criter = DetachedCriteria.For(typeof(LocationLotDetail)); criter.Add(Expression.Eq("Location", TheLocationMgr.LoadLocation(tbMiscOrderLocation.Text))); criter.Add(Expression.In("StorageBin", TheStorageBinMgr.GetStorageBin(tbStorageBin.Text).ToList())); criter.Add(Expression.IsNotNull("StorageBin")); IList <LocationLotDetail> result = TheCriteriaMgr.FindAll <LocationLotDetail>(criter); foreach (LocationLotDetail lot in result) { lot.StorageBin = null; lot.Hu.StorageBin = null; TheLocationLotDetailMgr.UpdateLocationLotDetail(lot); } ShowSuccessMessage("Warehouse.PickUp.Successfully"); GridView1.DataSource = null; GridView1.DataBind(); this.InitialAll(); } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
public LocationTransaction[] FindLocationTransaction(string[] transType, string[] loc, DateTime effdateStart, DateTime effDateEnd, DateTime createDateStart, DateTime createDateEnd, string partyFrom, string partyTo, string[] itemCode, string[] orderNo, string[] recNo, string createUser, string[] ipNo, string userCode) { try { IList <LocationTransaction> LocationTransactionList = TheLocationMgr.GetLocationTransaction(transType, loc, effdateStart, effDateEnd, createDateStart, createDateEnd, partyFrom, partyTo, itemCode, orderNo, recNo, createUser, ipNo, userCode); if (LocationTransactionList != null && LocationTransactionList.Count > 0) { return(LocationTransactionList.ToArray()); } else { return(null); } } catch (Exception ex) { throw new SoapException(ex.Message, SoapException.ServerFaultCode, Context.Request.Url.AbsoluteUri); } }
private CycleCount GetCycleCount() { string region = this.tbRegion.Text.Trim(); string location = this.tbLocation.Text.Trim(); string effectiveDate = this.tbEffDate.Text.Trim(); DateTime effDate = DateTime.Today; if (region == string.Empty) { ShowErrorMessage("Common.Business.Error.RegionInvalid"); return null; } else if (location == string.Empty) { ShowErrorMessage("Common.Business.Error.LocationInvalid"); return null; } try { effDate = Convert.ToDateTime(effectiveDate); } catch (Exception) { ShowErrorMessage("Common.Business.Error.DateInvalid"); return null; } CycleCount cycleCount = new CycleCount(); cycleCount.Location = TheLocationMgr.LoadLocation(location); cycleCount.EffectiveDate = effDate; cycleCount.Type = this.ddlType.SelectedValue; return cycleCount; }
protected void btn1_Click(object sender, EventArgs e) { sqlText = "select * from reportsinv where 1=1"; if (tbLocation.Text.Trim() != string.Empty) { sqlText += " and location='" + tbLocation.Text.Trim() + "'"; } else { var i = (from a in TheLocationMgr.GetLocationByUserCode(CurrentUser.Code) select a.Code).ToList(); StringBuilder sb = new StringBuilder(); foreach (var t in i) { sb.Append("'" + t + "',"); } string regions = sb.ToString().TrimEnd(new char[] { ',' }); sqlText += " and location in (" + regions + ")"; } if (tbItem.Text.Trim() != string.Empty) { sqlText += " and item='" + tbItem.Text.Trim() + "'"; } BindData(sqltods(sqlText)); }
protected void checkLocationExists(object source, ServerValidateEventArgs args) { string code = ((TextBox)(this.FV_Location.FindControl("tbCode"))).Text; if (TheLocationMgr.LoadLocation(code) != null) { ShowErrorMessage("MasterData.Location.CodeExist", code); args.IsValid = false; } }
protected void ODS_StorageArea_Updating(object sender, ObjectDataSourceMethodEventArgs e) { StorageArea area = (StorageArea)e.InputParameters[0]; if (area != null) { string location = this.LocationCode; area.Location = TheLocationMgr.LoadLocation(location); area.Description = area.Description.Trim(); } }
private void BindLocation() { DetachedCriteria selectCriteria = DetachedCriteria.For(typeof(Location)); selectCriteria.Add(Expression.Eq("Type", "11")); SecurityHelper.SetPartySearchCriteria(selectCriteria, "Region", this.CurrentUser.Code); IList <Location> locationList = TheCriteriaMgr.FindAll <Location>(selectCriteria); locationList.Add(TheLocationMgr.GetRejectLocation()); this.ddlLocationFrom.DataSource = locationList; this.ddlLocationFrom.DataBind(); }
protected void ODS_RoutingDetail_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { string routingCode = ((TextBox)(this.FV_RoutingDetail.FindControl("tbRouting"))).Text.Trim(); string workCenterCode = ((Controls_TextBox)(this.FV_RoutingDetail.FindControl("tbWorkCenter"))).Text.Trim(); string locationCode = ((Controls_TextBox)(this.FV_RoutingDetail.FindControl("tbLocation"))).Text.Trim(); routingDetail = (RoutingDetail)e.InputParameters[0]; if (routingDetail != null) { routingDetail.Routing = TheRoutingMgr.LoadRouting(routingCode); routingDetail.WorkCenter = TheWorkCenterMgr.LoadWorkCenter(workCenterCode); routingDetail.Location = TheLocationMgr.LoadLocation(locationCode); } }
protected void LoadItem(object sender, EventArgs e) { DetachedCriteria criter = DetachedCriteria.For(typeof(LocationLotDetail)); criter.Add(Expression.Eq("Location", TheLocationMgr.LoadLocation(tbMiscOrderLocation.Text))); criter.Add(Expression.In("StorageBin", TheStorageBinMgr.GetStorageBin(tbStorageBin.Text).ToList())); criter.Add(Expression.IsNotNull("StorageBin")); IList <LocationLotDetail> result = TheCriteriaMgr.FindAll <LocationLotDetail>(criter); GridView1.DataSource = result; GridView1.DataBind(); }
protected void lbtnDelete_Click(object sender, EventArgs e) { string code = ((LinkButton)sender).CommandArgument; try { TheLocationMgr.DeleteLocation(code); ShowSuccessMessage("MasterData.Location.DeleteLocation.Successfully", code); UpdateView(); } catch (Castle.Facilities.NHibernateIntegration.DataException ex) { ShowErrorMessage("MasterData.Location.DeleteLocation.Fail", code); } }
protected void ODS_Location_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { location = (Location)e.InputParameters[0]; location.Code = location.Code.Trim(); location.Name = location.Name.Trim(); if (location != null) { string region = ((Controls_TextBox)(this.FV_Location.FindControl("tbRegion"))).Text.Trim(); location.Region = TheRegionMgr.LoadRegion(region); } if (TheLocationMgr.LoadLocation(location.Code) != null) { ShowErrorMessage("MasterData.Location.CodeExist", location.Code); NewEvent(sender, e); e.Cancel = true; } }
protected void ODS_BomDetail_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { string parcode = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbParCode"))).Text.Trim(); string compcode = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbCompCode"))).Text.Trim(); string uom = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbUom"))).Text.Trim(); string location = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbLocation"))).Text.Trim(); com.Sconit.Control.CodeMstrDropDownList ddlBackFlushMethod = (com.Sconit.Control.CodeMstrDropDownList) this.FV_BomDetail.FindControl("ddlBackFlushMethod"); bomdetail = (BomDetail)e.InputParameters[0]; bomdetail.Bom = TheBomMgr.LoadBom(parcode); item = TheItemMgr.LoadItem(compcode); bomdetail.Item = item; if (item != null) { //default compcode and uom if (uom.Trim() == "") { bomdetail.Uom = item.Uom; } else { bomdetail.Uom = TheUomMgr.LoadUom(uom); } } if (location == "") { bomdetail.Location = null; } else { bomdetail.Location = TheLocationMgr.LoadLocation(location); } if (ddlBackFlushMethod.SelectedIndex != -1) { bomdetail.BackFlushMethod = ddlBackFlushMethod.SelectedValue; } bomdetail.ScrapPercentage = bomdetail.ScrapPercentage / 100; if (TheBomDetailMgr.CheckUniqueExist(bomdetail.Bom.Code, bomdetail.Item.Code, bomdetail.Operation, bomdetail.Reference, bomdetail.StartDate)) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.UniqueExistError"); e.Cancel = true; } }
protected void ODS_BomDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e) { string parcode = ((TextBox)(this.FV_BomDetail.FindControl("tbParCode"))).Text.Trim(); string compcode = ((TextBox)(this.FV_BomDetail.FindControl("tbCompCode"))).Text.Trim(); string uom = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbUom"))).Text.Trim(); string location = ((Controls_TextBox)(this.FV_BomDetail.FindControl("tbLocation"))).Text.Trim(); string endTime = ((TextBox)(this.FV_BomDetail.FindControl("tbEndTime"))).Text.Trim(); com.Sconit.Control.CodeMstrDropDownList ddlBackFlushMethod = (com.Sconit.Control.CodeMstrDropDownList) this.FV_BomDetail.FindControl("ddlBackFlushMethod"); bomdetail = (BomDetail)e.InputParameters[0]; bomdetail.Bom = TheBomMgr.LoadBom(parcode); item = TheItemMgr.LoadItem(compcode); bomdetail.Item = item; if (item != null) { //default compcode and uom if (uom.Trim() == string.Empty) { bomdetail.Uom = item.Uom; } else { bomdetail.Uom = TheUomMgr.LoadUom(uom); } } if (location == string.Empty) { bomdetail.Location = null; } else { bomdetail.Location = TheLocationMgr.LoadLocation(location); } if (ddlBackFlushMethod.SelectedIndex != -1) { bomdetail.BackFlushMethod = ddlBackFlushMethod.SelectedValue; } if (endTime != string.Empty) { bomdetail.EndDate = DateTime.Parse(endTime); } bomdetail.ScrapPercentage = bomdetail.ScrapPercentage / 100; }
protected void btnSave_Click(object sender, EventArgs e) { string region = this.tbRegion.Text.Trim(); string location = this.tbLocation.Text.Trim(); string effectiveDate = this.tbEffDate.Text.Trim(); DateTime effDate = DateTime.Today; if (region == string.Empty) { ShowErrorMessage("Common.Business.Error.RegionInvalid"); return; } else if (location == string.Empty) { ShowErrorMessage("Common.Business.Error.LocationInvalid"); return; } try { effDate = Convert.ToDateTime(effectiveDate); } catch (Exception) { ShowErrorMessage("Common.Business.Error.DateInvalid"); return; } CycleCount cycleCount = new CycleCount(); cycleCount.Location = TheLocationMgr.LoadLocation(location); cycleCount.EffectiveDate = effDate; cycleCount.Type = this.ddlType.SelectedValue; cycleCount.IsScanHu = this.cbIsScanHu.Checked; cycleCount.PhyCntGroupBy = this.ddlPhyCntGroupBy.SelectedValue; TheCycleCountMgr.CreateCycleCount(cycleCount, this.CurrentUser); ShowSuccessMessage("Common.Business.Result.Insert.Successfully"); if (SaveEvent != null) { SaveEvent(cycleCount.Code, e); } }
private IList <MaterialIn> GetMaterialInList() { IList <MaterialIn> materialInList = new List <MaterialIn>(); for (int i = 0; i < this.GV_List.Rows.Count; i++) { GridViewRow row = this.GV_List.Rows[i]; string itemCode = ((Label)row.FindControl("lblItemCode")).Text.Trim(); Label lblOperation = (Label)row.FindControl("lblOperation"); int? operation = null; if (lblOperation.Text.Trim() != string.Empty) { operation = int.Parse(lblOperation.Text.Trim()); } Label lblLocation = (Label)row.FindControl("lblLocation"); TextBox tbQty = (TextBox)row.FindControl("tbQty"); decimal qty = tbQty.Text.Trim() == string.Empty ? 0 : decimal.Parse(tbQty.Text.Trim()); MaterialIn materialIn = new MaterialIn(); materialIn.RawMaterial = TheItemMgr.LoadItem(itemCode); materialIn.Operation = operation; materialIn.Qty = qty; if (lblLocation.Text.Trim() != string.Empty) { materialIn.Location = TheLocationMgr.LoadLocation(lblLocation.Text.Trim()); } if (materialIn.Qty != 0) { materialInList.Add(materialIn); } } return(materialInList); }
protected void ODS_StorageArea_Inserting(object source, ObjectDataSourceMethodEventArgs e) { StorageArea storageArea = (StorageArea)e.InputParameters[0]; string locationCode = ((TextBox)(this.FV_StorageArea.FindControl("tbLocationCode"))).Text.Trim(); string areaCode = ((TextBox)(this.FV_StorageArea.FindControl("tbAreaCode"))).Text.Trim(); string areaDescription = ((TextBox)(this.FV_StorageArea.FindControl("tbAreaDescription"))).Text.Trim(); if (areaCode == null || areaCode == string.Empty) { ShowErrorMessage("MasterData.Location.Area.Required.Code"); e.Cancel = true; return; } storageArea.Code = areaCode; storageArea.Description = areaDescription; storageArea.Location = TheLocationMgr.LoadLocation(locationCode); ShowSuccessMessage("MasterData.Location.Area.AddArea.Successfully", areaCode); if (CreateEvent != null) { CreateEvent(storageArea, null); this.Visible = false; } }
private void DoSearch() { IList <StorageBin> storageBinList = new List <StorageBin>(); if (this.AreaCode == null || this.AreaCode == string.Empty) { storageBinList = TheStorageBinMgr.GetStorageBin(TheLocationMgr.LoadLocation(this.tbLocationCode.Text)); } else { storageBinList = TheStorageBinMgr.GetStorageBin(this.tbAreaCode.Text); } this.GV_Bin.DataSource = storageBinList; this.GV_Bin.DataBind(); if (storageBinList.Count == 0) { this.ltlMessage.Visible = true; } else { this.ltlMessage.Visible = false; } }
public void SaveAllDetail() { IList <OrderLocationTransaction> orderLocTransList = new List <OrderLocationTransaction>(); int count = this.GV_List.Rows.Count; if (!this.IsReuse) { count = count - 1; } for (int i = 0; i < count; i++) { GridViewRow row = this.GV_List.Rows[i]; HiddenField hfId = (HiddenField)row.FindControl("hfId"); OrderLocationTransaction orderLocTrans = TheOrderLocationTransactionMgr.LoadOrderLocationTransaction(int.Parse(hfId.Value)); orderLocTrans.IsAssemble = ((CheckBox)row.FindControl("cbIsAssemble")).Checked; orderLocTrans.OrderedQty = decimal.Parse(((TextBox)row.FindControl("tbOrderdQty")).Text.Trim()); orderLocTrans.UnitQty = decimal.Parse(((TextBox)row.FindControl("tbUnitQty")).Text.Trim()); orderLocTrans.ItemVersion = ((TextBox)row.FindControl("tbUnitQty")).Text.Trim(); Controls_TextBox tbLocation = (Controls_TextBox)row.FindControl("tbLocation"); if (tbLocation.Text.Trim() != string.Empty) { orderLocTrans.Location = TheLocationMgr.LoadLocation(tbLocation.Text.Trim()); } orderLocTrans.NeedPrint = ((CheckBox)row.FindControl("cbNeedPrint")).Checked; orderLocTransList.Add(orderLocTrans); } //更新orderloctrans foreach (OrderLocationTransaction orderLocTrans in orderLocTransList) { TheOrderLocationTransactionMgr.UpdateOrderLocationTransaction(orderLocTrans); } // ShowSuccessMessage("MasterData.Order.LocTrans.Update.Successfully"); }
protected void ODS_Flow_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { flow = (Flow)e.InputParameters[0]; Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow"); Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom"); Controls_TextBox tbPartyTo = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyTo"); Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbLocFrom"); Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo"); com.Sconit.Control.CodeMstrDropDownList ddlGrGapTo = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlGrGapTo"); com.Sconit.Control.CodeMstrDropDownList ddlCheckDetailOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCheckDetailOption"); com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlAsnTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlAsnTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); Controls_TextBox tbCarrier = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrier"); Controls_TextBox tbCarrierBillAddress = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrierBillAddress"); Controls_TextBox tbCurrency = (Controls_TextBox)this.FV_Flow.FindControl("tbCurrency"); Controls_TextBox tbPriceListTo = (Controls_TextBox)this.FV_Flow.FindControl("tbPriceListTo"); Controls_TextBox tbTPriceList = (Controls_TextBox)this.FV_Flow.FindControl("tbTPriceList"); Controls_TextBox tbTRoute = (Controls_TextBox)this.FV_Flow.FindControl("tbTRoute"); if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty) { flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code; } if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty) { flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim()); } if (tbPartyTo != null && tbPartyTo.Text.Trim() != string.Empty) { flow.PartyTo = ThePartyMgr.LoadParty(tbPartyTo.Text.Trim()); } if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty) { flow.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim()); } if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } if (ddlOrderTemplate.SelectedIndex != -1) { flow.OrderTemplate = ddlOrderTemplate.SelectedValue; } if (ddlGrGapTo != null && ddlGrGapTo.SelectedIndex != -1) { flow.GoodsReceiptGapTo = ddlGrGapTo.SelectedValue; } if (ddlCheckDetailOption != null && ddlCheckDetailOption.SelectedIndex != -1) { flow.CheckDetailOption = ddlCheckDetailOption.SelectedValue; } if (ddlAsnTemplate.SelectedIndex != -1) { flow.AsnTemplate = ddlAsnTemplate.SelectedValue; } if (ddlReceiptTemplate.SelectedIndex != -1) { flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue; } if (ddlHuTemplate.SelectedIndex != -1) { flow.HuTemplate = ddlHuTemplate.SelectedValue; } if (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } if (tbCarrier != null && tbCarrier.Text.Trim() != string.Empty) { flow.Carrier = TheCarrierMgr.LoadCarrier(tbCarrier.Text.Trim()); } if (tbCarrierBillAddress != null && tbCarrierBillAddress.Text.Trim() != string.Empty) { flow.CarrierBillAddress = TheAddressMgr.LoadBillAddress(tbCarrierBillAddress.Text.Trim()); } if (tbTPriceList != null && tbTPriceList.Text.Trim() != string.Empty) { flow.TransportPriceList = TheTransportPriceListMgr.LoadTransportPriceList(tbTPriceList.Text.Trim()); } if (tbTRoute != null && tbTRoute.Text.Trim() != string.Empty) { flow.TransportationRoute = TheTransportationRouteMgr.LoadTransportationRoute(tbTRoute.Text.Trim()); } if (tbCurrency != null && tbCurrency.Text.Trim() != string.Empty) { flow.Currency = TheCurrencyMgr.LoadCurrency(tbCurrency.Text.Trim()); } else { string currencyCode = TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_BASE_CURRENCY).Value; flow.Currency = TheCurrencyMgr.LoadCurrency(currencyCode); } flow.BillSettleTerm = null; flow.CheckDetailOption = BusinessConstants.CODE_MASTER_CHECK_ORDER_DETAIL_OPTION_VALUE_NOT_CHECK; flow.Type = BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_TRANSFER; flow.AntiResolveHu = BusinessConstants.CODE_MASTER_ANTI_RESOLVE_HU_VALUE_NOT_RESOLVE; flow.CreateUser = this.CurrentUser; flow.CreateDate = DateTime.Now; flow.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version = 0; }
private void HuScan(Hu hu) { if (hu == null) { this.lblMessage.Text = Resources.Language.MasterDataHuNotExist; return; } else { if (TheOrder.OrderDetails != null) { foreach (OrderDetail orderDetail in TheOrder.OrderDetails) { if (orderDetail.HuId == hu.HuId) { this.lblMessage.Text = Resources.Language.MasterDataHuExist; return; } } } Flow flow = this.TheFlowMgr.LoadFlow(TheOrder.Flow); if (flow != null && !flow.AllowCreateDetail) { bool isMatch = false; if (TheOrder.OrderDetails != null) { foreach (OrderDetail orderDetail in TheOrder.OrderDetails) { if (orderDetail.Item.Code == hu.Item.Code && orderDetail.Uom.Code == hu.Uom.Code) { if (!orderDetail.OrderHead.FulfillUnitCount || orderDetail.UnitCount == hu.UnitCount) { if (orderDetail.HuId != string.Empty && orderDetail.HuId != null) { OrderDetail newOrderDetail = new OrderDetail(); newOrderDetail.IsScanHu = true; int seqInterval = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value); int seq = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value); if (this.TheOrder.OrderDetails == null || this.TheOrder.OrderDetails.Count == 0) { newOrderDetail.Sequence = seqInterval; } else { newOrderDetail.Sequence = this.TheOrder.OrderDetails.Last <OrderDetail>().Sequence + seqInterval; } newOrderDetail.Item = orderDetail.Item; newOrderDetail.Uom = orderDetail.Uom; newOrderDetail.HuId = hu.HuId; newOrderDetail.HuQty = hu.Qty; if ((this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION && this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_ADJ) || this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_RTN) { newOrderDetail.OrderedQty = -hu.Qty; } else { newOrderDetail.OrderedQty = hu.Qty; } newOrderDetail.LocationFrom = orderDetail.LocationFrom; if (this.IsReject) { newOrderDetail.LocationTo = TheLocationMgr.GetRejectLocation(); } else { newOrderDetail.LocationTo = orderDetail.LocationTo; } newOrderDetail.ReferenceItemCode = orderDetail.ReferenceItemCode; newOrderDetail.UnitCount = orderDetail.UnitCount; newOrderDetail.PackageType = orderDetail.PackageType; newOrderDetail.OrderHead = orderDetail.OrderHead; newOrderDetail.IsScanHu = true; TheOrder.AddOrderDetail(newOrderDetail); } else { orderDetail.IsScanHu = true; orderDetail.HuId = hu.HuId; orderDetail.HuQty = hu.Qty; if ((this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION && this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_ADJ) || this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_RTN) { orderDetail.OrderedQty = -hu.Qty; } else { orderDetail.OrderedQty = hu.Qty; } if (this.IsReject) { orderDetail.LocationTo = TheLocationMgr.GetRejectLocation(); } } isMatch = true; break; } } } } if (!isMatch) { this.lblMessage.Text = Resources.Language.MasterDataFlowNotExistHuItem; return; } } else { OrderDetail newOrderDetail = new OrderDetail(); newOrderDetail.IsScanHu = true; int seqInterval = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value); int seq = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value); if (this.TheOrder.OrderDetails == null || this.TheOrder.OrderDetails.Count == 0) { newOrderDetail.Sequence = seqInterval; } else { newOrderDetail.Sequence = this.TheOrder.OrderDetails.Last <OrderDetail>().Sequence + seqInterval; } newOrderDetail.Item = hu.Item; newOrderDetail.Uom = hu.Uom; newOrderDetail.HuId = hu.HuId; newOrderDetail.HuQty = hu.Qty; if ((this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION && this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_ADJ) || this.ModuleSubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_RTN) { newOrderDetail.OrderedQty = -hu.Qty; } else { newOrderDetail.OrderedQty = hu.Qty; } if (this.IsReject) { newOrderDetail.LocationFrom = TheLocationMgr.GetRejectLocation(); } else { newOrderDetail.LocationFrom = TheOrder.LocationFrom; } newOrderDetail.LocationTo = TheOrder.LocationTo; newOrderDetail.UnitCount = hu.UnitCount; TheOrder.AddOrderDetail(newOrderDetail); } IList <OrderDetail> orderDetailList = new List <OrderDetail>(); foreach (OrderDetail od in TheOrder.OrderDetails) { if (od.IsScanHu) { orderDetailList.Add(od); } } this.GV_List.DataSource = orderDetailList; this.GV_List.DataBind(); InitialHuScan(); } }
protected void btnConfirm_Click(object sender, EventArgs e) { try { IList<TransformerDetail> transformerDetailList = this.ucList.PopulateTransformerDetailList(); IList<OrderDetail> orderDetailList = new List<OrderDetail>(); string currentFlow = string.Empty; foreach (TransformerDetail transformerDetail in transformerDetailList) { if (transformerDetail.CurrentQty != transformerDetail.AdjustQty) { OrderLocationTransaction orderLocTrans = TheOrderLocationTransactionMgr.LoadOrderLocationTransaction(transformerDetail.OrderLocTransId); if (currentFlow == string.Empty) { currentFlow = orderLocTrans.OrderDetail.OrderHead.Flow; } OrderDetail orderDetail = new OrderDetail(); orderDetail.Item = TheItemMgr.LoadItem(transformerDetail.ItemCode); orderDetail.Uom = TheUomMgr.LoadUom(transformerDetail.UomCode); if (transformerDetail.HuId != null && transformerDetail.HuId.Trim() != string.Empty) { Hu hu = this.TheHuMgr.CheckAndLoadHu(transformerDetail.HuId.Trim()); orderDetail.OrderedQty = transformerDetail.AdjustQty - hu.Qty; } else { orderDetail.OrderedQty = transformerDetail.AdjustQty - transformerDetail.CurrentQty; } orderDetail.UnitCount = transformerDetail.UnitCount; orderDetail.HuId = transformerDetail.HuId; orderDetail.HuLotNo = transformerDetail.LotNo; if (transformerDetail.LocationFromCode != null) { orderDetail.LocationFrom = TheLocationMgr.LoadLocation(transformerDetail.LocationFromCode); } if (transformerDetail.LocationToCode != null) { orderDetail.LocationTo = TheLocationMgr.LoadLocation(transformerDetail.LocationToCode); } orderDetailList.Add(orderDetail); } } if (orderDetailList.Count > 0) { Receipt receipt = TheOrderMgr.QuickReceiveOrder(currentFlow, orderDetailList, this.CurrentUser.Code, BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_ADJ, DateTime.Now, DateTime.Now, false, this.ReceiptNo, null); this.Visible = false; ShowSuccessMessage("MasterData.Receipt.Adjust.Successfully", this.ReceiptNo); if (AdjustEvent != null) { AdjustEvent(receipt.ReceiptNo, e); } } else { ShowSuccessMessage("MasterData.Receipt.NoDetail.Adjust", this.ReceiptNo); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
private void SaveRender(object sender, EventArgs e) { //创建订单 try { OrderHead orderHead = CloneHelper.DeepClone <OrderHead>((OrderHead)sender); //Clone:避免修改List Page的TheOrder,导致出错 IList <OrderDetail> resultOrderDetailList = new List <OrderDetail>(); if (orderHead.OrderDetails != null && orderHead.OrderDetails.Count > 0) { foreach (OrderDetail orderDetail in orderHead.OrderDetails) { if (orderDetail.OrderedQty != 0) { if (!this.IsReuse) { orderDetail.LocationFrom = TheLocationMgr.LoadLocation(this.ddlLocationFrom.SelectedValue); orderDetail.LocationTo = null; } if (orderHead.Status != null) { orderDetail.ScrapQty = orderDetail.OrderedQty; } } } } orderHead.WindowTime = DateTime.Now; orderHead.StartTime = DateTime.Now; orderHead.Priority = BusinessConstants.CODE_MASTER_ORDER_PRIORITY_VALUE_NORMAL; orderHead.ReferenceOrderNo = this.tbRefOrderNo.Text.Trim(); orderHead.ExternalOrderNo = this.tbExtOrderNo.Text.Trim(); orderHead.IsAutoRelease = false; orderHead.IsAutoStart = true; orderHead.IsAutoShip = false; orderHead.IsAutoReceive = false; orderHead.Shift = TheShiftMgr.GetAllShift()[0]; TheOrderMgr.CreateOrder(orderHead, this.CurrentUser); if (this.cbPrintOrder.Checked) { IList <OrderDetail> orderDetails = orderHead.OrderDetails; IList <object> list = new List <object>(); list.Add(orderHead); list.Add(orderDetails); IList <OrderLocationTransaction> orderLocationTransactions = TheOrderLocationTransactionMgr.GetOrderLocationTransaction(orderHead.OrderNo); list.Add(orderLocationTransactions); string printUrl = TheReportMgr.WriteToFile(orderHead.OrderTemplate, list); Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>"); } this.ShowSuccessMessage("MasterData.Order.OrderHead.AddOrder.Successfully", orderHead.OrderNo); PageCleanup(); if (CreateEvent != null) { CreateEvent(orderHead.OrderNo, e); } } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); return; } }
protected void lbtnAdd_Click(object sender, EventArgs e) { int rowIndex = ((GridViewRow)(((DataControlFieldCell)(((LinkButton)(sender)).Parent)).Parent)).RowIndex; GridViewRow row = this.GV_List.Rows[rowIndex]; RequiredFieldValidator rfvItem = (RequiredFieldValidator)(row.FindControl("rfvItem")); RequiredFieldValidator rfvLocation = (RequiredFieldValidator)(row.FindControl("rfvLocation")); if (!rfvItem.IsValid || !rfvLocation.IsValid) { return; } if (checkItemExists()) { ShowErrorMessage("MasterData.Order.OrderDetail.Item.Exists"); return; } OrderLocationTransaction orderLocTrans = new OrderLocationTransaction(); orderLocTrans.Operation = int.Parse(((TextBox)row.FindControl("tbOperation")).Text.Trim()); orderLocTrans.OrderDetail = TheOrderDetailMgr.LoadOrderDetail(int.Parse(((DropDownList)row.FindControl("tbKitItem")).SelectedValue)); orderLocTrans.UnitQty = decimal.Parse(((TextBox)row.FindControl("tbUnitQty")).Text.Trim()); Item item = TheItemMgr.LoadItem(((Controls_TextBox)row.FindControl("tbItem")).Text.Trim()); if (item != null) { orderLocTrans.Item = item; orderLocTrans.Uom = item.Uom; } orderLocTrans.OrderedQty = decimal.Parse(((TextBox)row.FindControl("tbOrderdQty")).Text.Trim()); if (orderLocTrans.OrderedQty == 0) { orderLocTrans.OrderedQty = orderLocTrans.UnitQty * orderLocTrans.OrderDetail.OrderedQty; } if (!this.IsReuse && this.IsScrap) { orderLocTrans.Location = orderLocTrans.OrderDetail.DefaultLocationFrom; } else { Controls_TextBox tbLocation = (Controls_TextBox)row.FindControl("tbLocation"); if (tbLocation.Text.Trim() != string.Empty) { orderLocTrans.Location = TheLocationMgr.LoadLocation(tbLocation.Text.Trim()); } } orderLocTrans.NeedPrint = ((CheckBox)row.FindControl("cbNeedPrint")).Checked; orderLocTrans.IsAssemble = true; orderLocTrans.IOType = this.IOType; orderLocTrans.IsBlank = false; orderLocTrans.TransactionType = BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_ISS_WO; try { TheOrderMgr.AddOrderLocationTransaction(orderLocTrans, this.CurrentUser); ShowSuccessMessage("MasterData.Order.LocTrans.Add.Successfully"); UpdateRoutingEvent(this.OrderNo, e); UpdateView(); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void ODS_Flow_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Flow flow = (Flow)e.InputParameters[0]; Flow oldFlow = TheFlowMgr.LoadFlow(FlowCode); CloneHelper.CopyProperty(oldFlow, flow, EditFields, true); Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow"); Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom"); Controls_TextBox tbPartyTo = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyTo"); Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbLocFrom"); Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo"); Controls_TextBox tbShipFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbShipFrom"); Controls_TextBox tbShipTo = (Controls_TextBox)this.FV_Flow.FindControl("tbShipTo"); Controls_TextBox tbBillFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbBillFrom"); Controls_TextBox tbCarrier = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrier"); Controls_TextBox tbCarrierBillAddress = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrierBillAddress"); Controls_TextBox tbCurrency = (Controls_TextBox)this.FV_Flow.FindControl("tbCurrency"); Controls_TextBox tbPriceListFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPriceListFrom"); com.Sconit.Control.CodeMstrDropDownList ddlGrGapTo = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlGrGapTo"); com.Sconit.Control.CodeMstrDropDownList ddlCheckDetailOption = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlCheckDetailOption")); com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlAsnTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlAsnTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate")); DropDownList ddlBillSettleTerm = (DropDownList)this.FV_Flow.FindControl("ddlBillSettleTerm"); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); com.Sconit.Control.CodeMstrDropDownList ddlAntiResolveHu = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlAntiResolveHu"); if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty) { flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code; } if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty) { flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim()); } if (tbPartyTo != null && tbPartyTo.Text.Trim() != string.Empty) { flow.PartyTo = ThePartyMgr.LoadParty(tbPartyTo.Text.Trim()); } if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } if (tbShipFrom != null && tbShipFrom.Text.Trim() != string.Empty) { flow.ShipFrom = TheAddressMgr.LoadShipAddress(tbShipFrom.Text.Trim()); } if (tbShipTo != null && tbShipTo.Text.Trim() != string.Empty) { flow.ShipTo = TheAddressMgr.LoadShipAddress(tbShipTo.Text.Trim()); } if (tbBillFrom != null && tbBillFrom.Text.Trim() != string.Empty) { flow.BillFrom = TheAddressMgr.LoadBillAddress(tbBillFrom.Text.Trim()); } if (ddlBillSettleTerm.SelectedIndex != -1) { flow.BillSettleTerm = ddlBillSettleTerm.SelectedValue; } if (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } if (tbCarrier != null && tbCarrier.Text.Trim() != string.Empty) { flow.Carrier = TheCarrierMgr.LoadCarrier(tbCarrier.Text.Trim()); } if (tbCarrierBillAddress != null && tbCarrierBillAddress.Text.Trim() != string.Empty) { flow.CarrierBillAddress = TheAddressMgr.LoadBillAddress(tbCarrierBillAddress.Text.Trim()); } if (ddlGrGapTo.SelectedIndex != -1) { flow.GoodsReceiptGapTo = ddlGrGapTo.SelectedValue; } if (ddlCheckDetailOption.SelectedIndex != -1) { flow.CheckDetailOption = ddlCheckDetailOption.SelectedValue; } if (ddlOrderTemplate.SelectedIndex != -1) { flow.OrderTemplate = ddlOrderTemplate.SelectedValue; } if (ddlAsnTemplate.SelectedIndex != -1) { flow.AsnTemplate = ddlAsnTemplate.SelectedValue; } if (ddlReceiptTemplate.SelectedIndex != -1) { flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue; } if (ddlHuTemplate.SelectedIndex != -1) { flow.HuTemplate = ddlHuTemplate.SelectedValue; } if (ddlAntiResolveHu.SelectedIndex != -1) { flow.AntiResolveHu = ddlAntiResolveHu.SelectedValue; } if (tbPriceListFrom != null && tbPriceListFrom.Text.Trim() != string.Empty) { flow.PriceListFrom = ThePurchasePriceListMgr.LoadPurchasePriceList(tbPriceListFrom.Text.Trim()); } if (tbCurrency != null && tbCurrency.Text.Trim() != string.Empty) { flow.Currency = TheCurrencyMgr.LoadCurrency(tbCurrency.Text.Trim()); } else { string currencyCode = TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_BASE_CURRENCY).Value; flow.Currency = TheCurrencyMgr.LoadCurrency(currencyCode); } flow.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version += 1; }
protected void ODS_FlowDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e) { FlowDetail flowDetail = (FlowDetail)e.InputParameters[0]; FlowDetail oldFLowDetail = TheFlowDetailMgr.LoadFlowDetail(this.FlowDetailId); Flow flow = TheFlowMgr.LoadFlow(FlowCode, true); flowDetail.Flow = flow; flowDetail.CreateDate = oldFLowDetail.CreateDate; flowDetail.CreateUser = oldFLowDetail.CreateUser; flowDetail.LastModifyDate = DateTime.Now; flowDetail.LastModifyUser = this.CurrentUser; flowDetail.Version = oldFLowDetail.Version + 1; //seq if (flowDetail.Sequence == 0) { flowDetail.Sequence = TheFlowDetailMgr.LoadFlowDetail(this.FlowDetailId).Sequence; } Controls_TextBox tbItemCode = (Controls_TextBox)(this.FV_FlowDetail.FindControl("tbItemCode")); Controls_TextBox tbUom = (Controls_TextBox)(this.FV_FlowDetail.FindControl("tbUom")); if (tbItemCode != null && tbItemCode.Text.Trim() != string.Empty) { flowDetail.Item = TheItemMgr.LoadItem(tbItemCode.Text.Trim()); } if (tbUom != null && tbUom.Text.Trim() != string.Empty) { flowDetail.Uom = TheUomMgr.LoadUom(tbUom.Text.Trim()); } 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) { Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProcurementLocTo"); if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flowDetail.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } //djin 20120802 保存参考物料号 Controls_TextBox tbRefItemCode = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbRefItemCode"); if (tbRefItemCode != null && tbRefItemCode.Text.Trim() != string.Empty) { flowDetail.ReferenceItemCode = tbRefItemCode.Text.Trim(); } //end if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PROCUREMENT) { DropDownList ddlBillSettleTerm = (DropDownList)this.FV_FlowDetail.FindControl("ddlBillSettleTerm"); if (ddlBillSettleTerm.SelectedIndex != -1) { if (ddlBillSettleTerm.SelectedValue == string.Empty) { flowDetail.BillSettleTerm = null; } else { flowDetail.BillSettleTerm = ddlBillSettleTerm.SelectedValue; } } com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); if (ddlBarCodeType.SelectedIndex != -1) { flowDetail.BarCodeType = ddlBarCodeType.SelectedValue; } } } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_DISTRIBUTION) { Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbDistributionLocFrom"); if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty) { flowDetail.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim()); } DropDownList ddlBillSettleTerm = (DropDownList)this.FV_FlowDetail.FindControl("ddlBillSettleTerm"); if (ddlBillSettleTerm.SelectedIndex != -1) { flowDetail.BillSettleTerm = ddlBillSettleTerm.SelectedValue; } DropDownList ddlOddShipOption = (DropDownList)this.FV_FlowDetail.FindControl("ddlOddShipOption"); if (ddlOddShipOption.SelectedIndex != -1) { flowDetail.OddShipOption = ddlOddShipOption.SelectedValue; } flowDetail.PackagingCode = ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbPackagingCode")).Value; flowDetail.TransModeCode = ((System.Web.UI.HtmlControls.HtmlSelect) this.FV_FlowDetail.FindControl("tbTransModeCode")).Value; } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PRODUCTION) { Controls_TextBox tbBom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbBom"); if (tbBom != null && tbBom.Text.Trim() != string.Empty) { flowDetail.Bom = TheBomMgr.LoadBom(tbBom.Text.Trim()); } TextBox tbBatchSize = (TextBox)this.FV_FlowDetail.FindControl("tbBatchSize"); Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocFrom"); if (tbBatchSize.Text.Trim() != string.Empty) { flowDetail.BatchSize = decimal.Parse(tbBatchSize.Text.Trim()); } if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty) { flowDetail.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim()); } Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbProductionLocTo"); if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flowDetail.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } Controls_TextBox tbCustomer = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbCustomer"); if (tbCustomer != null && tbCustomer.Text.Trim() != string.Empty) { flowDetail.Customer = TheCustomerMgr.LoadCustomer(tbCustomer.Text.Trim()); } com.Sconit.Control.CodeMstrDropDownList ddlBarCodeType = (com.Sconit.Control.CodeMstrDropDownList) this.FV_FlowDetail.FindControl("ddlBarCodeType"); if (ddlBarCodeType.SelectedIndex != -1) { flowDetail.BarCodeType = ddlBarCodeType.SelectedValue; } } else if (this.ModuleType == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_TRANSFER) { Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocFrom"); if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty) { flowDetail.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim()); } Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_FlowDetail.FindControl("tbTransferLocTo"); if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flowDetail.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } DropDownList ddlOddShipOption = (DropDownList)this.FV_FlowDetail.FindControl("ddlOddShipOption"); if (ddlOddShipOption.SelectedIndex != -1) { flowDetail.OddShipOption = ddlOddShipOption.SelectedValue; } } }
protected void ODS_Flow_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Flow flow = (Flow)e.InputParameters[0]; Flow oldFlow = TheFlowMgr.LoadFlow(FlowCode); CloneHelper.CopyProperty(oldFlow, flow, EditFields, true); Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow"); Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom"); Controls_TextBox tbPartyTo = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyTo"); Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbLocFrom"); Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo"); Controls_TextBox tbShipFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbShipFrom"); Controls_TextBox tbShipTo = (Controls_TextBox)this.FV_Flow.FindControl("tbShipTo"); Controls_TextBox tbCarrier = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrier"); Controls_TextBox tbCarrierBillAddress = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrierBillAddress"); com.Sconit.Control.CodeMstrDropDownList ddlGrGapTo = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlGrGapTo"); com.Sconit.Control.CodeMstrDropDownList ddlCheckDetailOption = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlCheckDetailOption")); com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlAsnTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlAsnTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty) { flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code; } if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty) { flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim()); } if (tbPartyTo != null && tbPartyTo.Text.Trim() != string.Empty) { flow.PartyTo = ThePartyMgr.LoadParty(tbPartyTo.Text.Trim()); } if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } if (tbShipFrom != null && tbShipFrom.Text.Trim() != string.Empty) { flow.ShipFrom = TheAddressMgr.LoadShipAddress(tbShipFrom.Text.Trim()); } if (tbShipTo != null && tbShipTo.Text.Trim() != string.Empty) { flow.ShipTo = TheAddressMgr.LoadShipAddress(tbShipTo.Text.Trim()); } if (tbCarrier != null && tbCarrier.Text.Trim() != string.Empty) { flow.Carrier = TheCarrierMgr.LoadCarrier(tbCarrier.Text.Trim()); } if (tbCarrierBillAddress != null && tbCarrierBillAddress.Text.Trim() != string.Empty) { flow.CarrierBillAddress = TheAddressMgr.LoadBillAddress(tbCarrierBillAddress.Text.Trim()); } if (ddlGrGapTo.SelectedIndex != -1) { flow.GoodsReceiptGapTo = ddlGrGapTo.SelectedValue; } if (ddlCheckDetailOption.SelectedIndex != -1) { flow.CheckDetailOption = ddlCheckDetailOption.SelectedValue; } if (ddlOrderTemplate.SelectedIndex != -1) { flow.OrderTemplate = ddlOrderTemplate.SelectedValue; } if (ddlAsnTemplate.SelectedIndex != -1) { flow.AsnTemplate = ddlAsnTemplate.SelectedValue; } if (ddlReceiptTemplate.SelectedIndex != -1) { flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue; } if (ddlHuTemplate.SelectedIndex != -1) { flow.HuTemplate = ddlHuTemplate.SelectedValue; } if (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } flow.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version += 1; }
protected void ODS_Flow_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Flow flow = (Flow)e.InputParameters[0]; Flow oldFlow = TheFlowMgr.LoadFlow(FlowCode); CloneHelper.CopyProperty(oldFlow, flow, EditFields, true); Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow"); Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom"); Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbLocFrom"); Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo"); com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); com.Sconit.Control.CodeMstrDropDownList ddlMrpOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlMrpOption"); if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty) { flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code; } if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty) { flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim()); } if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty) { flow.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim()); } if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } if (ddlOrderTemplate.SelectedIndex != -1) { flow.OrderTemplate = ddlOrderTemplate.SelectedValue; } if (ddlReceiptTemplate.SelectedIndex != -1) { flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue; } if (ddlHuTemplate.SelectedIndex != -1) { flow.HuTemplate = ddlHuTemplate.SelectedValue; } if (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } if (ddlMrpOption.SelectedIndex != -1) { flow.MRPOption = ddlMrpOption.SelectedValue; } flow.BillSettleTerm = null; flow.CheckDetailOption = BusinessConstants.CODE_MASTER_CHECK_ORDER_DETAIL_OPTION_VALUE_NOT_CHECK; flow.PartyTo = flow.PartyFrom; flow.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version += 1; }
protected void CV_ServerValidate(object source, ServerValidateEventArgs args) { CustomValidator cv = (CustomValidator)source; switch (cv.ID) { case "cvUom": if (TheUomMgr.LoadUom(args.Value) == null) { ShowWarningMessage("MasterData.Bom.WarningMessage.UomInvalid", args.Value); args.IsValid = false; } break; case "cvRateQty": try { Convert.ToDecimal(args.Value); } catch (Exception) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.RateQtyError", args.Value); args.IsValid = false; } break; case "cvStruType": if (TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE, args.Value) == null) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.StruTypeError"); args.IsValid = false; } break; case "cvScrapPercentage": try { Convert.ToDecimal(args.Value); } catch (Exception) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.ScrapPercentageError"); args.IsValid = false; } break; case "cvStartTime": try { Convert.ToDateTime(args.Value); } catch (Exception) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.StartTimeError"); args.IsValid = false; } break; case "cvEndTime": try { if (args.Value.Trim() != "") { Convert.ToDateTime(args.Value); } } catch (Exception) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.EndTimeError"); args.IsValid = false; } break; case "cvLocation": if (args.Value.Trim() != "") { if (TheLocationMgr.LoadLocation(args.Value) == null) { ShowWarningMessage("MasterData.BomDetail.WarningMessage.LocationError", args.Value); args.IsValid = false; } } break; default: break; } }
protected void ODS_Flow_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { flow = (Flow)e.InputParameters[0]; Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow"); Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom"); Controls_TextBox tbPartyTo = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyTo"); Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo"); Controls_TextBox tbShipFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbShipFrom"); Controls_TextBox tbShipTo = (Controls_TextBox)this.FV_Flow.FindControl("tbShipTo"); Controls_TextBox tbBillFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbBillFrom"); Controls_TextBox tbCarrier = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrier"); Controls_TextBox tbCarrierBillAddress = (Controls_TextBox)this.FV_Flow.FindControl("tbCarrierBillAddress"); Controls_TextBox tbCurrency = (Controls_TextBox)this.FV_Flow.FindControl("tbCurrency"); Controls_TextBox tbPriceListFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPriceListFrom"); com.Sconit.Control.CodeMstrDropDownList ddlGrGapTo = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlGrGapTo"); com.Sconit.Control.CodeMstrDropDownList ddlCheckDetailOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCheckDetailOption"); com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlAsnTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlAsnTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate")); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty) { flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code; } if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty) { flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim()); } if (tbPartyTo != null && tbPartyTo.Text.Trim() != string.Empty) { flow.PartyTo = ThePartyMgr.LoadParty(tbPartyTo.Text.Trim()); } if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty) { flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim()); } if (tbShipFrom != null && tbShipFrom.Text.Trim() != string.Empty) { flow.ShipFrom = TheAddressMgr.LoadShipAddress(tbShipFrom.Text.Trim()); } if (tbShipTo != null && tbShipTo.Text.Trim() != string.Empty) { flow.ShipTo = TheAddressMgr.LoadShipAddress(tbShipTo.Text.Trim()); } if (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } if (tbCarrier != null && tbCarrier.Text.Trim() != string.Empty) { flow.Carrier = TheCarrierMgr.LoadCarrier(tbCarrier.Text.Trim()); } if (tbCarrierBillAddress != null && tbCarrierBillAddress.Text.Trim() != string.Empty) { flow.CarrierBillAddress = TheAddressMgr.LoadBillAddress(tbCarrierBillAddress.Text.Trim()); } if (ddlGrGapTo != null && ddlGrGapTo.SelectedIndex != -1) { flow.GoodsReceiptGapTo = ddlGrGapTo.SelectedValue; } if (ddlCheckDetailOption != null && ddlCheckDetailOption.SelectedIndex != -1) { flow.CheckDetailOption = ddlCheckDetailOption.SelectedValue; } if (ddlOrderTemplate.SelectedIndex != -1) { flow.OrderTemplate = ddlOrderTemplate.SelectedValue; } if (ddlAsnTemplate.SelectedIndex != -1) { flow.AsnTemplate = ddlAsnTemplate.SelectedValue; } if (ddlReceiptTemplate.SelectedIndex != -1) { flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue; } if (ddlHuTemplate.SelectedIndex != -1) { flow.HuTemplate = ddlHuTemplate.SelectedValue; } flow.Type = BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_CUSTOMERGOODS; flow.AntiResolveHu = BusinessConstants.CODE_MASTER_ANTI_RESOLVE_HU_VALUE_NOT_RESOLVE; flow.CreateUser = this.CurrentUser; flow.CreateDate = DateTime.Now; flow.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version = 0; }
protected void ODS_Item_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Item item = (Item)e.InputParameters[0]; item.Desc1 = item.Desc1.Trim(); item.Desc2 = item.Desc2.Trim(); item.Memo = item.Memo.Trim(); item.Type = ((CodeMstrDropDownList)(this.FV_Item.FindControl("ddlType"))).SelectedValue; string uom = ((TextBox)(this.FV_Item.FindControl("tbUom"))).Text.Trim(); item.Uom = TheUomMgr.LoadUom(uom); string location = ((Controls_TextBox)(this.FV_Item.FindControl("tbLocation"))).Text.Trim(); item.Location = TheLocationMgr.LoadLocation(location); string bom = ((Controls_TextBox)(this.FV_Item.FindControl("tbBom"))).Text.Trim(); item.Bom = TheBomMgr.LoadBom(bom); string routing = ((Controls_TextBox)(this.FV_Item.FindControl("tbRouting"))).Text.Trim(); item.Routing = TheRoutingMgr.LoadRouting(routing); string plant = ((CodeMstrDropDownList)(this.FV_Item.FindControl("ddlPlantType"))).Text.Trim(); item.Plant = plant; decimal uc = item.UnitCount; uc = System.Decimal.Round(uc, 8); if (uc == 0) { ShowErrorMessage("MasterData.Item.UC.Zero"); e.Cancel = true; } com.Sconit.Control.CodeMstrDropDownList ddlItemCategory = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Item.FindControl("ddlItemCategory")); if (ddlItemCategory.SelectedIndex != 0) { item.Category = ddlItemCategory.SelectedValue; } string imageUrl; string imgUpload = ((System.Web.UI.WebControls.Image)(this.FV_Item.FindControl("imgUpload"))).ImageUrl; if (((CheckBox)(this.FV_Item.FindControl("cbDeleteImage"))).Checked == true) { imageUrl = null; if (File.Exists(Server.MapPath(imgUpload))) { File.Delete(Server.MapPath(imgUpload)); } } else { imageUrl = UploadItemImage(item.Code); if (imageUrl == null) { imageUrl = imgUpload; } } item.ImageUrl = imageUrl; item.LastModifyDate = DateTime.Now; item.LastModifyUser = this.CurrentUser; }