private void ClearControls()
    {
        txtHawb.Text = "";
        CmbService.setValue("");
        CmbPPD.SelectedItem.Value = "";
        CmbSalesman.setValue("");

        txtColoader.Text  = "";
        txtReference.Text = "";
        txtClearance.Text = "";
        txtDO.Text        = "";

        CmbReceipt.setValue("");
        CmbFinalDest.setValue("");
        chkInsurance.Checked = false;
        chkDG.Checked        = false;
        chkSurrender.Checked = false;

        CmbShipperCode.setValue("");
        //CmbShipperName.SelectedItem.Value = "";
        CmbConsignee.setValue("");
        //CmbConsigneeName.SelectedItem.Value = "";

        CmbNotify1.setValue("");
        //mbNotify1Name.SelectedItem.Value = "";
        CmbNotify2.setValue("");
        //CmbNotify2Name.SelectedItem.Value = "";

        CmbCoLoader.setValue("");
        //CmbCoLoaderName.SelectedItem.Value = "";
        CmbBroker.setValue("");
        //CmbBrokerName.SelectedItem.Value = "";

        txtGWT.Text   = "";
        txtCWT.Text   = "";
        txtCBM.Text   = "";
        txtPiece.Text = "";
        CmbUnit.setValue("");
        txtContainer.Text = "";

        CmbWarehouse.setValue("");
        //CmbWarehouseName.SelectedItem.Value = "";
        txtFreeStorageStart.Text = "";
        txtFreeStorageEnd.Text   = "";
        txtPickUp.Text           = "";

        //CmbCompany.Text = "";
        // CmbCompanyName.Text = "";
        //CmbCurrency.Text = "";

        txtRemark.Text = "";
    }
Пример #2
0
    private void DataBindList()
    {
        txtHawb.Focus(true);
        UserSheet1.seed = hidSeed.Text;

        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "List")
                    .Append("seed", hidSeed.Text)
                    .Append("air_ToMAWB", hidMAWB.Text)
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("SYS", SYS)
                    );
        DataSet ds = GetDs("FW_AirImport_HAWB_SP", Getlist);

        if (ds != null && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["RowID"].ToString() != "")
        {
            txtHawb.Text         = ds.Tables[0].Rows[0]["HAWB"].ToString();
            txtReference.Text    = ds.Tables[0].Rows[0]["Reference"].ToString();
            txtClearance.Text    = ds.Tables[0].Rows[0]["Clearance"].ToString();
            chkInsurance.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Insurance"].ToString() == "" ? 0 : ds.Tables[0].Rows[0]["Insurance"]);
            labMAWB.Text         = ds.Tables[0].Rows[0]["MAWB"].ToString();
            labLotNo.Text        = ds.Tables[0].Rows[0]["LotNo"].ToString();
            CmbReceipt.setValue(ds.Tables[0].Rows[0]["Receipt"].ToString());
            CmbFinalDest.setValue(ds.Tables[0].Rows[0]["FinalDest"].ToString());
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString());
            chkDG.Checked        = Convert.ToBoolean(ds.Tables[0].Rows[0]["DG"].ToString() == "" ? 0 : ds.Tables[0].Rows[0]["DG"]);
            chkSurrender.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Surrender"].ToString() == "" ? 0 : ds.Tables[0].Rows[0]["Surrender"]);

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();

            CmbNotify1.setValue(ds.Tables[0].Rows[0]["Notify1"].ToString());
            CmbNotify1.Text = ds.Tables[0].Rows[0]["Notify1Name"].ToString();
            CmbNotify2.setValue(ds.Tables[0].Rows[0]["Notify2"].ToString());
            CmbNotify2.Text = ds.Tables[0].Rows[0]["Notify2Name"].ToString();

            CmbCoLoader.setValue(ds.Tables[0].Rows[0]["Coloader"].ToString());
            CmbCoLoader.Text = ds.Tables[0].Rows[0]["ColoaderName"].ToString();
            CmbBroker.setValue(ds.Tables[0].Rows[0]["Broker"].ToString());
            CmbBroker.Text = ds.Tables[0].Rows[0]["BrokerName"].ToString();
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["Unit"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }

            CmbWarehouse.setValue(ds.Tables[0].Rows[0]["Warehouse"].ToString());
            CmbWarehouse.Text        = ds.Tables[0].Rows[0]["WarehouseName"].ToString();
            txtFreeStorageStart.Text = ds.Tables[0].Rows[0]["FreeStorageStart"].ToString();
            txtFreeStorageEnd.Text   = ds.Tables[0].Rows[0]["FreeStorageEnd"].ToString();
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["FreeStorage"].ToString()))
            {
                NumFreeStorage.Text = ds.Tables[0].Rows[0]["FreeStorage"].ToString();
            }
            txtPickUp.Text = ds.Tables[0].Rows[0]["PickUp"].ToString();

            txtRemark.Text = ds.Tables[0].Rows[0]["Remark"].ToString();

            if (Convert.ToBoolean(ds.Tables[0].Rows[0]["active"]))
            {
                img_void.Style.Add("display", "none");
            }
            else
            {
                img_void.Style.Add("display", "inline");
                btnSave.Disabled   = true;
                btnCancel.Disabled = true;
                btnNext.Disabled   = true;
                btnVoid.Text       = "Active";
                hidVoid.Text       = "1";
            }

            GridPanelInvoice.GetStore().DataSource = ds.Tables[1];
            GridPanelInvoice.GetStore().DataBind();



            GridPanelForeign.GetStore().DataSource = ds.Tables[3];
            GridPanelForeign.GetStore().DataBind();

            GridPanelRoute.GetStore().DataSource = ds.Tables[4];
            GridPanelRoute.GetStore().DataBind();

            GridPanelContact.GetStore().DataSource = ds.Tables[5];
            GridPanelContact.GetStore().DataBind();

            ControlBinder.pageTitleMsg(false, "AI-H:" + labLotNo.Text, "<p>Status :  Edit  HAWB of  <span>" + labLotNo.Text + "</span></p>", div_bottom);
        }
        else
        {
            labMAWB.Text  = ds.Tables[0].Rows[0]["MAWB"].ToString();
            labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();
            CmbReceipt.setValue(ds.Tables[0].Rows[0]["Receipt"].ToString());
            CmbFinalDest.setValue(ds.Tables[0].Rows[0]["FinalDest"].ToString());
            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbCoLoader.setValue(ds.Tables[0].Rows[0]["Coloader"].ToString());
            CmbBroker.setValue(ds.Tables[0].Rows[0]["Broker"].ToString());
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["Unit"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }
            ControlBinder.pageTitleMsg(false, "AI-H New", "<p>Status :  New Blank  Hawb </p>", div_bottom);
        }
    }
Пример #3
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        if (string.IsNullOrEmpty(CmbShipperCode.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Shipper can't be empty!</p>";
            CmbShipperCode.Focus();
            return;
        }
        if (string.IsNullOrEmpty(CmbConsignee.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Consignee can't be empty!</p>";
            CmbConsignee.Focus();
            return;
        }
        if (GridFlightList.Store.Count == 0)
        {
            div_bottom.Html = "<p class='error'> Save failed, Flight Routing is no data!</p>";
            l_flightno.Focus();
            return;
        }

        List <IFields> UpdateHAWB = new List <IFields>();

        UpdateHAWB.Add(dal.CreateIFields().Append("Option", "Update")
                       .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text)

                       .Append("air_MAWB", txtMAWB.Text.Trim().Replace(" ", "").ToUpper())
                       //.Append("air_LocReceived",CmbDeparture.Value)
                       //.Append("air_LocFinal", CmbFinalDest.Value)

                       .Append("air_Sales", CmbSalesman.Value)

                       .Append("air_Shipper", CmbShipperCode.Value)
                       //.Append("air_Shipper", CmbShipperName.SelectedItem.Value)
                       .Append("air_Consignee", CmbConsignee.Value)
                       //.Append("air_Consignee", CmbConsigneeName.SelectedItem.Value)
                       .Append("air_CoLoader", CmbColoader.Value)

                       .Append("air_Carrier", CmbCarrierRight.Value)
                       .Append("air_Flight", txtFlightRight.Text.ToUpper())
                       .Append("air_LocLoad", CmbFromRight.Value)
                       .Append("air_LocDischarge", CmbToRight.Value)
                       .Append("air_ETD", ControlBinder.getDate(txtETD.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtETD.RawText.Trim()))
                       .Append("air_ETA", ControlBinder.getDate(txtETA.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtETA.RawText.Trim()))
                       .Append("air_ATD", ControlBinder.getDate(txtATD.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtATD.RawText.Trim()))
                       .Append("air_ATA", ControlBinder.getDate(txtATA.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtATA.RawText.Trim()))

                       .Append("air_GWT", string.IsNullOrEmpty(txtGWT.Text) ? DBNull.Value : (object)txtGWT.Text)
                       .Append("air_VWT", string.IsNullOrEmpty(txtVWT.Text) ? DBNull.Value : (object)txtVWT.Text)
                       .Append("air_CWT", string.IsNullOrEmpty(txtCWT.Text) ? DBNull.Value : (object)txtCWT.Text)
                       .Append("air_Piece", string.IsNullOrEmpty(txtPiece.Text) ? DBNull.Value : (object)txtPiece.Text)
                       .Append("air_Pallet", string.IsNullOrEmpty(txtPallet.Text) ? DBNull.Value : (object)txtPallet.Text)
                       .Append("air_Rate", string.IsNullOrEmpty(txtRate.Text) ? DBNull.Value : (object)txtRate.Text)

                       .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys)
                       .Append("code1", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys + "SN")
                       .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                       .Append("air_SYS", sys)
                       .Append("type", typename)
                       .Append("air_Remark", string.IsNullOrEmpty(txtRemark.Text) ? "" : txtRemark.Text.Trim().ToUpper())
                       .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                       );
        try
        {
            DataSet ds = GetDs("FW_AirExport_ViewConsol_SP", UpdateHAWB);
            hidSeed.Text = ds.Tables[0].Rows[0][0].ToString();
            string newFlag = ds.Tables[0].Rows[0][1].ToString();
            hidLotNo.Text = ds.Tables[0].Rows[0][2].ToString();
            #region FlightRouting
            var            ShipmentRoute = JSON.Deserialize <List <ShipmentRoute> >(e.ExtraParams["p_safety_l"]);
            List <IFields> Routelist     = new List <IFields>();
            string         RouteID       = "";
            for (int i = 0; i < ShipmentRoute.Count; ++i)
            {
                Routelist.Add(dal.CreateIFields().Append("Option", "Update").
                              Append("sr_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString()).
                              Append("sr_ToMaster", hidSeed.Text).
                              Append("sr_ShipKind", "FREIGHT").
                              Append("sr_Carrier", ShipmentRoute[i].Carrier).
                              Append("sr_OrderID", i).
                              Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).
                              Append("sr_Flight", ShipmentRoute[i].FlightNo.ToUpper()).
                              Append("sr_From", ShipmentRoute[i].From).
                              Append("sr_To", ShipmentRoute[i].To).
                              Append("sr_ETD", ControlBinder.getDate(ShipmentRoute[i].ETD.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ETD)).
                              Append("sr_ETA", ControlBinder.getDate(ShipmentRoute[i].ETA.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ETA)).
                              Append("sr_ATD", ControlBinder.getDate(ShipmentRoute[i].ATD.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ATD)).
                              Append("sr_ATA", ControlBinder.getDate(ShipmentRoute[i].ATA.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ATA)).
                              Append("sr_ROWID", ShipmentRoute[i].RowID));
                RouteID += "," + ShipmentRoute[i].RowID;
            }
            if (RouteID.Length > 1)
            {
                RouteID = RouteID.Substring(1, RouteID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentRoute_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "Delete").Append("sr_ToMaster", hidSeed.Text).Append("str", RouteID)
            }).Update();
            bool b = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentRoute_SP", Routelist).Update();
            #endregion

            #region HAWBList
            var            HAWBList  = JSON.Deserialize <List <HAWBList> >(e.ExtraParams["p_safety_2"]);
            List <IFields> HAWBLists = new List <IFields>();
            string         RowID     = "";
            for (int i = 0; i < HAWBList.Count; ++i)
            {
                //    HAWBLists.Add(dal.CreateIFields().Append("Option", "UpdateEmptyHAWB").
                //        Append("air_ROWID", HAWBList[i].RowID)
                //       .Append("air_ToMAWB", hidSeed.Text));
                RowID += HAWBList[i].RowID.ToString() + ",";
            }
            bool result = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ViewConsol_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "AddMakeConsolByIDList").Append("air_LotNo", hidLotNo.Text)
                .Append("str", RowID).Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).Append("air_ToMAWB", hidSeed.Text).Append("air_MAWB", txtMAWB.Text.Trim().Replace(" ", "").ToUpper())
            }).Update();
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ViewConsol_SP", HAWBLists).Update();
            #endregion

            #region LocalInvoice
            //var InvocieList = JSON.Deserialize<List<Invocie>>(e.ExtraParams["p_safety_3"]);
            //string InvoiceID = "";
            //for (int i = 0; i < InvocieList.Count; ++i)
            //{
            //    InvoiceID += "," + InvocieList[i].RowID;
            //}
            //if (InvoiceID.Length > 1)
            //{
            //    InvoiceID = InvoiceID.Substring(1, InvoiceID.Length - 1);
            //}
            //bool inv = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ViewConsol_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "DeleteInvoice")
            //.Append("air_ToMAWB",hidSeed.Text)
            //.Append("str",InvoiceID)}).Update();
            #endregion

            #region Costing
            //X.AddScript("saveCost('" + hidSeed.Text + "');");

            ucCost.costseed = hidSeed.Text;
            ucCost.btnCostEvent(sender, e);
            #endregion

            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "AE", "MAWB");
            if (newFlag == "N")
            {
                DataBindList();
                X.AddScript("if(window.opener!=null){if(typeof(window.opener.RefreshList)!='undefined'){window.opener.RefreshList();}}");
                ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p class=\"success\">Status : Save successfully ! </p>", div_bottom);
            }
            else
            {
                X.AddScript("if(window.opener!=null){if(typeof(window.opener.RefreshList)!='undefined'){window.opener.RefreshList();}}");
                ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p class=\"success\">Status : Save successfully ! </p>", div_bottom);
                X.Redirect("List.aspx?type=" + typename + "&seed=" + ds.Tables[0].Rows[0][0]);
            }
        }
        catch
        {
            ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p class=\"error\">Status : Save failed, please check the data !</p>", div_bottom);
        }
    }
