コード例 #1
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);
        }
    }
コード例 #2
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);
        }
    }
コード例 #3
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);
        }
    }
コード例 #4
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);
        }
    }
コード例 #5
0
    void DataBinder(DataTable dt)
    {
        if (dt == null || dt.Rows.Count == 0)
        {
            ControlBinder.pageTitleMsg(false, "OE-M New", "<p>Status : New Blank  MBL . </p>", div_bottom);
            return;
        }
        labImpLotNo.Text = dt.Rows[0]["LotNo"].ToString();
        string tempmawb  = dt.Rows[0]["MBL"].ToString().ToUpper() == "" ? "" : "MBL# " + "<span style='color:#ff0000;'>" + dt.Rows[0]["MBL"].ToString().ToUpper() + "</span>";
        string tempLotNo = labImpLotNo.Text == "" ? "" : "Lot# " + "<span style='color:#ff0000;'>" + labImpLotNo.Text + "</span>";

        labHeader.Html = (tempmawb == "" ? "" : "<span>" + tempmawb + "</span>") + (tempLotNo == "" ? "" : "<span style='padding-left:10px'>" + tempLotNo + "</span>");
        txtMBL.Text    = dt.Rows[0]["MBL"].ToString();
        cmbMode.setValue(dt.Rows[0]["ServiceMode"].ToString());
        CmbGroup.SelectedItem.Value = dt.Rows[0]["o_ServiceType"].ToString();
        cmbPPD.Text = dt.Rows[0]["PPD"].ToString();
        cmbSales.setValue(dt.Rows[0]["Salesman"].ToString());
        cmbCarrierCode.setValue(dt.Rows[0]["Carrier"].ToString());
        cmbCarrierCode.Text = dt.Rows[0]["CarrierName"].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();
        cmbDischargeCode.setValue(dt.Rows[0]["Coloader"].ToString());
        cmbDischargeCode.Text = dt.Rows[0]["ColoaderName"].ToString();
        CmbNotify1.setValue(dt.Rows[0]["Notify1"].ToString());
        CmbNotify1.Text = dt.Rows[0]["Notify1Name"].ToString();
        CmbNotify2.setValue(dt.Rows[0]["Notify2"].ToString());
        CmbNotify2.Text = dt.Rows[0]["Notify2Name"].ToString();
        cmbBrokerCode.setValue(dt.Rows[0]["Broker"].ToString());
        cmbBrokerCode.Text = dt.Rows[0]["BrokerName"].ToString();
        cmbVesselCode.SelectedItem.Value = dt.Rows[0]["Vessel"].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 (dt1 != null && dt1.Rows.Count > 0)
        {
            cmbVesselText.SelectedItem.Value = dt.Rows[0]["Voyage"].ToString();
        }
        cmbLoading.setValue(dt.Rows[0]["Loading"].ToString());
        cmbPort.setValue(dt.Rows[0]["Port"].ToString());
        cmbFinalDest.setValue(dt.Rows[0]["FinalDest"].ToString());

        txtCFSClosing.Text   = dt.Rows[0]["CFS"].ToString();
        txtCYClosing.Text    = dt.Rows[0]["CY"].ToString();
        txtOnBoard.Text      = dt.Rows[0]["OnBoard"].ToString();
        txtETD.Text          = dt.Rows[0]["ETD"].ToString();
        txtETADischarge.Text = dt.Rows[0]["ETAdischarge"].ToString();
        txtETAFinal.Text     = dt.Rows[0]["ETAFinal"].ToString();
        txtATD.Text          = dt.Rows[0]["ATD"].ToString();

        #region ///pre-Carriage
        cmbpreVessel.SelectedItem.Value = dt.Rows[0]["PreVessel"].ToString();
        StorePreVoyage.RemoveAll();

        DataTable dt2 = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ComboBoxBinder_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "VoyageList").
            Append("sys", FSecurityHelper.CurrentUserDataGET()[12]).
            Append("STAT", cmbpreVessel.Text)
        }).GetTable();
        StorePreVoyage.DataSource = dt2;
        StorePreVoyage.DataBind();
        if (dt2 != null && dt2.Rows.Count > 0)
        {
            cmbpreVoyage.SelectedItem.Value = dt.Rows[0]["PreVoyage"].ToString();
        }
        txtpreonboard.Text = dt.Rows[0]["PreOnBoard"].ToString();

        #endregion

        if (!string.IsNullOrEmpty(dt.Rows[0]["GWT"].ToString()))
        {
            txtCGWT.Text = dt.Rows[0]["GWT"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["AWT"].ToString()))
        {
            txtAGWT.Text = dt.Rows[0]["AWT"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["CBM"].ToString()))
        {
            txtCCBM.Text = dt.Rows[0]["CBM"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["ACBM"].ToString()))
        {
            txtACBM.Text = dt.Rows[0]["ACBM"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["PKGS"].ToString()))
        {
            txtCPiece.Text = dt.Rows[0]["PKGS"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["APKGS"].ToString()))
        {
            txtAPiece.Text = dt.Rows[0]["APKGS"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["WM"].ToString()))
        {
            txtCWM.Text = dt.Rows[0]["WM"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["AWM"].ToString()))
        {
            txtAWM.Text = dt.Rows[0]["AWM"].ToString();
        }
        if (!string.IsNullOrEmpty(dt.Rows[0]["Container"].ToString()))
        {
            txtContainer.Text = dt.Rows[0]["Container"].ToString();
        }

        CmbUnit.setValue(dt.Rows[0]["Unit"].ToString());

        txtM_to.Value = dt.Rows[0]["M_to"].ToString();
        txtM_to.Text  = dt.Rows[0]["M_toName"].ToString();

        txtclpRemark.Text  = dt.Rows[0]["o_DeclareRemark"].ToString();
        txtAccRemark.Text  = dt.Rows[0]["o_AccountRemark"].ToString();
        txtMAWBRemark.Text = dt.Rows[0]["o_Remark"].ToString();

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

        if (dt.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;
            btnNewBooking.Disabled = true;
            btnAddBooking.Disabled = true;
            btnVoid.Text           = "Active";
            hidVoid.Text           = "1";
            btnUpdateLotNo.Hide();
        }

        hidSeed.Text = dt.Rows[0]["seed"].ToString();
        ControlBinder.pageTitleMsg(false, "OE-M:" + labImpLotNo.Text, "<p>Status : Edit  MBL  of   <span>" + dt.Rows[0]["LotNo"] + "</span>  </p>", div_bottom);
    }
