protected void CV_ServerValidate(object source, ServerValidateEventArgs args) { CustomValidator cv = (CustomValidator)source; switch (cv.ID) { case "cvCode": if (TheTransportationRouteMgr.LoadTransportationRoute(args.Value) != null) { ShowWarningMessage("Transportation.TransportationRoute.Code.Exists", args.Value); args.IsValid = false; } break; case "cvShipFrom": if (TheTransportationAddressMgr.LoadTransportationAddress(GetTransportationAddressId(args.Value)) == null) { ShowWarningMessage("Transportation.TransportationRoute.ShipFrom.NotExist", args.Value); args.IsValid = false; } break; case "cvShipTo": if (TheTransportationAddressMgr.LoadTransportationAddress(GetTransportationAddressId(args.Value)) == null) { ShowWarningMessage("Transportation.TransportationRoute.ShipTo.NotExist", args.Value); args.IsValid = false; } break; default: break; } }
protected void ODS_TransportationRouteDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Controls_TextBox tbTAddress = ((Controls_TextBox)(this.FV_TransportationRouteDetail.FindControl("tbTAddress"))); transportationRouteDetail = (TransportationRouteDetail)e.InputParameters[0]; transportationRouteDetail.TransportationAddress = TheTransportationAddressMgr.LoadTransportationAddress(GetTransportationAddressId(tbTAddress.Text.Trim())); transportationRouteDetail.TransportationRoute = TheTransportationRouteMgr.LoadTransportationRoute(this.TransportationRouteCode); }
protected void lbtnDelete_Click(object sender, EventArgs e) { string code = ((LinkButton)sender).CommandArgument; try { TheTransportationRouteMgr.DeleteTransportationRoute(code); ShowSuccessMessage("Transportation.TransportationRoute.DeleteTransportationRoute.Successfully", code); UpdateView(); } catch { ShowErrorMessage("Transportation.TransportationRoute.DeleteTransportationRoute.Fail", code); } }
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; }
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 tbShipFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbShipFlow"); 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 tbShipFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbShipFrom"); Controls_TextBox tbShipTo = (Controls_TextBox)this.FV_Flow.FindControl("tbShipTo"); Controls_TextBox tbBillTo = (Controls_TextBox)this.FV_Flow.FindControl("tbBillTo"); 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"); 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")); Controls_TextBox tbTPriceList = (Controls_TextBox)this.FV_Flow.FindControl("tbTPriceList"); Controls_TextBox tbTRoute = (Controls_TextBox)this.FV_Flow.FindControl("tbTRoute"); com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList) this.FV_Flow.FindControl("ddlCreateHuOption"); DropDownList ddlBillSettleTerm = (DropDownList)this.FV_Flow.FindControl("ddlBillSettleTerm"); if (tbShipFlow != null && tbShipFlow.Text.Trim() != string.Empty) { flow.ShipFlow = tbShipFlow.Text; } 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 (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 (tbBillTo != null && tbBillTo.Text.Trim() != string.Empty) { flow.BillTo = TheAddressMgr.LoadBillAddress(tbBillTo.Text.Trim()); } if (ddlBillSettleTerm.SelectedIndex != -1) { flow.BillSettleTerm = ddlBillSettleTerm.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 (ddlCreateHuOption.SelectedIndex != -1) { flow.CreateHuOption = ddlCreateHuOption.SelectedValue; } if (tbPriceListTo != null && tbPriceListTo.Text.Trim() != string.Empty) { flow.PriceListTo = TheSalesPriceListMgr.LoadSalesPriceList(tbPriceListTo.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.LastModifyUser = this.CurrentUser; flow.LastModifyDate = DateTime.Now; flow.Version += 1; }