Пример #4
0
    private void DataBindList()
    {
        txtMAWB.Focus(true);

        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "GetAEMakeConsol")
                    .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text)
                    .Append("str", hidIDList.Text)
                    .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("air_SYS", sys)
                    );
        DataSet ds = GetDs("FW_AirExport_ViewConsol_SP", Getlist);

        if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != null && hidSeed.Text != "")
        {
            labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();
            hidLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();

            txtMAWB.Text = ds.Tables[0].Rows[0]["MAWB"].ToString();
            //CmbDeparture.setValue(ds.Tables[0].Rows[0]["Departure"].ToString());
            //CmbFinalDest.setValue(ds.Tables[0].Rows[0]["Destination"].ToString());

            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString());
            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();
            CmbColoader.setValue(ds.Tables[0].Rows[0]["CoLoader"].ToString());
            CmbColoader.Text = ds.Tables[0].Rows[0]["CoLoaderName"].ToString();

            CmbCarrierRight.setValue(ds.Tables[0].Rows[0]["Carrier"].ToString());
            txtFlightRight.Text = ds.Tables[0].Rows[0]["FlightNo"].ToString();
            CmbFromRight.setValue(ds.Tables[0].Rows[0]["From"].ToString());
            CmbToRight.setValue(ds.Tables[0].Rows[0]["To"].ToString());
            txtETD.Text    = ds.Tables[0].Rows[0]["ETD"].ToString();
            txtETA.Text    = ds.Tables[0].Rows[0]["ETA"].ToString();
            txtATD.Text    = ds.Tables[0].Rows[0]["ATD"].ToString();
            txtATA.Text    = ds.Tables[0].Rows[0]["ATA"].ToString();
            txtRemark.Text = ds.Tables[0].Rows[0]["Remark"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Rate"].ToString()))
            {
                txtRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString();
            }

            bool ismakeMawb = ds.Tables[0].Rows[0]["air_MakeMAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeMAWB"]);

            string flag = "N";
            if (ismakeMawb)
            {
                flag = "Y";
            }
            X.AddScript("isMawbFlag='" + flag + "';");

            //if (ismakeMawb == true)
            //{
            //    txtGWT.Disabled = true;
            //    txtVWT.Disabled = true;
            //    txtCWT.Disabled = true;
            //    txtPiece.Disabled = true;
            //    isMawbFlag.Style.Add("display", "none");
            //}
            //else
            //{
            //    txtGWT.Disabled = false;
            //    txtVWT.Disabled = false;
            //    txtCWT.Disabled = false;
            //    txtPiece.Disabled = false;
            //    isMawbFlag.Style.Add("display", "block");
            //}
            if (ds.Tables[1].Rows.Count > 0)
            {
                GridFlightList.GetStore().DataSource = ds.Tables[1];
                GridFlightList.GetStore().DataBind();
            }

            if (ds.Tables[2].Rows.Count > 0)
            {
                gpHAWB.GetStore().DataSource = ds.Tables[2];
                gpHAWB.GetStore().DataBind();
                double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0;
                for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                {
                    if (ds.Tables[2].Rows[i]["IsSub"].ToString() == "0")
                    {
                        GWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["GWT"].ToString());
                        VWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["VWT"].ToString());
                        CWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["CWT"].ToString());
                        Pieces  += Convert.ToDouble(ds.Tables[2].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Piece"].ToString());
                        Pallets += Convert.ToDouble(ds.Tables[2].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Pallet"].ToString());
                    }
                }
                lblGWT.Text    = GWT.ToString("0.000");
                lblVWT.Text    = VWT.ToString("0.000");
                lblCWT.Text    = CWT.ToString("0.000");
                lblPiece.Text  = Pieces.ToString();
                lblPallet.Text = Pallets.ToString();
            }

            if (ds.Tables[3].Rows.Count > 0)
            {
                gpInvoice.GetStore().DataSource = ds.Tables[3];
                gpInvoice.GetStore().DataBind();
            }


            if (ControlBinder.IsDisplayLotNo(txtETD.Text.Trim(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }

            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnPull.Disabled     = true;
                btnNew.Disabled      = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                btnUpdateLotNo.Hide();
            }
            ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p>Status :  Edit  No. of  <span>" + hidLotNo.Text + "</span></p>", div_bottom);
        }
        else
        {
            if (ds.Tables[2].Rows.Count > 0)
            {
                gpHAWB.GetStore().DataSource = ds.Tables[2];
                gpHAWB.GetStore().DataBind();
                double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0;
                for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                {
                    if (ds.Tables[2].Rows[i]["IsSub"].ToString() == "0")
                    {
                        GWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["GWT"].ToString());
                        VWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["VWT"].ToString());
                        CWT     += Convert.ToDouble(ds.Tables[2].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["CWT"].ToString());
                        Pieces  += Convert.ToDouble(ds.Tables[2].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Piece"].ToString());
                        Pallets += Convert.ToDouble(ds.Tables[2].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["Pallet"].ToString());
                    }
                }
                lblGWT.Text    = GWT.ToString("0.000");
                lblVWT.Text    = VWT.ToString("0.000");
                lblCWT.Text    = CWT.ToString("0.000");
                lblPiece.Text  = Pieces.ToString();
                lblPallet.Text = Pallets.ToString();
            }
            ControlBinder.pageTitleMsg(false, showname, "<p>Status :  New Blank  No. </p>", div_bottom);
        }
    }
Пример #5
0
    public void GetHAWBInfo(string name)
    {
        DataSet dsCom = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_Manifest_SP", new List <IFields>()
        {
            dal.CreateIFields().
            Append("Option", "GetHawbInfo").
            Append("wbm_Seed", hidSeed.Text)
        }).GetList();

        if (dsCom != null && dsCom.Tables[0].Rows.Count > 0)
        {
            if (name == "Shipper")
            {
                CmbShipperCode.setValue(dsCom.Tables[0].Rows[0]["wbi_ShipperCode"].ToString());
                lblShipper1.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper1"].ToString();
                lblShipper2.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper2"].ToString();
                lblShipper3.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper3"].ToString();
                lblShipper4.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper4"].ToString();
                lblShipper5.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper5"].ToString();
                lblShipper6.Text = dsCom.Tables[0].Rows[0]["wbi_Shipper6"].ToString();
            }
            else if (name == "Consignee")
            {
                CmbConsignee.setValue(dsCom.Tables[0].Rows[0]["wbi_ConsigneeCode"].ToString());
                lblConsignee1.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee1"].ToString();
                lblConsignee2.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee2"].ToString();
                lblConsignee3.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee3"].ToString();
                lblConsignee4.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee4"].ToString();
                lblConsignee5.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee5"].ToString();
                lblConsignee6.Text = dsCom.Tables[0].Rows[0]["wbi_Consignee6"].ToString();
            }
            else
            {
                int count = dsCom.Tables[1].Rows.Count;
                if (count > 0)
                {
                    lblNature1.Text = dsCom.Tables[1].Rows[0][0].ToString();
                }
                if (count > 1)
                {
                    lblNature2.Text = dsCom.Tables[1].Rows[1][0].ToString();
                }
                if (count > 2)
                {
                    lblNature3.Text = dsCom.Tables[1].Rows[2][0].ToString();
                }
                if (count > 3)
                {
                    lblNature4.Text = dsCom.Tables[1].Rows[3][0].ToString();
                }
                if (count > 4)
                {
                    lblNature5.Text = dsCom.Tables[1].Rows[4][0].ToString();
                }
                if (count > 5)
                {
                    lblNature6.Text = dsCom.Tables[1].Rows[5][0].ToString();
                }
            }
        }
    }