コード例 #6
0
    /// <summary>
    /// 保存全部
    /// </summary>
    #region   ///Button 事件   保存全部          Author:Micro   (2011-09-27)
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        #region ///Update  OCEAN
        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_MBLList_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "UpdateMBL")
            .Append("o_Seed", hidSeed.Text.ToUpper())
            .Append("o_MBL", txtMBL.Text.ToUpper())
            .Append("o_Type", "MBL")
            .Append("o_ServiceMode", cmbMode.Value.ToUpper())
            .Append("o_PaymentMode", cmbPPD.Text.ToUpper())
            .Append("o_Sales", cmbSales.Value)
            .Append("o_ColoaderMBL", txtColoader.Text.ToUpper())
            .Append("o_LocFinal", cmbFinalDest.Text)
            .Append("o_Carrier", cmbCarrierCode.Value)
            .Append("o_VesselID", cmbVesselCode.SelectedItem.Value)
            .Append("o_VoyageID", cmbVesselText.SelectedItem.Value)
            .Append("o_ETD", ControlBinder.getDate(txtETD.RawText.StartsWith("0001")?DBNull.Value:(object)txtETD.RawText))
            .Append("OELotNo", txtOELot.Text.ToUpper())
            .Append("o_Shipper", cmbShipperCode.Value)
            .Append("o_Consignee", cmbConsigneeCode.Value)
            .Append("o_Discharge", cmbDischargeCode.Value)
            .Append("o_Broker", cmbBrokerCode.Value)
            //.Append("o_WT",string.IsNullOrEmpty(txtGWT.Text)?DBNull.Value:(object)txtGWT.Text)
            //.Append("o_CWT",string.IsNullOrEmpty(txtCWT.Text)?DBNull.Value:(object)txtCWT.Text)
            //.Append("o_CBM",string.IsNullOrEmpty(txtCBM.Text)?DBNull.Value:(object)txtCBM.Text)
            //.Append("o_PKGS",string.IsNullOrEmpty(txtPiece.Text)?DBNull.Value:(object)txtPiece.Text)
            .Append("o_CWT", string.IsNullOrEmpty(txtGWT.Text)?DBNull.Value:(object)txtGWT.Text)
            .Append("o_AWT", string.IsNullOrEmpty(txtAGWT.Text)?DBNull.Value:(object)txtAGWT.Text)
            .Append("o_CCBM", string.IsNullOrEmpty(txtCBM.Text)?DBNull.Value:(object)txtCBM.Text)
            .Append("o_ACBM", string.IsNullOrEmpty(txtACBM.Text)?DBNull.Value:(object)txtACBM.Text)
            .Append("o_CPKGS", string.IsNullOrEmpty(txtPiece.Text)?DBNull.Value:(object)txtPiece.Text)
            .Append("o_APKGS", string.IsNullOrEmpty(txtAPiece.Text)?DBNull.Value:(object)txtAPiece.Text)
            .Append("o_CWM", string.IsNullOrEmpty(txtCWT.Text)?DBNull.Value:(object)txtCWT.Text)
            .Append("o_AWM", string.IsNullOrEmpty(txtAWM.Text)?DBNull.Value:(object)txtAWM.Text)

            .Append("o_M_to", txtM_to.Value.Trim().ToUpper())
            .Append("o_Remark", txtMAWBRemark.Text.Trim().ToUpper())
            .Append("o_AccountRemark", txtAccRemark.Text.ToUpper())

            .Append("o_Unit", CmbUnit.Value)
            .Append("o_IsDirect", chbDirect.Checked?1:0)
            .Append("o_LocPOL", cmbLoading.Value)
            .Append("o_LocPOD", cmbPort.Value)
            .Append("o_ETA", ControlBinder.getDate(txtETADischarge.RawText.StartsWith("0001")?DBNull.Value:(object)txtETADischarge.RawText))
            .Append("o_ETAFinal", ControlBinder.getDate(txtETAFinal.RawText.StartsWith("0001")?DBNull.Value:(object)txtETAFinal.RawText))
            .Append("o_ATD", ControlBinder.getDate(txtATD.RawText.StartsWith("0001")?DBNull.Value:(object)txtATD.RawText))
            .Append("o_ATA", ControlBinder.getDate(txtATA.RawText.StartsWith("0001")?DBNull.Value:(object)txtATA.RawText))
            .Append("o_CarrierATTN", txtContainer.Text.ToUpper())
            .Append("o_STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("o_SYS", SYS)
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("code", FSecurityHelper.CurrentUserDataGET()[4] + "OI")
            .Append("imp_Clearance", txtClearance.Text.ToUpper())
            .Append("imp_Surrender", DBNull.Value)
            .Append("imp_Warehouse", cmbWarehouse.Value)
            .Append("imp_StorageFrom", ControlBinder.getDate(txtFreeStorageStart.RawText.StartsWith("0001")?DBNull.Value:(object)txtFreeStorageStart.RawText))
            .Append("imp_StorageTo", ControlBinder.getDate(txtFreeStorageEnd.RawText.StartsWith("0001")?DBNull.Value:(object)txtFreeStorageEnd.RawText))
            .Append("imp_PickupDate", ControlBinder.getDate(txtPickup.RawText.StartsWith("0001")?DBNull.Value:(object)txtPickup.RawText))
        }).GetTable();

        if (dt == null || dt.Rows.Count == 0)
        {
            //X.Msg.Show(new MessageBoxConfig { Title = "Status", Message = "  Saved failed ! ! !  ", Width = new Unit(200), Buttons = MessageBox.Button.OK, AnimEl = "btnSave" });
            ControlBinder.pageTitleMsg(false, "OI-M New", "<p class=\"error\">Status :  Save failed, please check the data .  </p>", div_bottom);
            return;
        }
        hidSeed.Text = dt.Rows[0]["o_Seed"].ToString();

        #endregion

        #region ///Update  HBLList ,Local Invoice
        //var HBLList = JSON.Deserialize<List<HBL>>(e.ExtraParams["gridHBL"]);
        //string RowID = "0,";
        //for (int i = 0; i < HBLList.Count; ++i)
        //{
        //    RowID += HBLList[i].RowID + ",";
        //}
        //RowID = RowID.Substring(0, RowID.Length - 1);
        //bool hbl = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_MBLList_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "Delete_HBL")
        //    .Append("o_Seed",hidSeed.Text)
        //    .Append("ROWID",RowID)}).Update();

        //RowID = "0,";
        //var InvoiceList = JSON.Deserialize<List<Invoice>>(e.ExtraParams["gridInvoice"]);
        //for (int i = 0; i < InvoiceList.Count; ++i)
        //{
        //    RowID += InvoiceList[i].RowID + ",";
        //}
        //RowID = RowID.Substring(0, RowID.Length - 1);
        //bool invoice = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_MBLList_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "Delete_Invoice")
        //    .Append("o_Seed",hidSeed.Text)
        //    .Append("ROWID",RowID)}).Update();

        #endregion

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

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

        bool l = true;

        if (l)
        {
            if (ControlBinder.IsDisplayLotNo(ControlBinder.getDate(string.IsNullOrEmpty(txtETADischarge.RawText.Trim()) ? DBNull.Value : (object)txtETADischarge.RawText).ToString(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }

            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "OI", "MBL");
            if (i == 1)
            {
                hidSeed.Text = "0";
                //X.Msg.Show(new MessageBoxConfig { Title = "Status", Message = "  Saved successfully ! ! !  ", Width = new Unit(200), Buttons = MessageBox.Button.OK, AnimEl = "btnSave", Fn = new JFunction { Handler = "location.href='list.aspx'" } });
                ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"success\">Status :  Record Saved with  <span>" + labImpLotNo.Text + " </span> </p>", div_bottom);
                X.Redirect("list.aspx");
            }
            else
            {
                if (hidSeed.Text != Request["seed"])
                {  //X.Msg.Show(new MessageBoxConfig { Title = "Status", Message = "  Saved successfully ! ! !  ", Width = new Unit(200), Buttons = MessageBox.Button.OK, AnimEl = "btnSave", Fn = new JFunction { Handler = "location.href='list.aspx?seed=" + hidSeed.Text + "'" } });
                    ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"success\">Status :  Record Saved with  <span>" + labImpLotNo.Text + " </span> </p>", div_bottom);
                    X.Redirect("list.aspx?seed=" + hidSeed.Text);
                }
                else
                {// X.Msg.Show(new MessageBoxConfig { Title = "Status", Message = "  Saved successfully ! ! !  ", Width = new Unit(200), Buttons = MessageBox.Button.OK, AnimEl = "btnSave" });
                    ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"success\">Status :  Record Saved with  <span>" + labImpLotNo.Text + " </span> </p>", div_bottom);
                }
            }
        }
        else
        {
            //X.Msg.Show(new MessageBoxConfig { Title = "Status", Message = "  Saved failed ! ! !   ", Width = new Unit(200), Buttons = MessageBox.Button.OK, AnimEl = "btnSave" });
            ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"error\">Status :  Save failed, please check the data .  </p>", div_bottom);
        }
    }
