Esempio n. 1
0
    protected void CV_ServerValidate(object source, ServerValidateEventArgs args)
    {
        CustomValidator cv = (CustomValidator)source;

        switch (cv.ID)
        {
        case "cvCode":
            if (TheTransportPriceListMgr.LoadTransportPriceList(args.Value) != null)
            {
                ShowWarningMessage("Transportation.TransportPriceList.Code.Exists", args.Value);
                args.IsValid = false;
            }
            break;

        case "cvParty":
            if (ThePartyMgr.LoadParty(args.Value) == null)
            {
                ShowWarningMessage("Transportation.TransportPriceList.Party.NotExist", args.Value);
                args.IsValid = false;
            }
            break;

        default:
            break;
        }
    }
Esempio n. 2
0
    protected void ODS_TransportPriceListDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Controls_TextBox tbCurrency = ((Controls_TextBox)(this.FV_WarehouseLease.FindControl("tbCurrency")));
        TextBox          tbEndDate  = ((TextBox)(this.FV_WarehouseLease.FindControl("tbEndDate")));

        transportPriceListDetail = (TransportPriceListDetail)e.InputParameters[0];
        transportPriceListDetail.TransportPriceList = TheTransportPriceListMgr.LoadTransportPriceList(this.TransportPriceListCode);
        transportPriceListDetail.Remark             = transportPriceListDetail.Remark.Trim();
        transportPriceListDetail.Currency           = TheCurrencyMgr.LoadCurrency(tbCurrency.Text.Trim());
        transportPriceListDetail.TaxCode            = transportPriceListDetail.TaxCode.Trim();
        transportPriceListDetail.EndDate            = tbEndDate.Text.Trim() == "" ? null : transportPriceListDetail.EndDate;
        transportPriceListDetail.Type = BusinessConstants.TRANSPORTATION_PRICELIST_DETAIL_TYPE_WAREHOUSELEASE;
    }
Esempio n. 3
0
    protected void lbtnDelete_Click(object sender, EventArgs e)
    {
        string code = ((LinkButton)sender).CommandArgument;

        try
        {
            TheTransportPriceListMgr.DeleteTransportPriceList(code);
            ShowSuccessMessage("Transportation.TransportPriceList.DeleteTransportPriceList.Successfully", code);
            UpdateView();
        }
        catch
        {
            ShowErrorMessage("Transportation.TransportPriceList.DeleteTransportPriceList.Fail", code);
        }
    }
Esempio n. 4
0
    protected void ODS_TransportPriceListDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Controls_TextBox tbItem = ((Controls_TextBox)(this.FV_Operation.FindControl("tbItem")));

        com.Sconit.Control.CodeMstrDropDownList ddlBillingMethod = ((com.Sconit.Control.CodeMstrDropDownList)(this.FV_Operation.FindControl("ddlBillingMethod")));
        Controls_TextBox tbCurrency = ((Controls_TextBox)(this.FV_Operation.FindControl("tbCurrency")));
        TextBox          tbEndDate  = ((TextBox)(this.FV_Operation.FindControl("tbEndDate")));

        transportPriceListDetail = (TransportPriceListDetail)e.InputParameters[0];
        transportPriceListDetail.TransportPriceList = TheTransportPriceListMgr.LoadTransportPriceList(this.TransportPriceListCode);
        transportPriceListDetail.Item          = tbItem.Text.Trim() == String.Empty ? null : TheItemMgr.LoadItem(tbItem.Text.Trim());
        transportPriceListDetail.BillingMethod = ddlBillingMethod.SelectedValue;
        transportPriceListDetail.Currency      = TheCurrencyMgr.LoadCurrency(tbCurrency.Text.Trim());
        transportPriceListDetail.TaxCode       = transportPriceListDetail.TaxCode.Trim();
        transportPriceListDetail.EndDate       = tbEndDate.Text.Trim() == "" ? null : transportPriceListDetail.EndDate;
        transportPriceListDetail.Type          = BusinessConstants.TRANSPORTATION_PRICELIST_DETAIL_TYPE_OPERATION;
    }
Esempio n. 5
0
    protected void ODS_TransportPriceListDetail_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Controls_TextBox tbShipFrom = ((Controls_TextBox)(this.FV_TransportPriceListDetail.FindControl("tbShipFrom")));
        Controls_TextBox tbShipTo   = ((Controls_TextBox)(this.FV_TransportPriceListDetail.FindControl("tbShipTo")));

        com.Sconit.Control.CodeMstrDropDownList ddlPricingMethod = ((com.Sconit.Control.CodeMstrDropDownList)(this.FV_TransportPriceListDetail.FindControl("ddlPricingMethod")));
        DropDownList     ddlVehicleType        = ((DropDownList)(this.FV_TransportPriceListDetail.FindControl("ddlVehicleType")));
        Controls_TextBox tbCurrency            = ((Controls_TextBox)(this.FV_TransportPriceListDetail.FindControl("tbCurrency")));
        TextBox          tbEndDate             = ((TextBox)(this.FV_TransportPriceListDetail.FindControl("tbEndDate")));
        DropDownList     transportMethodSelect = ((DropDownList)(this.FV_TransportPriceListDetail.FindControl("ddlTransportMethod")));

        transportPriceListDetail = (TransportPriceListDetail)e.InputParameters[0];
        transportPriceListDetail.TransportPriceList = TheTransportPriceListMgr.LoadTransportPriceList(this.TransportPriceListCode);
        transportPriceListDetail.ShipFrom           = TheTransportationAddressMgr.LoadTransportationAddress(GetTransportationAddressId(tbShipFrom.Text.Trim()));
        transportPriceListDetail.ShipTo             = TheTransportationAddressMgr.LoadTransportationAddress(GetTransportationAddressId(tbShipTo.Text.Trim()));
        transportPriceListDetail.PricingMethod      = ddlPricingMethod.SelectedValue;
        transportPriceListDetail.VehicleType        = ddlVehicleType.SelectedValue;
        transportPriceListDetail.Currency           = TheCurrencyMgr.LoadCurrency(tbCurrency.Text.Trim());
        transportPriceListDetail.TaxCode            = transportPriceListDetail.TaxCode.Trim();
        transportPriceListDetail.EndDate            = tbEndDate.Text.Trim() == "" ? null : transportPriceListDetail.EndDate;
        transportPriceListDetail.Type            = BusinessConstants.TRANSPORTATION_PRICELIST_DETAIL_TYPE_TRANSPORTATION;
        transportPriceListDetail.TransportMethod = transportMethodSelect.SelectedValue;
    }