Пример #6
0
    private void DataBindList()
    {
        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "List")
                    .Append("wbm_Seed", hidSeed.Text == "" ? null : hidSeed.Text)
                    );
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_Manifest_SP", Getlist).GetList();

        if (ds != null && ds.Tables[0].Rows[0][0].ToString() == "Y")
        {
            if (ds != null && ds.Tables[1].Rows.Count > 0)
            {
                txtHAWB.Text  = ds.Tables[1].Rows[0]["wbm_HAWB"].ToString();
                txtPKG.Text   = ds.Tables[1].Rows[0]["wbm_RCP"].ToString();
                txtWT.Text    = ds.Tables[1].Rows[0]["wbm_WT"].ToString();
                txtPreWT.Text = ds.Tables[1].Rows[0]["wbm_PreAlertWT"].ToString();
                txtInfo.Text  = ds.Tables[1].Rows[0]["wbm_WTLine"].ToString();
                CmbDest.SelectedItem.Value = ds.Tables[1].Rows[0]["wbm_Final"].ToString();

                CmbShipperCode.setValue(ds.Tables[1].Rows[0]["wbm_ShipperCode"].ToString());
                lblShipper1.Text = ds.Tables[1].Rows[0]["wbm_Shipper1"].ToString();
                lblShipper2.Text = ds.Tables[1].Rows[0]["wbm_Shipper2"].ToString();
                lblShipper3.Text = ds.Tables[1].Rows[0]["wbm_Shipper3"].ToString();
                lblShipper4.Text = ds.Tables[1].Rows[0]["wbm_Shipper4"].ToString();
                lblShipper5.Text = ds.Tables[1].Rows[0]["wbm_Shipper5"].ToString();
                lblShipper6.Text = ds.Tables[1].Rows[0]["wbm_Shipper6"].ToString();

                CmbConsignee.setValue(ds.Tables[1].Rows[0]["wbm_ConsigneeCode"].ToString());
                lblConsignee1.Text = ds.Tables[1].Rows[0]["wbm_Consignee1"].ToString();
                lblConsignee2.Text = ds.Tables[1].Rows[0]["wbm_Consignee2"].ToString();
                lblConsignee3.Text = ds.Tables[1].Rows[0]["wbm_Consignee3"].ToString();
                lblConsignee4.Text = ds.Tables[1].Rows[0]["wbm_Consignee4"].ToString();
                lblConsignee5.Text = ds.Tables[1].Rows[0]["wbm_Consignee5"].ToString();
                lblConsignee6.Text = ds.Tables[1].Rows[0]["wbm_Consignee6"].ToString();

                lblNature1.Text = ds.Tables[1].Rows[0]["wbm_Nature1"].ToString();
                lblNature2.Text = ds.Tables[1].Rows[0]["wbm_Nature2"].ToString();
                lblNature3.Text = ds.Tables[1].Rows[0]["wbm_Nature3"].ToString();
                lblNature4.Text = ds.Tables[1].Rows[0]["wbm_Nature4"].ToString();
                lblNature5.Text = ds.Tables[1].Rows[0]["wbm_Nature5"].ToString();
                lblNature6.Text = ds.Tables[1].Rows[0]["wbm_Nature6"].ToString();
            }

            if (ds != null && ds.Tables[2].Rows.Count > 0)
            {
                gpHawb.GetStore().DataSource = ds.Tables[2];
                gpHawb.GetStore().DataBind();
                RowSelectionModel sm = gpHawb.GetSelectionModel() as RowSelectionModel;
                sm.SelectRow(0);
                sm.SelectedRows.Add(new SelectedRow(0));
            }
        }
        else
        {
            if (ds.Tables[1].Rows.Count > 0)
            {
                txtHAWB.Text = ds.Tables[1].Rows[0]["wbm_HAWB"].ToString();
                txtPKG.Text  = ds.Tables[1].Rows[0]["wbm_RCP"].ToString();
                txtWT.Text   = ds.Tables[1].Rows[0]["wbm_WT"].ToString();
                CmbDest.SelectedItem.Value = ds.Tables[1].Rows[0]["wbm_Final"].ToString();
            }
        }
    }
Пример #7
0
    private void DataBindList()
    {
        txtMAWB.Focus(true);

        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "GetAEColoaderDirect")
                    .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text)
                    .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("air_SYS", sys)
                    );
        DataSet ds = GetDs("FW_AirExport_CoLoaderDirect_SP", Getlist);

        if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != "0" && hidSeed.Text != "")
        {
            labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();
            hidLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();

            txtMAWB.Text = ds.Tables[0].Rows[0]["MAWB"].ToString();
            //CmbDeparture.setValue(ds.Tables[0].Rows[0]["Departure"].ToString());
            //CmbFinalDest.setValue(ds.Tables[0].Rows[0]["Destination"].ToString());

            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString());

            CmbColoader.setValue(ds.Tables[0].Rows[0]["CoLoader"].ToString());
            CmbColoader.Text = ds.Tables[0].Rows[0]["CoLoaderName"].ToString();
            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text        = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();
            CmbNP.SelectedItem.Value = ds.Tables[0].Rows[0]["NP"].ToString();

            CmbCarrierRight.setValue(ds.Tables[0].Rows[0]["Carrier"].ToString());
            txtFlightRight.Text = ds.Tables[0].Rows[0]["FlightNo"].ToString();
            CmbFromRight.setValue(ds.Tables[0].Rows[0]["From"].ToString());
            CmbToRight.setValue(ds.Tables[0].Rows[0]["To"].ToString());
            txtETD.Text        = ds.Tables[0].Rows[0]["ETD"].ToString();
            txtETA.Text        = ds.Tables[0].Rows[0]["ETA"].ToString();
            txtATD.Text        = ds.Tables[0].Rows[0]["ATD"].ToString();
            txtATA.Text        = ds.Tables[0].Rows[0]["ATA"].ToString();
            txtMAWBRemark.Text = ds.Tables[0].Rows[0]["air_Remark"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Rate"].ToString()))
            {
                txtRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString();
            }

            bool ismakeMawb = ds.Tables[0].Rows[0]["air_MakeMAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeMAWB"]);
            if (ismakeMawb == true)
            {
                txtGWT.Disabled   = true;
                txtVWT.Disabled   = true;
                txtCWT.Disabled   = true;
                txtPiece.Disabled = true;
                isMawbFlag.Style.Add("display", "none");
            }
            else
            {
                txtGWT.Disabled   = false;
                txtVWT.Disabled   = false;
                txtCWT.Disabled   = false;
                txtPiece.Disabled = false;
                isMawbFlag.Style.Add("display", "block");
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                GridFlightList.GetStore().DataSource = ds.Tables[1];
                GridFlightList.GetStore().DataBind();
            }


            if (ds.Tables[2].Rows.Count > 0)
            {
                gpInvoice.GetStore().DataSource = ds.Tables[2];
                gpInvoice.GetStore().DataBind();
            }


            if (ControlBinder.IsDisplayLotNo(txtETD.Text.Trim(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }

            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnNext.Disabled     = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                btnUpdateLotNo.Hide();
            }

            ControlBinder.pageTitleMsg(false, "AE-M:" + hidLotNo.Text, "<p>Status :  Edit MAWB of  <span>" + hidLotNo.Text + "</span></p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "AE-M New", "<p>Status :  New Blank MAWB </p>", div_bottom);
        }
    }