コード例 #7
0
    void DataBinder(DataTable dt)
    {
        CmbUnit.setValue("PKG");
        if (dt == null || dt.Rows.Count == 0)
        {
            ControlBinder.pageTitleMsg(false, "OI-M New", "<p>Status : New Blank  MBL </p>", div_bottom);
            return;
        }
        labImpLotNo.Text = dt.Rows[0]["LotNo"].ToString();
        hidLotNo.Text    = dt.Rows[0]["LotNo"].ToString();
        txtMBL.Text      = dt.Rows[0]["MBL"].ToString();
        cmbMode.setValue(dt.Rows[0]["ServiceMode"].ToString());
        cmbPPD.Text = dt.Rows[0]["PPD"].ToString();
        cmbSales.setValue(dt.Rows[0]["Salesman"].ToString());
        txtColoader.Text  = dt.Rows[0]["ColoaderMBL"].ToString();
        txtReference.Text = dt.Rows[0]["Reference"].ToString();
        txtClearance.Text = dt.Rows[0]["Clearance"].ToString();
        cmbCarrierCode.setValue(dt.Rows[0]["Carrier"].ToString());
        cmbCarrierCode.Text = dt.Rows[0]["CarrierName"].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();
        cmbDischargeCode.setValue(dt.Rows[0]["Discharge"].ToString());
        cmbDischargeCode.Text = dt.Rows[0]["DischargeName"].ToString();
        cmbBrokerCode.setValue(dt.Rows[0]["Boroker"].ToString());
        cmbBrokerCode.Text = dt.Rows[0]["BorokerName"].ToString();
        cmbVesselCode.SelectedItem.Value = dt.Rows[0]["Vessel"].ToString();
        ComList();
        cmbVesselText.SelectedItem.Value = dt.Rows[0]["Voyage"].ToString();
        X.AddScript("getVessel('" + dt.Rows[0]["Vessel"].ToString() + "','" + dt.Rows[0]["Voyage"].ToString() + "');");
        cmbLoading.setValue(dt.Rows[0]["Loading"].ToString());
        cmbPort.setValue(dt.Rows[0]["Port"].ToString());
        cmbFinalDest.setValue(dt.Rows[0]["FinalDest"].ToString());
        txtETD.Text          = dt.Rows[0]["ETD"].ToString();
        txtETADischarge.Text = dt.Rows[0]["ETAdischarge"].ToString();
        txtETAFinal.Text     = dt.Rows[0]["ETAFinal"].ToString();
        txtOELot.Text        = dt.Rows[0]["OELotNo"].ToString();
        txtATD.Text          = dt.Rows[0]["ATD"].ToString();
        txtATA.Text          = dt.Rows[0]["ATA"].ToString();
        //if (!string.IsNullOrEmpty(dt.Rows[0]["GWT"].ToString()))
        //    txtGWT.Text = dt.Rows[0]["GWT"].ToString();
        //if (!string.IsNullOrEmpty(dt.Rows[0]["CWT"].ToString()))
        //    txtCWT.Text = dt.Rows[0]["CWT"].ToString();
        //if (!string.IsNullOrEmpty(dt.Rows[0]["CBM"].ToString()))
        //    txtCBM.Text = dt.Rows[0]["CBM"].ToString();
        //if (!string.IsNullOrEmpty(dt.Rows[0]["Piece"].ToString()))
        //    txtPiece.Text = dt.Rows[0]["Piece"].ToString();

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

        if (!string.IsNullOrEmpty(dt.Rows[0]["Container"].ToString()))
        {
            txtContainer.Text = dt.Rows[0]["Container"].ToString();
        }

        CmbUnit.setValue(dt.Rows[0]["Unit"].ToString());
        cmbWarehouse.setValue(dt.Rows[0]["WareHouse"].ToString());
        cmbWarehouse.Text        = dt.Rows[0]["WareHouseName"].ToString();
        txtFreeStorageStart.Text = dt.Rows[0]["FreeStorageStart"].ToString();
        txtFreeStorageEnd.Text   = dt.Rows[0]["FreeStorageEnd"].ToString();
        txtPickup.Text           = dt.Rows[0]["PickUp"].ToString();
        chbDirect.Checked        = Convert.ToBoolean(dt.Rows[0]["Direct"]);
        hidSeed.Text             = dt.Rows[0]["seed"].ToString();

        txtM_to.Value = dt.Rows[0]["M_to"].ToString();
        txtM_to.Text  = dt.Rows[0]["M_toName"].ToString();

        txtMAWBRemark.Text = dt.Rows[0]["o_Remark"].ToString();
        txtAccRemark.Text  = dt.Rows[0]["o_AccountRemark"].ToString();

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

        if (Convert.ToBoolean(dt.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("$('#showHBL').hide();");
            btnUpdateLotNo.Hide();
        }



        ControlBinder.pageTitleMsg(false, "OI-M:" + labImpLotNo.Text, "<p>Status : Edit  MBL  of   <span>" + dt.Rows[0]["LotNo"] + "</span>  </p>", div_bottom);
    }
コード例 #8
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);
        }
    }