Esempio n. 6
0
    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;
    }
Esempio n. 7
0
    protected void createTBill()
    {
        TransportationOrder to = TheTransportationOrderMgr.LoadTransportationOrder(OrderNo);

        if (to.Status == "In-Process")
        {
            TransportationActBill tb = new TransportationActBill();
            tb.BillAddress           = TheBillAddressMgr.LoadBillAddress(((Controls_TextBox)(this.FV_Order.FindControl("tbCarrierBillAddress"))).Text);
            tb.Currency              = TheCurrencyMgr.LoadCurrency("RMB");
            tb.Status                = "Create";
            tb.IsIncludeTax          = false;
            tb.OrderNo               = this.OrderNo;
            tb.TransType             = "Transportation";
            tb.EffectiveDate         = DateTime.Now;
            tb.CreateDate            = DateTime.Now;
            tb.CreateUser            = CurrentUser;
            tb.LastModifyUser        = CurrentUser;
            tb.LastModifyDate        = DateTime.Now;
            tb.IsProvisionalEstimate = false;
            string carrier = string.Empty;
            tb.PricingMethod = ((com.Sconit.Control.CodeMstrDropDownList)(this.FV_Order.FindControl("ddlPricingMethod"))).SelectedValue;
            carrier          = ((Controls_TextBox)(this.FV_Order.FindControl("tbCarrier"))).Text + "WL";
            string  vchtype  = ((DropDownList)(this.FV_Order.FindControl("ddlType"))).SelectedValue;
            int     shipto   = (TheTransportationOrderMgr.LoadTransportationOrder(this.OrderNo)).TransportationRoute.ShipTo.Id;
            int     shipfrom = (TheTransportationOrderMgr.LoadTransportationOrder(this.OrderNo)).TransportationRoute.ShipFrom.Id;
            DataSet ds       = SqlHelper.ExecuteDataset(connstring, CommandType.Text, "select id from TPriceListDet where Tpricelist='" + carrier + "' and startdate<'" + to.CreateDate.ToShortDateString() + "' and enddate >'" + to.CreateDate.ToShortDateString() + "' and currency='RMB' and pricingmethod='" + tb.PricingMethod + "' and vehicletype='" + vchtype + "' and shipto='" + shipto + "' and shipfrom='" + shipfrom + "' ");
            if (ds.Tables[0].Rows.Count == 0)
            {
                throw new BusinessErrorException("没有找到该类型的价格单");
            }
            int _id = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            tb.PriceListDetail = TheTransportPriceListDetailMgr.LoadTransportPriceListDetail(_id);
            tb.PriceList       = TheTransportPriceListMgr.LoadTransportPriceList(carrier);
            tb.UnitPrice       = tb.PriceListDetail.UnitPrice;
            tb.ShipFrom        = tb.PriceListDetail.ShipFrom;
            tb.ShipTo          = tb.PriceListDetail.ShipTo;
            tb.VehicleType     = tb.PriceListDetail.VehicleType;
            if (tb.PricingMethod != "SHIPT")
            {
                decimal qty = 0;
                foreach (DataRow dr in ds_ip.Tables[0].Rows)
                {
                    qty += Convert.ToDecimal((TheInProcessLocationMgr.LoadInProcessLocation(dr["ipno"].ToString())).CompleteLatency);
                }
                tb.BillQty   = qty;
                tb.BilledQty = 0;
                if (qty < tb.PriceListDetail.MinVolume)
                {
                    tb.BillAmount = tb.PriceListDetail.MinVolume * tb.UnitPrice;
                }
                else
                {
                    tb.BillAmount = qty * tb.UnitPrice;
                }
                tb.BilledAmount = 0;
            }
            else
            {
                tb.BillQty      = 1;
                tb.BilledQty    = 0;
                tb.BillAmount   = tb.PriceListDetail.UnitPrice;
                tb.BilledAmount = 0;
            }
            TheTransportationActBillMgr.CreateTransportationActBill(tb);
        }
        else
        {
            return;
        }
    }
Esempio n. 8
0
    private void SetPartyType()
    {
        TransportPriceList transportPriceList = TheTransportPriceListMgr.LoadTransportPriceList(this.TransportPriceListCode);

        this.PartyType = transportPriceList.Party.Type;
    }
Esempio n. 9
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;
    }