Пример #8
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        if (string.IsNullOrEmpty(CmbShipperCode.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Shipper can't be empty!</p>";
            CmbShipperCode.Focus();
            return;
        }
        if (string.IsNullOrEmpty(CmbConsignee.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Consignee can't be empty!</p>";
            CmbConsignee.Focus();
            return;
        }
        if (GridFlightList.Store.Count == 0)
        {
            div_bottom.Html = "<p class='error'> Save failed, Flight Routing is no data!</p>";
            l_flightno.Focus();
            return;
        }

        List <IFields> UpdateHAWB = new List <IFields>();

        UpdateHAWB.Add(dal.CreateIFields().Append("Option", "Update")
                       .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text)

                       .Append("air_MAWB", txtMAWB.Text.Trim().Replace(" ", "").ToUpper())
                       .Append("air_LotNo", hidLotNo.Text)
                       //.Append("air_LocReceived",CmbDeparture.Value)
                       //.Append("air_LocFinal", CmbFinalDest.Value)

                       .Append("air_Sales", CmbSalesman.Value)
                       .Append("air_Shipper", CmbShipperCode.Value)
                       .Append("air_Consignee", CmbConsignee.Value)

                       .Append("air_Carrier", CmbCarrierRight.Value)
                       .Append("air_Flight", txtFlightRight.Text.ToUpper())
                       .Append("air_LocLoad", CmbFromRight.Value)
                       .Append("air_LocDischarge", CmbToRight.Value)
                       .Append("air_ETD", ControlBinder.getDate(txtETD.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtETD.RawText.Trim()))
                       .Append("air_ETA", ControlBinder.getDate(txtETA.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtETA.RawText.Trim()))
                       .Append("air_ATD", ControlBinder.getDate(txtATD.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtATD.RawText.Trim()))
                       .Append("air_ATA", ControlBinder.getDate(txtATA.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtATA.RawText.Trim()))

                       .Append("air_GWT", string.IsNullOrEmpty(txtGWT.Text) ? DBNull.Value : (object)txtGWT.Text)
                       .Append("air_VWT", string.IsNullOrEmpty(txtVWT.Text) ? DBNull.Value : (object)txtVWT.Text)
                       .Append("air_CWT", string.IsNullOrEmpty(txtCWT.Text) ? DBNull.Value : (object)txtCWT.Text)
                       .Append("air_Piece", string.IsNullOrEmpty(txtPiece.Text) ? DBNull.Value : (object)txtPiece.Text)
                       .Append("air_Pallet", string.IsNullOrEmpty(txtPallet.Text) ? DBNull.Value : (object)txtPallet.Text)
                       .Append("air_Rate", string.IsNullOrEmpty(txtRate.Text) ? DBNull.Value : (object)txtRate.Text)
                       .Append("air_Remark", txtRemark.Text.Trim())
                       .Append("air_OperationRemark", txtOperation.Text.Trim())
                       .Append("air_AccountRemark", txtAccount.Text.Trim())

                       .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys)
                       .Append("code1", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys + "SN")
                       .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                       .Append("air_SYS", sys)
                       .Append("type", typename)
                       .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                       );
        try
        {
            DataSet ds = GetDs("FW_AirExport_DirectMAWB_SP", UpdateHAWB);
            hidSeed.Text = ds.Tables[0].Rows[0][0].ToString();
            string newFlag = ds.Tables[0].Rows[0][1].ToString();
            hidLotNo.Text = ds.Tables[0].Rows[0][2].ToString();

            #region FlightRouting
            var            ShipmentRoute = JSON.Deserialize <List <ShipmentRoute> >(e.ExtraParams["p_safety_l"]);
            List <IFields> Routelist     = new List <IFields>();
            string         RouteID       = "";
            for (int i = 0; i < ShipmentRoute.Count; ++i)
            {
                Routelist.Add(dal.CreateIFields().Append("Option", "Update").
                              Append("sr_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString()).
                              Append("sr_ToMaster", hidSeed.Text).
                              Append("sr_ShipKind", "FREIGHT").
                              Append("sr_Carrier", ShipmentRoute[i].Carrier).
                              Append("sr_OrderID", i).
                              Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).
                              Append("sr_Flight", ShipmentRoute[i].FlightNo.ToUpper()).
                              Append("sr_From", ShipmentRoute[i].From).
                              Append("sr_To", ShipmentRoute[i].To).
                              Append("sr_ETD", ControlBinder.getDate(ShipmentRoute[i].ETD.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ETD)).
                              Append("sr_ETA", ControlBinder.getDate(ShipmentRoute[i].ETA.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ETA)).
                              Append("sr_ATD", ControlBinder.getDate(ShipmentRoute[i].ATD.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ATD)).
                              Append("sr_ATA", ControlBinder.getDate(ShipmentRoute[i].ATA.ToString().StartsWith("0001") ? DBNull.Value : (object)ShipmentRoute[i].ATA)).
                              Append("sr_ROWID", ShipmentRoute[i].RowID));
                RouteID += "," + ShipmentRoute[i].RowID;
            }
            if (RouteID.Length > 1)
            {
                RouteID = RouteID.Substring(1, RouteID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentRoute_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "Delete").Append("sr_ToMaster", hidSeed.Text).Append("str", RouteID)
            }).Update();
            bool b = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentRoute_SP", Routelist).Update();
            #endregion

            #region LocalInvoice
            //var InvocieList = JSON.Deserialize<List<Invocie>>(e.ExtraParams["p_safety_2"]);
            //string InvoiceID = "";
            //for (int i = 0; i < InvocieList.Count; ++i)
            //{
            //    InvoiceID += "," + InvocieList[i].RowID;
            //}
            //if (InvoiceID.Length > 1)
            //{
            //    InvoiceID = InvoiceID.Substring(1, InvoiceID.Length - 1);
            //}
            //bool inv = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_DirectMAWB_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "DeleteInvoice")
            //.Append("air_ToMAWB",hidSeed.Text)
            //.Append("str",InvoiceID)}).Update();
            #endregion

            //X.AddScript("saveCost('" + hidSeed.Text + "');");

            ucCost.costseed = hidSeed.Text;
            ucCost.btnCostEvent(sender, e);

            #region Foreign
            var            Foreign     = JSON.Deserialize <List <Foreign> >(e.ExtraParams["p_safety_4"]);
            List <IFields> Foreignlist = new List <IFields>();
            string         ForeignID   = "";
            for (int i = 0; i < Foreign.Count; ++i)
            {
                if (Foreign[i].CompanyCode.Trim() != "" && Foreign[i].Item.Trim() != "" && Foreign[i].CalcKind.Trim() != "")
                {
                    Foreignlist.Add(dal.CreateIFields().Append("Option", "UpdateForeign").
                                    Append("si_BillTo", Foreign[i].CompanyCode.Trim().ToUpper()).
                                    Append("si_Total", string.IsNullOrEmpty(Foreign[i].Total) ? DBNull.Value : (object)Foreign[i].Total).
                                    Append("si_Item", Foreign[i].Item.Trim().ToUpper()).
                                    Append("si_Description", Foreign[i].Description).
                                    Append("si_QtyKind", Foreign[i].CalcKind.Trim().ToUpper()).
                                    //Append("si_Currency", CmbForeign.SelectedItem.Value == null ? "USD" : CmbForeign.SelectedItem.Value).
                                    Append("si_Currency", string.IsNullOrEmpty(Foreign[i].Currency) ? "USD" : (object)Foreign[i].Currency).
                                    Append("si_Quantity", string.IsNullOrEmpty(txtCWT.Text) ? null : (object)txtCWT.Text).
                                    Append("si_Unit", Foreign[i].Unit).
                                    Append("si_ExRate", string.IsNullOrEmpty(Foreign[i].EX) ? DBNull.Value : (object)Foreign[i].EX).
                                    Append("si_Rate", string.IsNullOrEmpty(Foreign[i].Rate) ? DBNull.Value : (object)Foreign[i].Rate).
                                    Append("si_Amount", string.IsNullOrEmpty(Foreign[i].Amount) ? DBNull.Value : (object)Foreign[i].Amount).
                                    Append("si_Min", string.IsNullOrEmpty(Foreign[i].Min) ? DBNull.Value : (object)Foreign[i].Min).
                                    Append("si_ShowIn", Foreign[i].Show.Trim().ToUpper())
                                    .Append("si_ROWID", Foreign[i].RowID)
                                    .Append("si_ToMaster", hidSeed.Text)
                                    .Append("si_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                    .Append("si_Sys", sys)
                                    .Append("si_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                    );
                    ForeignID += "," + Foreign[i].RowID;
                }
            }
            //delete
            if (ForeignID.Length > 1)
            {
                ForeignID = ForeignID.Substring(1, ForeignID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActualForeign").Append("si_Seed", hidSeed.Text).Append("str", ForeignID)
            }).Update();
            bool resultForeign = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", Foreignlist).Update();
            #endregion

            #region Foreign Freight
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "UpdateForFreight").Append("si_ROWID", string.IsNullOrEmpty(hidForeignID.Text) ? null : (object)hidForeignID.Text)
                .Append("si_User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).Append("si_Sys", sys).Append("si_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString()).Append("si_ToMaster", hidSeed.Text)
                .Append("si_BillTo", CmbCompany.Value).Append("si_Min", string.IsNullOrEmpty(txtFor.Text) ? "0" : (object)txtFor.Text).Append("si_Currency", CmbForeign.SelectedItem.Value == null ? "USD" : CmbForeign.SelectedItem.Value).Append("si_Quantity", string.IsNullOrEmpty(txtCWT.Text) ? null : (object)txtCWT.Text).Append("si_Unit", "")
            }).Update();
            #endregion

            #region Local
            var            Local     = JSON.Deserialize <List <Local> >(e.ExtraParams["p_safety_5"]);
            List <IFields> Locallist = new List <IFields>();
            string         LocalID   = "";
            for (int i = 0; i < Local.Count; ++i)
            {
                if (Local[i].CompanyCode.Trim() != "" && Local[i].Item.Trim() != "" && Local[i].CalcKind.Trim() != "")
                {
                    Locallist.Add(dal.CreateIFields().Append("Option", "UpdateLocal").
                                  Append("si_BillTo", Local[i].CompanyCode.Trim().ToUpper()).
                                  Append("si_Total", string.IsNullOrEmpty(Local[i].Total) ? DBNull.Value : (object)Local[i].Total).
                                  Append("si_Item", Local[i].Item.Trim().ToUpper()).
                                  Append("si_Description", Local[i].Description).
                                  Append("si_QtyKind", Local[i].CalcKind.Trim().ToUpper()).
                                  Append("si_Currency", CmbLocal.SelectedItem.Value == null ? "HKD" : CmbLocal.SelectedItem.Value).
                                  Append("si_Quantity", string.IsNullOrEmpty(txtCWT.Text) ? null : (object)txtCWT.Text).
                                  Append("si_Unit", Local[i].Unit).
                                  Append("si_ExRate", string.IsNullOrEmpty(Local[i].EX) ? DBNull.Value : (object)Local[i].EX).
                                  Append("si_Rate", string.IsNullOrEmpty(Local[i].Rate) ? DBNull.Value : (object)Local[i].Rate).
                                  Append("si_Amount", string.IsNullOrEmpty(Local[i].Amount) ? DBNull.Value : (object)Local[i].Amount).
                                  Append("si_Min", string.IsNullOrEmpty(Local[i].Min) ? DBNull.Value : (object)Local[i].Min).
                                  Append("si_ShowIn", Local[i].Show.Trim().ToUpper())
                                  .Append("si_ROWID", Local[i].RowID)
                                  .Append("si_ToMaster", hidSeed.Text)
                                  .Append("si_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                  .Append("si_Sys", sys)
                                  .Append("si_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                  );
                    LocalID += "," + Local[i].RowID;
                }
            }
            //delete
            if (LocalID.Length > 1)
            {
                LocalID = LocalID.Substring(1, LocalID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActualLocal").Append("si_Seed", hidSeed.Text).Append("str", LocalID)
            }).Update();
            bool resultLocal = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", Locallist).Update();
            #endregion

            #region Local Freight
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "UpdateLocFreight").Append("si_ROWID", string.IsNullOrEmpty(hidLocalID.Text) ? null : (object)hidLocalID.Text)
                .Append("si_User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).Append("si_Sys", sys).Append("si_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString()).Append("si_ToMaster", hidSeed.Text)
                .Append("si_BillTo", CmbCompany1.Value).Append("si_Min", string.IsNullOrEmpty(txtLoc.Text) ? "0" : (object)txtLoc.Text).Append("si_Currency", CmbLocal.SelectedItem.Value == null ? "HKD" : CmbLocal.SelectedItem.Value).Append("si_Quantity", string.IsNullOrEmpty(txtCWT.Text) ? null : (object)txtCWT.Text).Append("si_Unit", "")
            }).Update();
            #endregion

            #region WTForeign
            var            WTForeign     = JSON.Deserialize <List <WTForeign> >(e.ExtraParams["p_safety_6"]);
            List <IFields> WTForeignlist = new List <IFields>();
            string         WTForeignID   = "";
            for (int i = 0; i < WTForeign.Count; ++i)
            {
                if (WTForeign[i].Rate != null)
                {
                    WTForeignlist.Add(dal.CreateIFields().Append("Option", "UpdateSellRateForeign").
                                      Append("aer_Weight", string.IsNullOrEmpty(WTForeign[i].WT) ? "0.000" : (object)WTForeign[i].WT).
                                      Append("aer_Rate", string.IsNullOrEmpty(WTForeign[i].Rate) ? DBNull.Value : (object)WTForeign[i].Rate)
                                      .Append("aer_ROWID", WTForeign[i].RowID)
                                      .Append("aer_Seed", hidSeed.Text)
                                      .Append("aer_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                      .Append("aer_Sys", sys)
                                      .Append("aer_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                      );
                    WTForeignID += "," + WTForeign[i].RowID;
                }
            }
            //delete
            if (WTForeignID.Length > 1)
            {
                WTForeignID = WTForeignID.Substring(1, WTForeignID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActualSellRateForeign").Append("aer_Seed", hidSeed.Text).Append("str", WTForeignID)
            }).Update();
            bool resultWTForeign = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", WTForeignlist).Update();
            #endregion

            #region WTLocal
            var            WTLocal     = JSON.Deserialize <List <WTLocal> >(e.ExtraParams["p_safety_7"]);
            List <IFields> WTLocallist = new List <IFields>();
            string         WTLocalID   = "";
            for (int i = 0; i < WTLocal.Count; ++i)
            {
                if (WTLocal[i].Rate != null)
                {
                    WTLocallist.Add(dal.CreateIFields().Append("Option", "UpdateSellRateLocal").
                                    Append("aer_Weight", string.IsNullOrEmpty(WTLocal[i].WT) ? "0.000" : (object)WTLocal[i].WT).
                                    Append("aer_Rate", string.IsNullOrEmpty(WTLocal[i].Rate) ? DBNull.Value : (object)WTLocal[i].Rate)
                                    .Append("aer_ROWID", WTLocal[i].RowID)
                                    .Append("aer_Seed", hidSeed.Text)
                                    .Append("aer_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                    .Append("aer_Sys", sys)
                                    .Append("aer_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                    );
                    WTLocalID += "," + WTLocal[i].RowID;
                }
            }
            //delete
            if (WTLocalID.Length > 1)
            {
                WTLocalID = WTLocalID.Substring(1, WTLocalID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActualSellRateLocal").Append("aer_Seed", hidSeed.Text).Append("str", WTLocalID)
            }).Update();
            bool resultWTLocal = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ShipmentItemForDirectMAWB_SP", WTLocallist).Update();
            #endregion

            #region updateFreightTotal
            string type1 = "N", type2 = "N";
            if (CmbCompany.Value != "")
            {
                type1 = "Y";
            }
            if (CmbCompany1.Value != "")
            {
                type2 = "Y";
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_CoLoaderInFreight_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "UpdateTotal").Append("air_Seed", hidSeed.Text).Append("CWT", string.IsNullOrEmpty(txtCWT.Text) ? "0" : txtCWT.Text)
                .Append("Type1", type1).Append("Type2", type2).Append("F_Min", string.IsNullOrEmpty(txtFor.Text) ? "0" : txtFor.Text).Append("L_Min", string.IsNullOrEmpty(txtLoc.Text) ? "0" : txtLoc.Text).Append("M", "Y")
            }).Update();
            #endregion

            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "AE", "MAWB");

            if (newFlag == "N")
            {
                //---
                DataBindList();
                X.AddScript("if(window.opener!=null){if(typeof(window.opener.RefreshList)!='undefined'){window.opener.RefreshList();}}");
                ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p class=\"success\">Status : Save successfully ! </p>", div_bottom);
            }
        }
        catch
        {
            ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p class=\"error\">Status : Save failed, please check the data !</p>", div_bottom);
        }
    }