コード例 #9
0
    /// <summary>
    /// Button 事件   修改保存
    /// </summary>
    #region    btnSave_Click()  修改保存   Author:Micro   (2011-09-05)
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        object ETA = ControlBinder.getDate(string.IsNullOrEmpty(txtETA.RawText.Trim()) ? DBNull.Value : (object)txtETA.RawText);
        object ETD = ControlBinder.getDate(string.IsNullOrEmpty(txtETD.RawText.Trim()) ? DBNull.Value : (object)txtETD.RawText);
        object ATD = ControlBinder.getDate(string.IsNullOrEmpty(txtATD.RawText.Trim()) ? DBNull.Value : (object)txtATD.RawText);
        object ATA = ControlBinder.getDate(string.IsNullOrEmpty(txtATA.RawText.Trim()) ? DBNull.Value : (object)txtATA.RawText);

        if (!string.IsNullOrEmpty(ETA.ToString()) && !string.IsNullOrEmpty(ETD.ToString()) && Convert.ToDateTime(ETD) > Convert.ToDateTime(ETA))
        {
            ControlBinder.pageTitleMsg(false, "AI:M" + labLotNo.Text, "<p class=\"error\">Status :  Saved  failed , Error message: ETD  Not more than   ETA  .</p>", div_bottom);
            txtETD.Focus(true);
            return;
        }

        if (!string.IsNullOrEmpty(ATD.ToString()) && !string.IsNullOrEmpty(ATA.ToString()) && Convert.ToDateTime(ATD) > Convert.ToDateTime(ATA))
        {
            ControlBinder.pageTitleMsg(false, "AI:M" + labLotNo.Text, "<p class=\"error\">Status :  Saved  failed , Error message: ATD  Not more than   ATA  .</p>", div_bottom);
            txtATD.Focus(true);
            return;
        }

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Joblist_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "UpdateMAWB")
            .Append("air_ROWID", hidRowID.Text.Trim())
            .Append("air_MAWB", txtMawb.Text.Replace(" ", "").Trim().ToUpper())
            .Append("air_aeLotNo", labAeLotNo.Text.ToUpper())
            .Append("air_CompanyReferance", txtReference.Text.Trim().ToUpper())
            .Append("imp_Clearance", txtClearence.Text.Trim().ToUpper())
            .Append("air_CoLoader", CmbCarrierCode.Value)
            .Append("air_Shipper", CmbShipperCode.Value)
            .Append("air_Consignee", CmbConsigneeCode.Value)
            .Append("air_PartyA", CmbNotify1Code.Value)
            .Append("air_PartyB", CmbNotify2Code.Value)
            .Append("air_Broker", CmbDischargeCode.Value)
            .Append("air_IsDirect", chbDirect.Checked?"1":"0")
            .Append("air_Sales", chbDirect.Checked?CmbSalesman.Value.ToUpper():"")
            .Append("air_GWT", string.IsNullOrEmpty(txtGWT.Text.Trim())?DBNull.Value:(object)txtGWT.Text)
            .Append("air_VWT", string.IsNullOrEmpty(txtVWT.Text.Trim())?DBNull.Value:(object)txtVWT.Text)
            .Append("air_CWT", string.IsNullOrEmpty(txtCWT.Text.Trim())?DBNull.Value:(object)txtCWT.Text)
            .Append("air_Piece", string.IsNullOrEmpty(txtPiece.Text.Trim())?DBNull.Value:(object)txtPiece.Text)
            .Append("air_Unit", CmbUnit.Value)
            .Append("air_Pallet", string.IsNullOrEmpty(txtPallet.Text.Trim())?DBNull.Value:(object)txtPallet.Text)
            .Append("air_Carrier", CmbCarrierRight.Value)
            .Append("air_Flight", txtFlightRight.Text.Trim().ToUpper())
            .Append("air_LocLoad", CmbFromRight.Value)
            .Append("air_LocDischarge", CmbToRight.Value)
            .Append("air_Remark", txtRemark.Text.Trim())
            .Append("air_ETD", ControlBinder.getDate(string.IsNullOrEmpty(txtETD.RawText.Trim())?DBNull.Value:(object)txtETD.RawText))
            .Append("air_ETA", ControlBinder.getDate(string.IsNullOrEmpty(txtETA.RawText.Trim())?DBNull.Value:(object)txtETA.RawText))
            .Append("air_ATD", ControlBinder.getDate(string.IsNullOrEmpty(txtATD.RawText.Trim())?DBNull.Value:(object)txtATD.RawText))
            .Append("air_ATA", ControlBinder.getDate(string.IsNullOrEmpty(txtATA.RawText.Trim())?DBNull.Value:(object)txtATA.RawText))
            .Append("LastUser", FSecurityHelper.CurrentUserDataGET()[0].ToString())
            .Append("air_Seed", hidSeed.Text.Trim())
            .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
            // .Append("air_SYS",FSecurityHelper.CurrentUserDataGET()[11].ToString())
            .Append("air_SYS", "AI")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
            .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + "AI")
        }).GetTable();

        if (dt != null && dt.Rows.Count > 0 && !string.IsNullOrEmpty(dt.Rows[0][1].ToString()))
        {
            hidSeed.Text = dt.Rows[0][1].ToString();
        }

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

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

        #region///获取FlightRouting列表数据
        var ShipmentRoute = JSON.Deserialize <List <ShipmentRoute> >(e.ExtraParams["p_safety_l"]);

        #region  /// 先Delete 在Update
        string rowID = "0,";
        for (int i = 0; i < ShipmentRoute.Count; ++i)
        {
            rowID += ShipmentRoute[i].RowID + ",";
        }

        rowID = rowID.Substring(0, rowID.Length - 1);
        bool d = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentRoute_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Delete")
            .Append("sr_ToMaster", hidSeed.Text)
            .Append("ROWID", rowID)
        }).Update();

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

        for (int i = 0; i < ShipmentRoute.Count; ++i)
        {
            list.Add(dal.CreateIFields().Append("Option", "UpdateList").
                     Append("sr_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString()).
                     Append("sr_ToMaster", hidSeed.Text).
                     Append("sr_ShipKind", CmbShipperCode.Text).
                     Append("sr_Carrier", CmbCarrierCode.Text).
                     Append("sr_OrderID", i).
                     Append("sr_Vessel", "").
                     Append("sr_Voyage", "").
                     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));
        }
        bool b = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentRoute_SP", list).Update();
        #endregion
        #endregion

        #region ///Update HAWB List
        var hawbList = JSON.Deserialize <List <HawbList> >(e.ExtraParams["p_safety_3"]);
        rowID = "0,";
        for (int i = 0; i < hawbList.Count; ++i)
        {
            rowID += hawbList[i].RowID + ",";
        }
        rowID = rowID.Substring(0, rowID.Length - 1);
        bool h = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Joblist_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "DeleteMAWB")
            .Append("air_ToMAWB", hidSeed.Text)
            .Append("str", rowID)
        }).Update();

        #endregion

        #region ///Update Local Invoice
        //var InvocieList = JSON.Deserialize<List<Invocie>>(e.ExtraParams["p_safety_4"]);
        //rowID = "0,";
        //for (int i = 0; i < InvocieList.Count; ++i)
        //{
        //    rowID += InvocieList[i].RowID + ",";
        //}
        //rowID = rowID.Substring(0, rowID.Length - 1);
        //bool inv = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List<IFields>() { dal.CreateIFields().Append("Option", "DeleteActive")
        //    .Append("inv_ToMaster",hidSeed.Text)
        //    .Append("str",rowID)}).Update();
        #endregion



        if (dt != null)
        {
            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "AI", "MAWB");

            if (ControlBinder.IsDisplayLotNo(ControlBinder.getDate(string.IsNullOrEmpty(txtETA.RawText.Trim()) ? DBNull.Value : (object)txtETA.RawText).ToString(), hidLotNo.Text))
            {
                btnUpdateLotNo.Show();
            }
            else
            {
                btnUpdateLotNo.Hide();
            }
            txtMawb.Focus(true);
            ControlBinder.pageTitleMsg(true, "AI-M:" + labLotNo.Text, "<p class=\"success\">Status : Record Saved with Lot No.  <span>" + labLotNo.Text + "</span>  </p>", div_bottom);

            if (dt != null && dt.Rows.Count > 0 && !string.IsNullOrEmpty(dt.Rows[0][1].ToString()))
            {
                X.Redirect("mawb.aspx?seed=" + dt.Rows[0][1]);
            }
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "AI-M:" + labLotNo.Text, "<p class=\"error\">Status :  Saved  failed ! ! !  </p>", div_bottom);
        }
    }
コード例 #10
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);
        }
    }