Пример #9
0
    private void DataBindList()
    {
        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "GetAEDirectMAWB")
                    .Append("air_Seed", hidSeed.Text == "" ? null : hidSeed.Text)
                    .Append("str", hidIDList.Text)
                    .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("air_SYS", sys)
                    );
        DataSet ds = GetDs("FW_AirExport_DirectMAWB_SP", Getlist);

        if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != null && hidSeed.Text != "")
        {
            labLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();
            if (labLotNo.Text != "")
            {
                labLot.Text = "Lot# ";
            }
            hidLotNo.Text = ds.Tables[0].Rows[0]["LotNo"].ToString();

            txtMAWB.Text = ds.Tables[0].Rows[0]["MAWB"].ToString();

            CmbSalesman.setValue(ds.Tables[0].Rows[0]["air_Sales"].ToString());

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();

            CmbCarrierRight.setValue(ds.Tables[0].Rows[0]["Carrier"].ToString());
            txtFlightRight.Text = ds.Tables[0].Rows[0]["FlightNo"].ToString();
            CmbFromRight.setValue(ds.Tables[0].Rows[0]["From"].ToString());
            CmbToRight.setValue(ds.Tables[0].Rows[0]["To"].ToString());
            txtETD.Text = ds.Tables[0].Rows[0]["ETD"].ToString();
            txtETA.Text = ds.Tables[0].Rows[0]["ETA"].ToString();
            txtATD.Text = ds.Tables[0].Rows[0]["ATD"].ToString();
            txtATA.Text = ds.Tables[0].Rows[0]["ATA"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Rate"].ToString()))
            {
                txtRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString();
            }

            txtRemark.Text    = ds.Tables[0].Rows[0]["air_Remark"].ToString();
            txtAccount.Text   = ds.Tables[0].Rows[0]["air_AccountRemark"].ToString();
            txtOperation.Text = ds.Tables[0].Rows[0]["air_OperationRemark"].ToString();

            bool ismakeMawb = ds.Tables[0].Rows[0]["air_MakeMAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeMAWB"]);

            string flag = "N";
            if (ismakeMawb)
            {
                flag = "Y";
            }
            X.AddScript("isMawbFlag='" + flag + "';");


            if (ds.Tables[1].Rows.Count > 0)
            {
                GridFlightList.GetStore().DataSource = ds.Tables[1];
                GridFlightList.GetStore().DataBind();
            }

            if (ds.Tables[2].Rows.Count > 0)
            {
                gpInvoice.GetStore().DataSource = ds.Tables[2];
                gpInvoice.GetStore().DataBind();
            }



            if (ds.Tables[4].Rows.Count > 0)
            {
                lblCurForeign.Text            = ds.Tables[4].Rows[0]["Currency"].ToString();
                CmbForeign.SelectedItem.Value = ds.Tables[4].Rows[0]["Currency"].ToString();
                gpForeign.GetStore().DataSource = ds.Tables[4];
                gpForeign.GetStore().DataBind();
            }

            if (ds.Tables[5].Rows.Count > 0)
            {
                hidForeignID.Text = ds.Tables[5].Rows[0]["RowID"].ToString();
                CmbCompany.setValue(ds.Tables[5].Rows[0]["CompanyCode"].ToString());
                CmbCompany.Text = ds.Tables[5].Rows[0]["CompanyName"].ToString();
                txtFor.Text     = ds.Tables[5].Rows[0]["Min"].ToString();
            }
            if (ds.Tables[6].Rows.Count > 0)
            {
                lblCurLocal.Text            = ds.Tables[6].Rows[0]["Currency"].ToString();
                CmbLocal.SelectedItem.Value = ds.Tables[6].Rows[0]["Currency"].ToString();
                gpLocal.GetStore().DataSource = ds.Tables[6];
                gpLocal.GetStore().DataBind();
            }
            if (ds.Tables[7].Rows.Count > 0)
            {
                hidLocalID.Text = ds.Tables[7].Rows[0]["RowID"].ToString();
                CmbCompany1.setValue(ds.Tables[7].Rows[0]["CompanyCode"].ToString());
                CmbCompany1.Text = ds.Tables[7].Rows[0]["CompanyName"].ToString();
                txtLoc.Text      = ds.Tables[7].Rows[0]["Min"].ToString();
            }
            if (ds.Tables[8].Rows.Count > 0)
            {
                gpWTForeign.GetStore().DataSource = ds.Tables[8];
                gpWTForeign.GetStore().DataBind();
            }
            if (ds.Tables[9].Rows.Count > 0)
            {
                gpWTLocal.GetStore().DataSource = ds.Tables[9];
                gpWTLocal.GetStore().DataBind();
            }

            if (ds.Tables.Count > 10)
            {
                l_from.setValue(ds.Tables[10].Rows[0]["From"].ToString());
                l_to.setValue(ds.Tables[10].Rows[0]["To"].ToString());
                l_etd.Text = ds.Tables[10].Rows[0]["ETD"].ToString();
                l_eta.Text = ds.Tables[10].Rows[0]["ETA"].ToString();
            }

            if (hidLotNo.Text != "")
            {
                if (ControlBinder.IsDisplayLotNo(txtETD.Text.Trim(), hidLotNo.Text))
                {
                    btnUpdateLotNo.Show();
                }
                else
                {
                    btnUpdateLotNo.Hide();
                }
            }

            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
                if (labLotNo.Text != "")
                {
                    X.AddScript("$('#showGenerate').show();");
                }
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnRevert.Disabled   = true;
                X.AddScript("$('#showGenerate').hide();");
                btnVoid.Text = "Active";
                hidVoid.Text = "1";
                btnUpdateLotNo.Hide();
            }
            ControlBinder.pageTitleMsg(false, showname + ":" + hidLotNo.Text, "<p>Status :  Edit  No. of  <span>" + hidLotNo.Text + "</span></p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, showname, "<p>Status :  New Blank  No. </p>", div_bottom);
        }
    }
Пример #10
0
    /// <summary>
    /// 初始数据
    /// </summary>
    #region  初始数据   DataBinder()   Author:Micro  (2011-09-05)
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Other_Domestic_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "GetList").Append("tri_Seed", hidSeed.Text)
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            labLotNo.Text = ds.Tables[0].Rows[0]["tri_LotNo"].ToString();
            hidLotNo.Text = ds.Tables[0].Rows[0]["tri_LotNo"].ToString();
            txtMAWB.Text  = ds.Tables[0].Rows[0]["tri_MBL"].ToString();
            txtHAWB.Text  = ds.Tables[0].Rows[0]["tri_HBL"].ToString();

            if (ds.Tables[0].Rows[0]["tri_VesselID"].ToString() == "0" || ds.Tables[0].Rows[0]["tri_VesselID"].ToString() == "")
            {
                cmbVesselCode.SelectedItem.Value = ds.Tables[0].Rows[0]["tri_Vessel"].ToString();
                cmbVesselText.SelectedItem.Value = ds.Tables[0].Rows[0]["tri_Voyage"].ToString();
            }
            else
            {
                cmbVesselCode.SelectedItem.Value = ds.Tables[0].Rows[0]["tri_VesselID"].ToString();
                StoreVoyage.RemoveAll();

                DataTable dt1 = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ComboBoxBinder_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "VoyageList").
                    Append("sys", FSecurityHelper.CurrentUserDataGET()[12]).
                    Append("STAT", cmbVesselCode.Text)
                }).GetTable();
                StoreVoyage.DataSource = dt1;
                StoreVoyage.DataBind();
                if (ds.Tables[0].Rows[0]["tri_VoyageID"].ToString() == "0" || ds.Tables[0].Rows[0]["tri_VoyageID"].ToString() == "")
                {
                    cmbVesselText.SelectedItem.Value = ds.Tables[0].Rows[0]["tri_Voyage"].ToString();
                }
                else if (dt1 != null && dt1.Rows.Count > 0)
                {
                    cmbVesselText.SelectedItem.Value = ds.Tables[0].Rows[0]["tri_VoyageID"].ToString();
                }
            }


            CmbDeparture.setValue(ds.Tables[0].Rows[0]["tri_LocReceived"].ToString());
            CmbDest.setValue(ds.Tables[0].Rows[0]["tri_LocFinal"].ToString());
            txtDepartDate.Text  = ds.Tables[0].Rows[0]["tri_ETD"].ToString();
            txtDepL.Text        = ds.Tables[0].Rows[0]["tri_LocReceivedL"].ToString();
            txtDesL.Text        = ds.Tables[0].Rows[0]["tri_LocFinalL"].ToString();
            txtArrivalDate.Text = ds.Tables[0].Rows[0]["tri_ETA"].ToString();
            txtJob.Text         = ds.Tables[0].Rows[0]["tri_EReceipt"].ToString();
            txtMAWBRemark.Text  = ds.Tables[0].Rows[0]["tri_Remark"].ToString();
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["tri_Sales"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_Container"].ToString()))
            {
                txtContainer.Text = ds.Tables[0].Rows[0]["tri_Container"].ToString();
            }

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["tri_GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_CBM"].ToString()))
            {
                txtCBM.Text = ds.Tables[0].Rows[0]["tri_CBM"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["tri_CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["tri_Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["tri_Unit"].ToString());

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["tri_Shipper"].ToString());
            CmbShipperCode1.Text     = ds.Tables[0].Rows[0]["tri_Shipper"].ToString();
            CmbShipperCode_name.Text = ds.Tables[0].Rows[0]["tri_ShipperLine"].ToString();

            CmbConsigneeCode.setValue(ds.Tables[0].Rows[0]["tri_Consignee"].ToString());
            CmbConsigneeCode1.Text     = ds.Tables[0].Rows[0]["tri_Consignee"].ToString();
            CmbConsigneeCode_name.Text = ds.Tables[0].Rows[0]["tri_ConsigneeLine"].ToString();

            CmbNotify1Code.setValue(ds.Tables[0].Rows[0]["tri_PartyA"].ToString());
            CmbNotify1Code1.Text     = ds.Tables[0].Rows[0]["tri_PartyA"].ToString();
            CmbNotify1Code_name.Text = ds.Tables[0].Rows[0]["tri_PartyALine"].ToString();

            CmbNotify2Code.setValue(ds.Tables[0].Rows[0]["tri_PartyB"].ToString());
            CmbNotify2Code1.Text     = ds.Tables[0].Rows[0]["tri_PartyB"].ToString();
            CmbNotify2Code_name.Text = ds.Tables[0].Rows[0]["tri_PartyBLine"].ToString();

            CmbCarrierCode.setValue(ds.Tables[0].Rows[0]["tri_Carrier"].ToString());
            CmbCarrierCode1.Text     = ds.Tables[0].Rows[0]["tri_Carrier"].ToString();
            CmbCarrierCode_name.Text = ds.Tables[0].Rows[0]["tri_CarrierLine"].ToString();

            CmbCoLoader.setValue(ds.Tables[0].Rows[0]["tri_CoLoader"].ToString());
            CmbCoLoader1.Text     = ds.Tables[0].Rows[0]["tri_CoLoader"].ToString();
            CmbCoLoader_name.Text = ds.Tables[0].Rows[0]["tri_CoLoaderLine"].ToString();


            if (ControlBinder.IsDisplayLotNo(txtJob.Text.Trim(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }

            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnNext.Disabled     = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                btnUpdateLotNo.Hide();
            }

            gridInvoice.GetStore().DataSource = ds.Tables[1];
            gridInvoice.GetStore().DataBind();



            ControlBinder.pageTitleMsg(false, "Domestic Shipment:" + ds.Tables[0].Rows[0]["tri_LotNo"].ToString(), "<p>Status :  Edit  Domestic Shipment  of <span>" + ds.Tables[0].Rows[0]["tri_LotNo"].ToString() + "</span></p>", div_bottom);
        }
        else
        {
            txtJob.RawText         = DateTime.Now.ToString("dd/MM/yyyy");
            txtJob.Text            = DateTime.Now.ToString("yyyy/MM/dd");
            txtDepartDate.RawText  = DateTime.Now.ToString("dd/MM/yyyy");
            txtDepartDate.Text     = DateTime.Now.ToString("yyyy/MM/dd");
            txtArrivalDate.RawText = DateTime.Now.ToString("dd/MM/yyyy");
            txtArrivalDate.Text    = DateTime.Now.ToString("yyyy/MM/dd");
            //CmbUnit.setValue("CTN");
            ControlBinder.pageTitleMsg(false, "Domestic Shipment:New", "<p>Status :  New  Blank  Domestic Shipment </p>", div_bottom);
        }
    }
    private void DataBindList()
    {
        CmbUnit.setValue("PKG");

        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "List")
                    .Append("seed", hidSeed.Text)
                    .Append("o_ToMBL", Request["MBL"])
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("SYS", SYS)
                    );
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_HBL_SP", Getlist).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            txtHawb.Text = ds.Tables[0].Rows[0]["HBL"].ToString();
            CmbService.setValue(ds.Tables[0].Rows[0]["ServiceMode"]);
            CmbPPD.SelectedItem.Value = ds.Tables[0].Rows[0]["PPD"].ToString();
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"]);
            labImpLotNo.Text  = ds.Tables[0].Rows[0]["LotNo"].ToString();
            txtColoader.Text  = ds.Tables[0].Rows[0]["ColoaderHBL"].ToString();
            txtReference.Text = ds.Tables[0].Rows[0]["Reference"].ToString();
            txtClearance.Text = ds.Tables[0].Rows[0]["Clearance"].ToString();
            txtDO.Text        = ds.Tables[0].Rows[0]["DO"].ToString();

            labMBL.Text = ds.Tables[0].Rows[0]["MBL"].ToString();

            CmbReceipt.setValue(ds.Tables[0].Rows[0]["Receipt"]);
            CmbFinalDest.setValue(ds.Tables[0].Rows[0]["FinalDest"].ToString());
            chkInsurance.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Insurance"]);
            chkDG.Checked        = Convert.ToBoolean(ds.Tables[0].Rows[0]["DG"]);
            chkSurrender.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["Surrender"]);

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();

            CmbNotify1.setValue(ds.Tables[0].Rows[0]["Notify1"].ToString());
            CmbNotify1.Text = ds.Tables[0].Rows[0]["Notify1Name"].ToString();
            CmbNotify2.setValue(ds.Tables[0].Rows[0]["Notify2"].ToString());
            CmbNotify2.Text = ds.Tables[0].Rows[0]["Notify2Name"].ToString();

            CmbCoLoader.setValue(ds.Tables[0].Rows[0]["Coloader"].ToString());
            CmbCoLoader.Text = ds.Tables[0].Rows[0]["ColoaderName"].ToString();
            CmbBroker.setValue(ds.Tables[0].Rows[0]["Broker"].ToString());
            CmbBroker.Text = ds.Tables[0].Rows[0]["BrokerName"].ToString();
            //if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            //    txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            //if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            //    txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            //if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CBM"].ToString()))
            //    txtCBM.Text = ds.Tables[0].Rows[0]["CBM"].ToString();
            //if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            //    txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["AWT"].ToString()))
            {
                txtAGWT.Text = ds.Tables[0].Rows[0]["AWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CBM"].ToString()))
            {
                txtCBM.Text = ds.Tables[0].Rows[0]["CBM"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ACBM"].ToString()))
            {
                txtACBM.Text = ds.Tables[0].Rows[0]["ACBM"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["PKGS"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["PKGS"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["APKGS"].ToString()))
            {
                txtAPiece.Text = ds.Tables[0].Rows[0]["APKGS"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["WM"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["WM"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["AWM"].ToString()))
            {
                txtAWM.Text = ds.Tables[0].Rows[0]["AWM"].ToString();
            }

            CmbUnit.setValue(ds.Tables[0].Rows[0]["Unit"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Container"].ToString()))
            {
                txtContainer.Text = ds.Tables[0].Rows[0]["Container"].ToString();
            }

            CmbWarehouse.setValue(ds.Tables[0].Rows[0]["Warehouse"].ToString());
            CmbWarehouse.Text        = ds.Tables[0].Rows[0]["WarehouseName"].ToString();
            txtFreeStorageStart.Text = ds.Tables[0].Rows[0]["FreeStorageStart"].ToString();
            txtFreeStorageEnd.Text   = ds.Tables[0].Rows[0]["FreeStorageEnd"].ToString();
            txtPickUp.Text           = ds.Tables[0].Rows[0]["PickUp"].ToString();

            txtRemark.Text = ds.Tables[0].Rows[0]["Remark"].ToString();

            GridPanelInvoice.GetStore().DataSource = ds.Tables[1];
            GridPanelInvoice.GetStore().DataBind();

            GridPanelContainer.GetStore().DataSource = ds.Tables[2];
            GridPanelContainer.GetStore().DataBind();
            if (ds.Tables[2].Rows.Count > 0)
            {
                double GWT = 0.000, Pieces = 0, CBM = 0.000, wm = 0.000;
                for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
                {
                    GWT    += Convert.ToDouble(ds.Tables[2].Rows[i]["GWT"].ToString() == "" ? "0.000" : ds.Tables[2].Rows[i]["GWT"].ToString());
                    Pieces += Convert.ToDouble(ds.Tables[2].Rows[i]["PKGS"].ToString() == "" ? "0" : ds.Tables[2].Rows[i]["PKGS"].ToString());
                    CBM    += Convert.ToDouble(ds.Tables[2].Rows[i]["CBM"].ToString() == "" ? "0.000" : ds.Tables[2].Rows[i]["CBM"].ToString());
                    wm     += Convert.ToDouble(ds.Tables[2].Rows[i]["WM"].ToString() == "" ? "0.000" : ds.Tables[2].Rows[i]["WM"].ToString());
                }
                if (Pieces.ToString() != "0")
                {
                    txtAPiece.Text = Pieces.ToString();
                }
                if (GWT.ToString() != "0")
                {
                    txtAGWT.Text = GWT.ToString();
                }
                if (CBM.ToString() != "0")
                {
                    txtACBM.Text = CBM.ToString();
                }
                if (wm.ToString() != "0")
                {
                    txtAWM.Text = wm.ToString();
                }
            }

            if (Convert.ToBoolean(ds.Tables[0].Rows[0]["active"]))
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnNext.Disabled     = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                X.AddScript("$('#showContainer').hide();");
            }

            GridPanelOther.GetStore().DataSource = ds.Tables[3];
            GridPanelOther.GetStore().DataBind();



            GridPanelForeign.GetStore().DataSource = ds.Tables[5];
            GridPanelForeign.GetStore().DataBind();

            GridPanelRoute.GetStore().DataSource = ds.Tables[6];
            GridPanelRoute.GetStore().DataBind();

            GridPanelContact.GetStore().DataSource = ds.Tables[7];
            GridPanelContact.GetStore().DataBind();
        }

        if (!string.IsNullOrEmpty(Request["seed"]))
        {
            ControlBinder.pageTitleMsg(false, "OI-H:" + labImpLotNo.Text, "<p>Status : Edit HBL of  <span>" + labImpLotNo.Text + "</span>. </p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OI-H New", "<p>Status : New Blank HBL . </p>", div_bottom);
        }

        txtHawb.Focus(true);
    }
Пример #12
0
    /// <summary>
    /// 初始数据
    /// </summary>
    #region  初始数据   DataBinder()   Author:Micro  (2011-09-05)
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Triangle_Air_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "GetList").Append("tri_Seed", hidSeed.Text)
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            labLotNo.Text    = ds.Tables[0].Rows[0]["tri_LotNo"].ToString();
            hidLotNo.Text    = ds.Tables[0].Rows[0]["tri_LotNo"].ToString();
            txtMAWB.Text     = ds.Tables[0].Rows[0]["tri_MBL"].ToString();
            txtHAWB.Text     = ds.Tables[0].Rows[0]["tri_HBL"].ToString();
            txtFlightNo.Text = ds.Tables[0].Rows[0]["tri_Flight"].ToString();
            CmbDeparture.setValue(ds.Tables[0].Rows[0]["tri_LocReceived"].ToString());
            CmbDest.setValue(ds.Tables[0].Rows[0]["tri_LocFinal"].ToString());
            txtDepL.Text        = ds.Tables[0].Rows[0]["tri_LocReceivedL"].ToString();
            txtDesL.Text        = ds.Tables[0].Rows[0]["tri_LocFinalL"].ToString();
            txtDepartDate.Text  = ds.Tables[0].Rows[0]["tri_ETD"].ToString();
            txtArrivalDate.Text = ds.Tables[0].Rows[0]["tri_ETA"].ToString();
            txtJob.Text         = ds.Tables[0].Rows[0]["tri_EReceipt"].ToString();
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["tri_Sales"].ToString());
            txtMAWBRemark.Text = ds.Tables[0].Rows[0]["tri_Remark"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["tri_GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["tri_VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["tri_CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["tri_Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["tri_Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["tri_Unit"].ToString());

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["tri_Shipper"].ToString());
            CmbShipperCode1.Text     = ds.Tables[0].Rows[0]["tri_Shipper"].ToString();
            CmbShipperCode_name.Text = ds.Tables[0].Rows[0]["tri_ShipperLine"].ToString();

            CmbConsigneeCode.setValue(ds.Tables[0].Rows[0]["tri_Consignee"].ToString());
            CmbConsigneeCode1.Text     = ds.Tables[0].Rows[0]["tri_Consignee"].ToString();
            CmbConsigneeCode_name.Text = ds.Tables[0].Rows[0]["tri_ConsigneeLine"].ToString();

            CmbNotify1Code.setValue(ds.Tables[0].Rows[0]["tri_PartyA"].ToString());
            CmbNotify1Code1.Text     = ds.Tables[0].Rows[0]["tri_PartyA"].ToString();
            CmbNotify1Code_name.Text = ds.Tables[0].Rows[0]["tri_PartyALine"].ToString();

            CmbNotify2Code.setValue(ds.Tables[0].Rows[0]["tri_PartyB"].ToString());
            CmbNotify2Code1.Text     = ds.Tables[0].Rows[0]["tri_PartyB"].ToString();
            CmbNotify2Code_name.Text = ds.Tables[0].Rows[0]["tri_PartyBLine"].ToString();

            CmbCarrierCode.setValue(ds.Tables[0].Rows[0]["tri_Carrier"].ToString());
            CmbCarrierCode1.Text     = ds.Tables[0].Rows[0]["tri_Carrier"].ToString();
            CmbCarrierCode_name.Text = ds.Tables[0].Rows[0]["tri_CarrierLine"].ToString();

            CmbCoLoader.setValue(ds.Tables[0].Rows[0]["tri_CoLoader"].ToString());
            CmbCoLoader1.Text     = ds.Tables[0].Rows[0]["tri_CoLoader"].ToString();
            CmbCoLoader_name.Text = ds.Tables[0].Rows[0]["tri_CoLoaderLine"].ToString();

            if (ControlBinder.IsDisplayLotNo(txtJob.Text.Trim(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }


            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnNext.Disabled     = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                btnUpdateLotNo.Hide();
            }

            gridInvoice.GetStore().DataSource = ds.Tables[1];
            gridInvoice.GetStore().DataBind();



            ControlBinder.pageTitleMsg(false, "Air Shipment:" + ds.Tables[0].Rows[0]["tri_LotNo"].ToString(), "<p>Status :  Edit  Air Shipment  of <span>" + ds.Tables[0].Rows[0]["tri_LotNo"].ToString() + "</span></p>", div_bottom);
        }
        else
        {
            txtJob.RawText         = DateTime.Now.ToString("dd/MM/yyyy");
            txtJob.Text            = DateTime.Now.ToString("yyyy/MM/dd");
            txtDepartDate.RawText  = DateTime.Now.ToString("dd/MM/yyyy");
            txtDepartDate.Text     = DateTime.Now.ToString("yyyy/MM/dd");
            txtArrivalDate.RawText = DateTime.Now.ToString("dd/MM/yyyy");
            txtArrivalDate.Text    = DateTime.Now.ToString("yyyy/MM/dd");
            //CmbUnit.setValue("CTN");
            ControlBinder.pageTitleMsg(false, "Air Shipment:New", "<p>Status :  New  Blank  Air Shipment </p>", div_bottom);
        }
    }
Пример #13
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        if (string.IsNullOrEmpty(CmbReceipt.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, From can't be empty!</p>";
            CmbReceipt.Focus();
            return;
        }
        if (string.IsNullOrEmpty(CmbFinalDest.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, To can't be empty!</p>";
            CmbFinalDest.Focus();
            return;
        }
        if (string.IsNullOrEmpty(txtEst.RawText.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Est Receipt can't be empty!</p>";
            txtEst.Focus(true);
            return;
        }
        if (string.IsNullOrEmpty(CmbShipperCode.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Shipper can't be empty!</p>";
            CmbShipperCode.Focus();
            return;
        }
        if (string.IsNullOrEmpty(CmbConsignee.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Consignee can't be empty!</p>";
            CmbConsignee.Focus();
            return;
        }
        if (string.IsNullOrEmpty(CmbSalesman.Value.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Salesman can't be empty!</p>";
            CmbSalesman.Focus();
            return;
        }
        if (string.IsNullOrEmpty(txtPiece.Text.Trim()))
        {
            div_bottom.Html = "<p class='error'> Save failed, Piece(s) can't be empty!</p>";
            txtPiece.Focus(true);
            return;
        }

        List <IFields> UpdateHAWB = new List <IFields>();

        UpdateHAWB.Add(dal.CreateIFields().Append("Option", "Update")
                       .Append("air_Seed", hidSeed.Text == ""?null:hidSeed.Text)
                       .Append("air_ToMAWB", hidMAWB.Text == ""?null:hidMAWB.Text)

                       .Append("air_HAWB", txtHawb.Text.Trim().ToUpper())
                       .Append("air_CompanyReferance", txtReference.Text.Trim().ToUpper())
                       .Append("air_SpecicalDeal", chkSpecial.Checked ? "Y" : "N")
                       .Append("air_LocReceived", CmbReceipt.Value)
                       .Append("air_LocFinal", CmbFinalDest.Value)
                       .Append("air_EReceipt", ControlBinder.getDate(txtEst.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtEst.RawText.Trim()))
                       .Append("air_AReceipt", ControlBinder.getDate(txtAct.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtAct.RawText.Trim()))

                       .Append("air_Sales", CmbSalesman.Value)
                       //.Append("air_CSMode",txtCS.Text)
                       .Append("air_NP", CmbNP.SelectedItem.Value)

                       .Append("air_Shipper", CmbShipperCode.Value)
                       //.Append("air_Shipper", CmbShipperName.SelectedItem.Value)
                       .Append("air_Consignee", CmbConsignee.Value)
                       //.Append("air_Consignee", CmbConsigneeName.SelectedItem.Value)

                       .Append("air_PartyA", CmbNotify1.Value)
                       //.Append("air_PartyA", CmbNotify1Name.SelectedItem.Value)
                       .Append("air_PartyB", CmbNotify2.Value)
                       //.Append("air_PartyB", CmbNotify2Name.SelectedItem.Value)

                       .Append("air_GWT", string.IsNullOrEmpty(txtGWT.Text) ? DBNull.Value : (object)txtGWT.Text)
                       .Append("air_VWT", string.IsNullOrEmpty(txtVWT.Text) ? DBNull.Value : (object)txtVWT.Text)
                       .Append("air_CWT", string.IsNullOrEmpty(txtCWT.Text) ? DBNull.Value : (object)txtCWT.Text)
                       .Append("air_Piece", string.IsNullOrEmpty(txtPiece.Text) ? DBNull.Value : (object)txtPiece.Text)
                       .Append("air_Unit", CmbUnit.Value)
                       .Append("air_Pallet", string.IsNullOrEmpty(txtPallet.Text) ? DBNull.Value : (object)txtPallet.Text)
                       .Append("air_CBM", string.IsNullOrEmpty(txtCbf.Text) ? DBNull.Value : (object)txtCbf.Text)

                       .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys)
                       .Append("code1", FSecurityHelper.CurrentUserDataGET()[4].ToString() + sys + "SN")
                       .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                       .Append("air_SYS", sys)
                       .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                       );
        try
        {
            DataSet ds = GetDs("FW_AirExport_SubShipment_SP", UpdateHAWB);
            hidSeed.Text = ds.Tables[0].Rows[0][0].ToString();
            string newFlag = ds.Tables[0].Rows[0][1].ToString();

            #region HAWBList
            var            HAWBList  = JSON.Deserialize <List <HAWBList> >(e.ExtraParams["p_safety_2"]);
            List <IFields> HAWBLists = new List <IFields>();
            string         RowID     = "";
            for (int i = 0; i < HAWBList.Count; ++i)
            {
                HAWBLists.Add(dal.CreateIFields().Append("Option", "UpdateEmptyHAWB").
                              Append("air_ROWID", HAWBList[i].RowID)
                              .Append("air_ToHAWB", hidSeed.Text));
                RowID += "," + HAWBList[i].RowID.ToString();
            }
            bool result = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_SubShipment_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "AddSubShipmentByIDList")
                .Append("str", RowID).Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString()).Append("air_ToHAWB", hidSeed.Text)
            }).Update();
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_SubShipment_SP", HAWBLists).Update();
            #endregion

            #region Costing
            //X.AddScript("saveCost('" + hidSeed.Text + "');");

            ucCost.costseed = hidSeed.Text;
            ucCost.btnCostEvent(sender, e);
            #endregion

            #region LocalInvoice
            //var InvocieList = JSON.Deserialize<List<Invocie>>(e.ExtraParams["p_safety_invoice"]);
            //string InvoiceID = "";
            //for (int i = 0; i < InvocieList.Count; ++i)
            //{
            //    InvoiceID += "," + InvocieList[i].RowID;
            //}
            //if (InvoiceID.Length > 1)
            //{
            //    InvoiceID = InvoiceID.Substring(1, InvoiceID.Length - 1);
            //}
            //bool inv = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_SubShipment_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "DeleteInvoice")
            //.Append("air_ToHAWB",hidSeed.Text)
            //.Append("str",InvoiceID)}).Update();
            #endregion

            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "AE", "HAWB");
            if (newFlag == "N")
            {
                DataBindList();
                X.AddScript("if(window.opener!=null){if(typeof(window.opener.RefreshList)!='undefined'){window.opener.RefreshList();}}");
                ControlBinder.pageTitleMsg(false, "AE-H:" + hidLotNo.Text, "<p class=\"success\">Status : Save successfully ! </p>", div_bottom);
            }
            else
            {
                X.AddScript("if(window.opener!=null){if(typeof(window.opener.RefreshList)!='undefined'){window.opener.RefreshList();}}");
                ControlBinder.pageTitleMsg(false, "AE-H:" + hidLotNo.Text, "<p class=\"success\">Status : Save successfully ! </p>", div_bottom);
                X.Redirect("List.aspx?seed=" + ds.Tables[0].Rows[0][0] + "&MAWB=" + hidMAWB.Value);
            }
        }
        catch
        {
            ControlBinder.pageTitleMsg(false, "AE-H:" + hidLotNo.Text, "<p class=\"error\">Status : Save failed, please check the data !</p>", div_bottom);
        }
    }
Пример #14
0
    private void DataBindList()
    {
        txtHawb.Focus(true);

        List <IFields> Getlist = new List <IFields>();

        Getlist.Add(dal.CreateIFields().Append("Option", "GetSubShipment")
                    .Append("air_Seed", hidSeed.Text == ""?null:hidSeed.Text)
                    .Append("str", hidIDList.Text)
                    .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("air_SYS", sys)
                    );
        DataSet ds = GetDs("FW_AirExport_SubShipment_SP", Getlist);

        if (ds != null && ds.Tables[0].Rows.Count > 0 && hidSeed.Text != "0" && hidSeed.Text != "")
        {
            string tempmawb  = ds.Tables[0].Rows[0]["MAWB"].ToString().ToUpper() == "" ? "" : "MAWB# " + "<span style='color:#ff0000;'>" + ds.Tables[0].Rows[0]["MAWB"].ToString().ToUpper() + "</span>";
            string tempLotNo = ds.Tables[0].Rows[0]["LotNo"].ToString().ToUpper() == "" ? "" : "Lot# " + "<span style='color:#ff0000;'>" + ds.Tables[0].Rows[0]["LotNo"].ToString().ToUpper() + "</span>";
            labHeader.Html = "Book# " + "<span style='color:#ff0000;'>" + ds.Tables[0].Rows[0]["BookNo"].ToString().ToUpper() + "</span>" + (tempmawb == "" ? "" : "<span style='padding-left:10px'>" + tempmawb + "</span>") + (tempLotNo == "" ? "" : "<span style='padding-left:10px'>" + tempLotNo + "</span>");
            hidLotNo.Text  = ds.Tables[0].Rows[0]["BookNo"].ToString();


            txtHawb.Text       = ds.Tables[0].Rows[0]["HAWB"].ToString();
            txtReference.Text  = ds.Tables[0].Rows[0]["Reference"].ToString();
            chkSpecial.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["SpecicalDeal"].ToString() == "N" ? 0 : 1);
            CmbReceipt.setValue(ds.Tables[0].Rows[0]["Receipt"].ToString());
            CmbFinalDest.setValue(ds.Tables[0].Rows[0]["Destination"].ToString());
            CmbSalesman.setValue(ds.Tables[0].Rows[0]["Salesman"].ToString());
            txtEst.Text = ds.Tables[0].Rows[0]["EstReceipt"].ToString();
            txtAct.Text = ds.Tables[0].Rows[0]["ActReceipt"].ToString();
            txtCS.Text  = ds.Tables[0].Rows[0]["air_User"].ToString();
            CmbNP.SelectedItem.Value = ds.Tables[0].Rows[0]["NP"].ToString();

            CmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            CmbConsignee.setValue(ds.Tables[0].Rows[0]["Consignee"].ToString());
            CmbConsignee.Text = ds.Tables[0].Rows[0]["ConsigneeName"].ToString();

            CmbNotify1.setValue(ds.Tables[0].Rows[0]["Notify1"].ToString());
            CmbNotify1.Text = ds.Tables[0].Rows[0]["Notify1Name"].ToString();
            CmbNotify2.setValue(ds.Tables[0].Rows[0]["Notify2"].ToString());
            CmbNotify2.Text = ds.Tables[0].Rows[0]["Notify2Name"].ToString();

            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = ds.Tables[0].Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = ds.Tables[0].Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["Unit"].ToString());
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = ds.Tables[0].Rows[0]["Pallet"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["CBF"].ToString()))
            {
                txtCbf.Text = ds.Tables[0].Rows[0]["CBF"].ToString();
            }
            bool ismakehawb = ds.Tables[0].Rows[0]["air_MakeHAWB"].ToString() == "" ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["air_MakeHAWB"]);
            if (ismakehawb == true)
            {
                txtGWT.Disabled   = true;
                txtVWT.Disabled   = true;
                txtCWT.Disabled   = true;
                txtPiece.Disabled = true;
            }
            else
            {
                txtGWT.Disabled   = false;
                txtVWT.Disabled   = false;
                txtCWT.Disabled   = false;
                txtPiece.Disabled = false;
            }

            if (ds.Tables[0].Rows[0]["Active"].ToString() == "Y")
            {
                img_void.Style.Value = "display:none";
            }
            else
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnPull.Disabled     = true;
                btnNew.Disabled      = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
            }

            if (ds.Tables[1].Rows.Count > 0)
            {
                gpHAWB.GetStore().DataSource = ds.Tables[1];
                gpHAWB.GetStore().DataBind();
                double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    GWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["GWT"].ToString());
                    VWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["VWT"].ToString());
                    CWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["CWT"].ToString());
                    Pieces  += Convert.ToDouble(ds.Tables[1].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["Piece"].ToString());
                    Pallets += Convert.ToDouble(ds.Tables[1].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["Pallet"].ToString());
                }
                lblGWT.Text    = GWT.ToString("0.000");
                lblVWT.Text    = VWT.ToString("0.000");
                lblCWT.Text    = CWT.ToString("0.000");
                lblPiece.Text  = Pieces.ToString();
                lblPallet.Text = Pallets.ToString();
            }



            gpInvoice.GetStore().DataSource = ds.Tables[3];
            gpInvoice.GetStore().DataBind();

            ControlBinder.pageTitleMsg(false, "AE-H:" + hidLotNo.Text, "<p>Status :  Edit  HAWB of  <span>" + hidLotNo.Text + "</span></p>", div_bottom);
        }
        else
        {
            if (ds.Tables[1].Rows.Count > 0)
            {
                gpHAWB.GetStore().DataSource = ds.Tables[1];
                gpHAWB.GetStore().DataBind();
                double GWT = 0, VWT = 0, CWT = 0, Pieces = 0, Pallets = 0;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    GWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["GWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["GWT"].ToString());
                    VWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["VWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["VWT"].ToString());
                    CWT     += Convert.ToDouble(ds.Tables[1].Rows[i]["CWT"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["CWT"].ToString());
                    Pieces  += Convert.ToDouble(ds.Tables[1].Rows[i]["Piece"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["Piece"].ToString());
                    Pallets += Convert.ToDouble(ds.Tables[1].Rows[i]["Pallet"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["Pallet"].ToString());
                }
                lblGWT.Text    = GWT.ToString("0.000");
                lblVWT.Text    = VWT.ToString("0.000");
                lblCWT.Text    = CWT.ToString("0.000");
                lblPiece.Text  = Pieces.ToString();
                lblPallet.Text = Pallets.ToString();

                txtGWT.Text    = lblGWT.Text;
                txtVWT.Text    = lblVWT.Text;
                txtCWT.Text    = lblCWT.Text;
                txtPiece.Text  = lblPiece.Text;
                txtPallet.Text = lblPallet.Text;
            }
            ControlBinder.pageTitleMsg(false, "AE-H New", "<p>Status :  New Blank  HAWB </p>", div_bottom);
        }
    }
Пример #15
0
    /// <summary>
    /// 初始数据
    /// </summary>
    #region  初始数据   DataBinder()   Author:Micro  (2011-09-05)
    void DataBinder()
    {
        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Joblist_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "MAWBByID").Append("air_ROWID", hidRowID.Text)
        }).GetTable();

        if (dt != null && dt.Rows.Count > 0)
        {
            //hidRowID.Text = dt.Rows[0]["RowID"].ToString();
            labLotNo.Text     = dt.Rows[0]["LotNo"].ToString();
            hidLotNo.Text     = dt.Rows[0]["LotNo"].ToString();
            labAeLotNo.Text   = dt.Rows[0]["AeLotNo"].ToString();
            txtMawb.Text      = dt.Rows[0]["MAWB"].ToString();
            txtReference.Text = dt.Rows[0]["Reference"].ToString();
            txtClearence.Text = dt.Rows[0]["Clearance"].ToString();
            CmbCarrierCode.setValue(dt.Rows[0]["Coloader"].ToString());
            CmbCarrierCode.Text = dt.Rows[0]["ColoaderName"].ToString();
            CmbShipperCode.setValue(dt.Rows[0]["Shipper"].ToString());
            CmbShipperCode.Text = dt.Rows[0]["ShipperName"].ToString();
            CmbConsigneeCode.setValue(dt.Rows[0]["Consignee"].ToString());
            CmbConsigneeCode.Text = dt.Rows[0]["ConsigneeName"].ToString();
            CmbNotify1Code.setValue(dt.Rows[0]["Notify1"].ToString());
            CmbNotify1Code.Text = dt.Rows[0]["Notify1Name"].ToString();
            CmbNotify2Code.setValue(dt.Rows[0]["Notify2"].ToString());
            CmbNotify2Code.Text = dt.Rows[0]["Notify2Name"].ToString();
            CmbDischargeCode.setValue(dt.Rows[0]["Discharge"].ToString());
            CmbDischargeCode.Text = dt.Rows[0]["DischargeName"].ToString();
            chbDirect.Checked     = Convert.ToBoolean(dt.Rows[0]["Direct"].ToString());
            CmbSalesman.setValue(dt.Rows[0]["Salesman"].ToString());
            if (Convert.ToBoolean(dt.Rows[0]["Direct"].ToString()))
            {
                //td_sales1.Style.Value = "visibility:visible; width:210px;";
                td_sales2.Style.Value = "visibility:visible;width:70px;padding-left:0px;";
                X.AddScript("HawbShow(true);");
            }
            else
            {
                //td_sales1.Style.Value = "visibility:hidden;width:210px;";
                td_sales2.Style.Value = "visibility:hidden;width:70px;padding-left:0px;";
                X.AddScript("HawbShow(false);");
            }
            if (!string.IsNullOrEmpty(dt.Rows[0]["GWT"].ToString()))
            {
                txtGWT.Text = dt.Rows[0]["GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(dt.Rows[0]["VWT"].ToString()))
            {
                txtVWT.Text = dt.Rows[0]["VWT"].ToString();
            }
            if (!string.IsNullOrEmpty(dt.Rows[0]["CWT"].ToString()))
            {
                txtCWT.Text = dt.Rows[0]["CWT"].ToString();
            }
            if (!string.IsNullOrEmpty(dt.Rows[0]["Piece"].ToString()))
            {
                txtPiece.Text = dt.Rows[0]["Piece"].ToString();
            }
            if (!string.IsNullOrEmpty(dt.Rows[0]["Pallet"].ToString()))
            {
                txtPallet.Text = dt.Rows[0]["Pallet"].ToString();
            }
            CmbUnit.setValue(dt.Rows[0]["Unit"].ToString());
            //CmbUnit.Text=dt.Rows[0]["Unit"].ToString();
            txtRemark.Text = dt.Rows[0]["Remark"].ToString();
            txtATA.Text    = dt.Rows[0]["ATA"].ToString();
            txtATD.Text    = dt.Rows[0]["ATD"].ToString();
            txtETA.Text    = dt.Rows[0]["ETA"].ToString();
            txtETD.Text    = dt.Rows[0]["ETD"].ToString();
            CmbCarrierRight.setValue(dt.Rows[0]["Carrier"].ToString());
            txtFlightRight.Text = dt.Rows[0]["FlightNo"].ToString();
            CmbFromRight.setValue(dt.Rows[0]["From"].ToString());
            CmbToRight.setValue(dt.Rows[0]["To"].ToString());
            //CmbFromRight.Text=dt.Rows[0]["From"].ToString();
            //CmbToRight.Text=dt.Rows[0]["To"].ToString();

            if (ControlBinder.IsDisplayLotNo(txtETA.Text, labLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }

            txtVoid.Text = Convert.ToBoolean(dt.Rows[0]["Action"]) ? "1" : "0";
            if (txtVoid.Text == "0")
            {
                img_void.Style.Value = "display:inline";
                btnSave.Disabled     = true;
                btnCancel.Disabled   = true;
                btnNext.Disabled     = true;
                btnVoid.Text         = "Active";
                hidVoid.Text         = "1";
                X.AddScript("$('#showHBL').hide();");
                btnUpdateLotNo.Hide();
            }
            else
            {
                img_void.Style.Value = "display:none";
            }



            ControlBinder.pageTitleMsg(false, "AI-M:" + dt.Rows[0]["LotNo"].ToString(), "<p>Status :  Edit  MAWB  of <span>" + dt.Rows[0]["LotNo"].ToString() + "</span></p>", div_bottom);
        }
        else
        {
            //td_sales1.Style.Value = "visibility:hidden;width:210px;";
            td_sales2.Style.Value = "visibility:hidden;width:70px;padding-left:0px;";
            X.AddScript("HawbShow(false);");
            ControlBinder.pageTitleMsg(false, "AI-M:New", "<p>Status :  New  Blank  MAWB </p>", div_bottom);
        }
    }