コード例 #1
0
    public void btnRevert_Click()
    {
        string lotno = hidLotNo.Text;

        if (lotno != "")
        {
            DataSet result = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_DirectMAWB_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "Revert").Append("air_Seed", hidSeed.Text)
                .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
            }).GetList();
            if (result != null && result.Tables[0].Rows.Count > 0)
            {
                string type = "";
                if (result.Tables[0].Rows[0][0].ToString() == "s")
                {
                    Response.Redirect("../AEShipAndColIn/List.aspx?type=s&seed=" + result.Tables[0].Rows[0][1]);
                }
                else
                {
                    Response.Redirect("../AEShipAndColIn/List.aspx?type=c&seed=" + result.Tables[0].Rows[0][1]);
                }
            }
            else
            {
                ControlBinder.pageTitleMsg(false, showname + hidLotNo.Text, "<p class=\"error\">Status :  Deleted failed, please check the data . </p>", div_bottom);
            }
        }
    }
コード例 #2
0
 /// <summary>
 /// 新增
 /// </summary>
 protected void btnAddNew_Click(object sender, EventArgs e)
 {
     txtVoyageID.Text = "";
     ControlInit();
     txtVoyage.Focus();
     ControlBinder.pageTitleMsg(false, "New Voyage", "<p>Status : New  Blank  Voyage . </p>", div_bottom);
 }
コード例 #3
0
    public void btnVoid_Click()
    {
        string seedid = hidSeed.Text;

        hidDelByRowId.Text = "";
        //if (!VoidCheckAC.CheckisAC("DO", hidSeed.Text))
        //{
        //    X.MessageBox.Alert("Status", VoidCheckAC.Message).Show();
        //    return;
        //}

        if (seedid.Length > 1)
        {
            string  voidflag = hidVoid.Text == "0" ? "Y" : "N";
            DataSet l        = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_CallVoid_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "D").Append("VoidFlag", voidflag)
                .Append("seed", hidSeed.Text == "" ? null:hidSeed.Text)
            }).GetList();
            if (l == null)
            {
                ControlBinder.pageTitleMsg(false, "DO:" + labDO.Text, "<p class=\"error\"> Status : Void failed , please check the data .   </p>", div_bottom);
            }
            DataBinder();
            ControlBinder.pageTitleMsg(true, "DO:" + labDO.Text, "<p>Status : Edit DO of <span>" + labDO.Text + "</span></p>", div_bottom);
        }
    }
コード例 #4
0
    void DataBinder()
    {
        txtContainer.Focus(true);

        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_Container_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "List").Append("oc_ROWID", hidID.Text)
            .Append("oc_ToHBL", Request["HBL"])
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            string temphawb  = ds.Tables[0].Rows[0]["HBL"].ToString().ToUpper() == "" ? "" : "HBL# " + "<span style='color:#ff0000;'>" + ds.Tables[0].Rows[0]["HBL"].ToString().ToUpper() + "</span>";
            string tempmawb  = ds.Tables[0].Rows[0]["MBL"].ToString().ToUpper() == "" ? "" : "MBL# " + "<span style='color:#ff0000;'>" + ds.Tables[0].Rows[0]["MBL"].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 = (temphawb == "" ? "" : "<span style='padding-left:10px'>" + temphawb + "</span>") + (tempmawb == "" ? "" : "<span style='padding-left:10px'>" + tempmawb + "</span>") + (tempLotNo == "" ? "" : "<span style='padding-left:10px'>" + tempLotNo + "</span>");

            chkIsMain.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["oc_isMain"]);
            txtContainer.Text = ds.Tables[0].Rows[0]["oc_CtnrNo"].ToString();
            txtSeal.Text      = ds.Tables[0].Rows[0]["oc_SealNo"].ToString();
            CmbSize.setValue(ds.Tables[0].Rows[0]["oc_CtnrSize"].ToString());
            CmbSerMode.setValue(ds.Tables[0].Rows[0]["oc_Servicemode"].ToString());
            txtSO.Text = ds.Tables[0].Rows[0]["oc_SONo"].ToString();
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["oc_GWT"].ToString()))
            {
                txtGWT.Text = ds.Tables[0].Rows[0]["oc_GWT"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["oc_CBM"].ToString()))
            {
                txtCBM.Text = ds.Tables[0].Rows[0]["oc_CBM"].ToString();
            }
            if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["oc_Piece"].ToString()))
            {
                txtPiece.Text = ds.Tables[0].Rows[0]["oc_Piece"].ToString();
            }
            CmbUnit.setValue(ds.Tables[0].Rows[0]["oc_Unit"].ToString());
            txtMarks1.Text = ds.Tables[0].Rows[0]["oc_OrderMarks"].ToString();
            txtMarks2.Text = ds.Tables[0].Rows[0]["oc_OrderDescription"].ToString();
            txtmarks3.Text = ds.Tables[0].Rows[0]["oc_OrderNoOfPackage"].ToString();
            lblPiece.Text  = txtPiece.Text;
            //lblUnit.Text = ds.Tables[0].Rows[0]["oc_Unit"].ToString();
            X.AddScript("var r = StoreUnit.getById($('#CmbUnit').val());if(!Ext.isEmpty(r)){#{lblUnit}.setValue(r.data.short);}");
            txtRemark.Text = ds.Tables[0].Rows[0]["oc_Remark"].ToString();
            if (string.IsNullOrEmpty(Request["ID"]))
            {
                ControlBinder.pageTitleMsg(false, "OE-C  New", "<p>Status: New Blank Container .</p>", div_bottom);
            }
            else
            {
                ControlBinder.pageTitleMsg(false, "OE-C:" + txtContainer.Text, "<p>Status: Edit Container of  <span>" + txtContainer.Text.ToUpper() + "</span>.</p>", div_bottom);
            }
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OE-C  New", "<p>Status: New Blank Container .</p>", div_bottom);
        }
    }
コード例 #5
0
    public void btnVoid_Click()
    {
        string seedid = hidSeed.Text;

        if (!VoidCheckAC.CheckisAC("OI", hidSeed.Text))
        {
            X.MessageBox.Alert("Status", VoidCheckAC.Message).Show();
            return;
        }


        if (seedid.Length > 1)
        {
            string  voidflag = hidVoid.Text == "0" ? "Y" : "N";
            DataSet l        = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_CallVoid_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "O").Append("Type", "HBL").Append("VoidFlag", voidflag)
                .Append("seed", hidSeed.Text == ""?null:hidSeed.Text)
            }).GetList();
            if (l != null && l.Tables[0].Rows[0][0].ToString() == "Y")
            {
                X.AddScript("$('#img_void').css('display','inline');");
                btnSave.Disabled   = true;
                btnCancel.Disabled = true;
                btnNext.Disabled   = true;
                btnVoid.Text       = "Active";
                hidVoid.Text       = "1";
                X.AddScript("$('#showContainer').hide();");
            }
            else if (l != null && l.Tables[0].Rows[0][0].ToString() == "N")
            {
                X.AddScript("$('#img_void').css('display','none');");
                btnSave.Disabled   = false;
                btnCancel.Disabled = false;
                btnNext.Disabled   = false;
                btnVoid.Text       = "Void";
                hidVoid.Text       = "0";
                X.AddScript("$('#showContainer').show();");
            }
            else if (l != null && l.Tables[0].Rows[0][0].ToString() == "S")
            {
                X.Msg.Alert("Information", "HBL can't be active,because MBL is void.").Show();
            }
            else
            {
                ControlBinder.pageTitleMsg(false, "OI-H:" + labImpLotNo.Text, "<p class=\"error\">Status : Save failed, please check the data . </p>", div_bottom);
            }

            DataBindList();
            ControlBinder.pageTitleMsg(true, "OI-H:" + labImpLotNo.Text, "<p>Status : Edit HBL of  <span>" + labImpLotNo.Text + "</span>. </p>", div_bottom);
        }
    }
コード例 #6
0
 /// <summary>
 /// 复制
 /// </summary>
 protected void btnCopy_Click(object sender, EventArgs e)
 {
     ControlInit();
     txtVoyageID.Text = "";
     txtVoyage.Text   = "";
     txtETD.Text      = "";
     txtETA.Text      = "";
     txtOnboard.Text  = "";
     txtCFS.Text      = "";
     txtCY.Text       = "";
     txtVoyage.Focus(true);
     ControlBinder.pageTitleMsg(false, "New Voyage", "<p>Status : New  Blank  Voyage . </p>", div_bottom);
 }
コード例 #7
0
    /// <summary>
    /// 数据绑定
    /// </summary>
    #region   ///Grid 数据绑定     Author:Micro   (2011-09-27)
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_MBLList_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "Single")
            .Append("o_Seed", hidSeed.Text == "0"?(object)DBNull.Value:(object)hidSeed.Text)
        }).GetList();

        if (ds != null)
        {
            DataBinder(ds.Tables[0]);

            storeHBL.DataSource = ds.Tables[1];
            storeHBL.DataBind();
            if (ds.Tables[1].Rows.Count > 0)
            {
                double GWT = 0.000, Pieces = 0, CBM = 0.000, wm = 0.000;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    GWT    += Convert.ToDouble(ds.Tables[1].Rows[i]["CWT"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["CWT"].ToString());
                    Pieces += Convert.ToDouble(ds.Tables[1].Rows[i]["PKGS"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["PKGS"].ToString());
                    CBM    += Convert.ToDouble(ds.Tables[1].Rows[i]["CBM"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["CBM"].ToString());
                    wm     += Convert.ToDouble(ds.Tables[1].Rows[i]["WM"].ToString() == "" ? "0.000" : ds.Tables[1].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();
                }
            }

            StoreInvoice.DataSource = ds.Tables[2];
            StoreInvoice.DataBind();
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OI-M New", "<p>Status : New Blank  MBL </p>", div_bottom);
        }
    }
コード例 #8
0
    public void btnVoid_Click()
    {
        string seedid = hidSeed.Text;

        if (!VoidCheckAC.CheckisAC("AI", hidSeed.Text))
        {
            X.MessageBox.Alert("Status", VoidCheckAC.Message).Show();
            return;
        }

        if (seedid.Length > 1)
        {
            string  voidflag = hidVoid.Text == "0" ? "Y" : "N";
            DataSet l        = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_CallVoid_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "A").Append("Type", "MAWB").Append("VoidFlag", voidflag)
                .Append("seed", hidSeed.Text == ""?null:hidSeed.Text)
            }).GetList();
            if (l != null && l.Tables[0].Rows[0][0].ToString() == "Y")
            {
                X.AddScript("$('#img_void').css('display','inline');");
                btnSave.Disabled   = true;
                btnCancel.Disabled = true;
                btnNext.Disabled   = true;
                btnVoid.Text       = "Active";
                hidVoid.Text       = "1";
                X.AddScript("$('#showHBL').hide();");
                btnUpdateLotNo.Hide();
            }
            else if (l != null && l.Tables[0].Rows[0][0].ToString() == "N")
            {
                X.AddScript("$('#img_void').css('display','none');");
                btnSave.Disabled   = false;
                btnCancel.Disabled = false;
                btnNext.Disabled   = false;
                btnVoid.Text       = "Void";
                hidVoid.Text       = "0";
                X.AddScript("$('#showHBL').show();");
            }
            else
            {
                ControlBinder.pageTitleMsg(false, "AI-M:" + labLotNo.Text, "<p class=\"error\"> Status : Saving  failed  ! ! !   </p>", div_bottom);
            }
            DataBinder();
            StoreInvoice.DataSource = GetList("FW_AirImport_Invoice_SP", "List", "inv_Seed", hidSeed.Text);
            StoreInvoice.DataBind();
            ControlBinder.pageTitleMsg(true, "AI-M:" + labLotNo.Text, "<p>Status :  Edit  MAWB  of <span>" + labLotNo.Text + "</span></p>", div_bottom);
        }
    }
コード例 #9
0
    public void btnVoid_Click()
    {
        string seedid = hidSeed.Text;

        if (!VoidCheckAC.CheckisAC("AE", hidSeed.Text))
        {
            X.MessageBox.Alert("Status", VoidCheckAC.Message).Show();
            return;
        }


        if (seedid.Length > 1)
        {
            string  voidflag = hidVoid.Text == "0" ? "Y1" : "N1";
            DataSet l        = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_CallVoid_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "A").Append("Type", "MAWB").Append("VoidFlag", voidflag)
                .Append("seed", hidSeed.Text == ""?null:hidSeed.Text)
            }).GetList();
            if (l != null && l.Tables[0].Rows[0][0].ToString() == "Y")
            {
                X.AddScript("$('#img_void').css('display','inline');");
                btnSave.Disabled   = true;
                btnCancel.Disabled = true;
                btnRevert.Disabled = true;
                btnVoid.Text       = "Active";
                hidVoid.Text       = "1";
                X.AddScript("$('#showGenerate').hide();");
                btnUpdateLotNo.Hide();
            }
            else if (l != null && l.Tables[0].Rows[0][0].ToString() == "N")
            {
                X.AddScript("$('#img_void').css('display','none');");
                btnSave.Disabled   = false;
                btnCancel.Disabled = false;
                btnRevert.Disabled = false;
                X.AddScript("$('#showGenerate').show();");
                btnVoid.Text = "Void";
                hidVoid.Text = "0";
            }
            else
            {
                ControlBinder.pageTitleMsg(false, showname + hidLotNo.Text, "<p class=\"error\">Status :  Void failed, please check the data . </p>", div_bottom);
            }
            DataBindList();
            ControlBinder.pageTitleMsg(true, showname + ":" + hidLotNo.Text, "<p>Status :  Edit  No. of  <span>" + hidLotNo.Text + "</span></p>", div_bottom);
        }
    }
コード例 #10
0
    void DataBinder()
    {
        txtContainer.Focus(true);

        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_Container_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "List").Append("oc_ROWID", hidID.Text)
            .Append("oc_ToHBL", Request["HBL"])
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            txtContainer.Text = ds.Tables[0].Rows[0]["oc_CtnrNo"].ToString();
            txtSeal.Text      = ds.Tables[0].Rows[0]["oc_SealNo"].ToString();
            CmbSize.setValue(ds.Tables[0].Rows[0]["oc_CtnrSize"].ToString());
            CmbSerMode.setValue(ds.Tables[0].Rows[0]["oc_Servicemode"].ToString());
            txtSO.Text    = ds.Tables[0].Rows[0]["oc_SONo"].ToString();
            txtGWT.Text   = ds.Tables[0].Rows[0]["oc_GWT"].ToString();
            txtCBM.Text   = ds.Tables[0].Rows[0]["oc_CBM"].ToString();
            txtPiece.Text = ds.Tables[0].Rows[0]["oc_Piece"].ToString();
            CmbUnit.setValue(ds.Tables[0].Rows[0]["oc_Unit"].ToString());
            txtMarks1.Text = ds.Tables[0].Rows[0]["oc_OrderMarks"].ToString();
            txtMarks2.Text = ds.Tables[0].Rows[0]["oc_OrderDescription"].ToString();
            txtmarks3.Text = ds.Tables[0].Rows[0]["oc_OrderNoOfPackage"].ToString();
            lblPiece.Text  = ds.Tables[0].Rows[0]["oc_Piece"].ToString();
            lblUnit.Text   = ds.Tables[0].Rows[0]["oc_Unit"].ToString();
            txtRemark.Text = ds.Tables[0].Rows[0]["oc_Remark"].ToString();
            if (string.IsNullOrEmpty(Request["ID"]))
            {
                ControlBinder.pageTitleMsg(false, "OI-C  New", "<p>Status: New Blank Container .</p>", div_bottom);
            }
            else
            {
                ControlBinder.pageTitleMsg(false, "OI-C:" + txtContainer.Text, "<p>Status: Edit Container of  <span>" + txtContainer.Text + "</span>.</p>", div_bottom);
            }
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OI-C  New", "<p>Status: New Blank Container .</p>", div_bottom);
        }
    }
コード例 #11
0
    public void btnDelete_Click()
    {
        DataFactory dal = new DataFactory();
        DataTable   dt  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_Container_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Delete")
            .Append("oc_ROWID", hidID.Text).Append("oc_User", FSecurityHelper.CurrentUserDataGET()[0])
        }).GetTable();

        if (dt != null && dt.Rows.Count > 0)
        { //X.Msg.Alert("status", " Delete successfully").Show();
            ControlBinder.pageTitleMsg(true, "OI-C:" + txtContainer.Text, "<p class=\"success\">Status : Delete successfully . </p>", div_bottom);
            X.Redirect("OceanShipmentHouse.aspx?MBL=" + dt.Rows[0]["HBL"] + "&seed=" + dt.Rows[0]["MBL"]);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OI-C:" + txtContainer.Text, "<p class=\"error\">Status : Save failed, please check the data . </p>", div_bottom);
        }
    }
コード例 #12
0
    public void btnUpdateLotNo_Click()
    {
        object etd = ControlBinder.getDate(string.IsNullOrEmpty(txtJob.RawText.Trim()) ? DBNull.Value : (object)txtJob.RawText.Trim());

        string lotNo = ControlBinder.GetNewLotNo("BK", hidSeed.Text, etd);

        if (lotNo == "-1")
        {
            X.MessageBox.Alert("Status", "The cost of this LOT is transfered to AC, LOT NUMBER updating is aborted!").Show();
            ControlBinder.pageTitleMsg(true, "Brokerage Shipment:" + hidLotNo.Text, "<p class=\"success\">Status : Saved failed ! ! ! </p>", div_bottom);
        }
        else if (lotNo != "0")
        {
            labLotNo.Text = lotNo;
            hidLotNo.Text = lotNo;
            ControlBinder.pageTitleMsg(true, "Brokerage Shipment:" + hidLotNo.Text, "<p class=\"success\">Status : Saved successfully ! ! ! </p>", div_bottom);
            btnUpdateLotNo.Hide();
        }
    }
コード例 #13
0
    public void btnUpdateLotNo_Click()
    {
        object eta = ControlBinder.getDate(string.IsNullOrEmpty(txtETADischarge.RawText.Trim()) ? DBNull.Value : (object)txtETADischarge.RawText);

        string lotNo = ControlBinder.GetNewLotNo("OI", hidSeed.Text, eta);

        if (lotNo == "-1")
        {
            X.MessageBox.Alert("Status", "The cost of this LOT is transfered to AC, LOT NUMBER updating is aborted!").Show();
            ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"success\">Status : Saved failed ! ! ! </p>", div_bottom);
        }
        else
        {
            labImpLotNo.Text = lotNo;
            hidLotNo.Text    = lotNo;
            ControlBinder.pageTitleMsg(true, "OI-M:" + labImpLotNo.Text, "<p class=\"success\">Status :  Record Saved with  <span>" + labImpLotNo.Text + " </span> </p>", div_bottom);
            btnUpdateLotNo.Hide();
        }
    }
コード例 #14
0
    void DataBinder()
    {
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "GetDetailList")
            .Append("cxh_ROWID", Request["CostingID"])
            .Append("cxd_Seed", Request["CostingDetailSeed"])
        }).GetList();



        if (ds != null && ds.Tables.Count > 0)
        {
            if (Request["CostingID"] != "0" && Request["CostingID"] != null)
            {
                hidID.Text       = ds.Tables[0].Rows[0]["cxh_ROWID"].ToString();
                hidHeadSeed.Text = ds.Tables[0].Rows[0]["cxh_Seed"].ToString();
                cmbShipperCode.setValue(ds.Tables[0].Rows[0]["cxh_Company"].ToString());
                cmbShipperCode.Text = ds.Tables[0].Rows[0]["CompanyName"].ToString();
                txtDate.Text        = ds.Tables[0].Rows[0]["cxh_Date"].ToString();
                txtInv.Text         = ds.Tables[0].Rows[0]["cxh_InvoiceNo"].ToString();
                txtAmount.Text      = ds.Tables[0].Rows[0]["cxh_Amount"].ToString();
            }
        }

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


        if (hidID.Text != "0")
        {
            ControlBinder.pageTitleMsg(false, "Combine Cost:Edit", "<p>Status :  Edit  Combine Cost </p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "Combine Cost:New", "<p>Status :  New  Combine Cost </p>", div_bottom);
        }
        X.AddScript("getSelectPos('cmbShipperCode');");
    }
コード例 #15
0
    /// <summary>
    /// 初始化控件绑定
    /// </summary>
    void ControlInit()
    {
        int voyageID = -1;

        try
        {
            voyageID = Convert.ToInt32(txtVoyageID.Text);
        }
        catch
        {
            txtVoyageID.Text = voyageID.ToString();
        }

        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanImport_Voyage_SP", new List <IFields>()
        {
            dal.CreateIFields().
            Append("Option", "Single").
            Append("voy_ROWID", voyageID.ToString())
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            txtVoyageID.Text = ds.Tables[0].Rows[0]["voy_ROWID"].ToString();
            txtVoyage.Text   = ds.Tables[0].Rows[0]["voy_Voyage"].ToString();
            cmbPOL.setValue(ds.Tables[0].Rows[0]["voy_POL"].ToString());
            cmbPOD.setValue(ds.Tables[0].Rows[0]["voy_POD"].ToString());
            txtETD.Text                 = ds.Tables[0].Rows[0]["voy_ETD"].ToString();
            txtETA.Text                 = ds.Tables[0].Rows[0]["voy_ETA"].ToString();
            txtOnboard.Text             = ds.Tables[0].Rows[0]["voy_Onboard"].ToString();
            txtCFS.Text                 = ds.Tables[0].Rows[0]["voy_CFS"].ToString();
            txtCY.Text                  = ds.Tables[0].Rows[0]["voy_CY"].ToString();
            chcActive.Checked           = Convert.ToBoolean(ds.Tables[0].Rows[0]["voy_Active"]);
            storeVoyageRoute.DataSource = ds.Tables[1];
            storeVoyageRoute.DataBind();
            ControlBinder.pageTitleMsg(false, "Edit Voyage", "<p>Status : Edit Voyage . </p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "New Voyage", "<p>Status : New  Blank  Voyage . </p>", div_bottom);
        }
    }
コード例 #16
0
 public void btnDelete_Click()
 {
     if (hidID.Text != "-1")
     {
         DataFactory dal = new DataFactory();
         bool        b   = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_Container_SP", new List <IFields>()
         {
             dal.CreateIFields().Append("Option", "Delete")
             .Append("oc_ROWID", hidID.Text).Append("oc_User", FSecurityHelper.CurrentUserDataGET()[0])
         }).Update();
         if (b)
         {
             ControlBinder.pageTitleMsg(true, "OE-C:" + txtContainer.Text.ToUpper(), "<p class=\"success\">Status : Delete successfully . </p>", div_bottom);
             X.AddScript("window.opener=null;window.open('','_self');window.close();");
         }
         else
         {
             ControlBinder.pageTitleMsg(false, "OE-C:" + txtContainer.Text.ToUpper(), "<p class=\"error\">Status : Delete failed, please check the data . </p>", div_bottom);
         }
     }
 }
コード例 #17
0
    void DataBinder()
    {
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_DeliveryOrder_Control_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "List")
            .Append("Seed", hidSeed.Text == "0"?(object)DBNull.Value:(object)hidSeed.Text)
        }).GetList();

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            DataBinder(ds.Tables[0]);

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

            ControlBinder.pageTitleMsg(true, "DO:" + labDO.Text, "<p>Status : Edit DO of <span>" + labDO.Text + "</span></p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "DO:New", "<p>Status : New Blank DO </p>", div_bottom);
        }
    }
コード例 #18
0
    public void btnUpdateLotNo_Click()
    {
        object etd = ControlBinder.getDate(string.IsNullOrEmpty(txtETD.RawText.Trim()) ? DBNull.Value : (object)txtETD.RawText.Trim());

        string lotNo = ControlBinder.GetNewLotNo("OE", hidSeed.Text, etd);

        if (lotNo == "-1")
        {
            X.MessageBox.Alert("Status", "The cost of this LOT is transfered to AC, LOT NUMBER updating is aborted!").Show();
            ControlBinder.pageTitleMsg(true, "OE-M:" + labImpLotNo.Text, "<p class=\"success\">Status : Saved failed ! ! ! </p>", div_bottom);
        }
        else if (lotNo != "0")
        {
            labImpLotNo.Text = lotNo;
            string tempmawb  = txtMBL.Text.Trim() == "" ? "" : "MBL# " + "<span style='color:#ff0000;'>" + txtMBL.Text.Trim().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>");


            ControlBinder.pageTitleMsg(true, "OE-M:" + labImpLotNo.Text, "<p class=\"success\">Status : Saved successfully ! ! ! </p>", div_bottom);
            btnUpdateLotNo.Hide();
        }
    }
コード例 #19
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);
        }
    }
コード例 #20
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);
        }
    }
コード例 #21
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);
        }
    }
コード例 #22
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);
        }
    }
コード例 #23
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);
        }
    }
コード例 #24
0
    /// <summary>
    /// 保存全部
    /// </summary>
    #region   ///Button 事件   保存全部          Author:Micro   (2011-09-27)
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        string code = (FSecurityHelper.CurrentUserDataGET()[12].Length > 3) ? FSecurityHelper.CurrentUserDataGET()[12].Substring(4, 3) + "OE" : FSecurityHelper.CurrentUserDataGET()[12] + "OE";

        #region ///Update  OCEAN
        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "UpdateMBL")
            .Append("o_Seed", hidSeed.Text == ""?null:hidSeed.Text)
            .Append("o_LotNo", labImpLotNo.Text)
            .Append("o_MBL", txtMBL.Text.ToUpper())
            .Append("o_ServiceMode", cmbMode.Value)
            .Append("o_ServiceType", CmbGroup.SelectedItem.Value)
            .Append("o_PaymentMode", cmbPPD.Text)
            .Append("o_Sales", cmbSales.Value)
            .Append("o_Carrier", cmbCarrierCode.Value)
            .Append("o_VesselID", cmbVesselCode.SelectedItem.Value)
            .Append("o_VoyageID", cmbVesselText.SelectedItem.Value)
            .Append("o_Shipper", cmbShipperCode.Value)
            .Append("o_Consignee", cmbConsigneeCode.Value)
            .Append("o_PartyA", CmbNotify1.Value)
            .Append("o_PartyB", CmbNotify2.Value)
            .Append("o_Coloader", cmbDischargeCode.Value)
            .Append("o_Broker", cmbBrokerCode.Value)
            .Append("o_M_to", txtM_to.Value.Trim().ToUpper())

            .Append("o_CWT", string.IsNullOrEmpty(txtCGWT.Text)?DBNull.Value:(object)txtCGWT.Text)
            .Append("o_AWT", string.IsNullOrEmpty(txtAGWT.Text)?DBNull.Value:(object)txtAGWT.Text)
            .Append("o_CCBM", string.IsNullOrEmpty(txtCCBM.Text)?DBNull.Value:(object)txtCCBM.Text)
            .Append("o_ACBM", string.IsNullOrEmpty(txtACBM.Text)?DBNull.Value:(object)txtACBM.Text)
            .Append("o_CPKGS", string.IsNullOrEmpty(txtCPiece.Text)?DBNull.Value:(object)txtCPiece.Text)
            .Append("o_APKGS", string.IsNullOrEmpty(txtAPiece.Text)?DBNull.Value:(object)txtAPiece.Text)
            .Append("o_CWM", string.IsNullOrEmpty(txtCWM.Text)?DBNull.Value:(object)txtCWM.Text)
            .Append("o_AWM", string.IsNullOrEmpty(txtAWM.Text)?DBNull.Value:(object)txtAWM.Text)
            .Append("o_Unit", CmbUnit.Value)
            .Append("o_LocFinal", cmbFinalDest.Text)
            .Append("o_LocPOL", cmbLoading.Value)
            .Append("o_LocPOD", cmbPort.Value)
            .Append("o_CFS", ControlBinder.getDate(txtCFSClosing.RawText.StartsWith("0001")?DBNull.Value:(object)txtCFSClosing.RawText))
            .Append("o_CY", ControlBinder.getDate(txtCYClosing.RawText.StartsWith("0001")?DBNull.Value:(object)txtCYClosing.RawText))
            .Append("o_ScheduleDate", ControlBinder.getDate(txtOnBoard.RawText.StartsWith("0001")?DBNull.Value:(object)txtOnBoard.RawText))
            .Append("o_ETD", ControlBinder.getDate(txtETD.RawText.StartsWith("0001")?DBNull.Value:(object)txtETD.RawText))
            .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_STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("o_SYS", SYS)
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("code", code)//FSecurityHelper.CurrentUserDataGET()[4]

            .Append("o_DeclareRemark", txtclpRemark.Text.ToUpper())
            .Append("o_AccountRemark", txtAccRemark.Text.ToUpper())
            .Append("o_Remark", txtMAWBRemark.Text.ToUpper())

            .Append("o_PreVesselID", cmbpreVessel.SelectedItem.Value)
            .Append("o_PreVoyageID", cmbpreVoyage.SelectedItem.Value)
            .Append("o_PreOnboard", ControlBinder.getDate(txtpreonboard.RawText.StartsWith("0001")?DBNull.Value:(object)txtpreonboard.RawText))
        }).GetTable();

        if (dt == null || dt.Rows.Count == 0)
        {
            ControlBinder.pageTitleMsg(false, "OE-M New", "<p class=\"error\">Status :  Save failed, please check the data .  </p>", div_bottom);
            return;
        }
        hidSeed.Text = dt.Rows[0]["o_Seed"].ToString();
        string lotno = dt.Rows[0]["o_LotNo"].ToString();

        #endregion

        #region Update  HBLList ,Local Invoice
        var    HBLList = JSON.Deserialize <List <HBL> >(e.ExtraParams["gridHBL"]);
        string RowID   = "0,";
        //List<IFields> listHBL = new List<IFields>();
        for (int i = 0; i < HBLList.Count; ++i)
        {
            //listHBL.Add(dal.CreateIFields().Append("Option", "UpdateHBLActReceipt")
            //   .Append("o_ROWID", HBLList[i].o_ROWID).Append("o_AReceiptDate", HBLList[i].ActReceipt==null ? null : ControlBinder.getDate((object)HBLList[i].ActReceipt))
            //   );
            RowID += HBLList[i].o_ROWID + ",";
        }
        RowID = RowID.Substring(0, RowID.Length - 1);

        bool hbl = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Delete_HBL").Append("o_MBL", txtMBL.Text.Trim().ToUpper())
            .Append("o_Seed", hidSeed.Text == ""?null:hidSeed.Text).Append("ROWID", RowID).Append("o_LotNo", lotno)
        }).Update();



        #endregion

        //update Data
        bool updatealldata = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "UpdateAllData")
            .Append("o_Seed", hidSeed.Text == ""?null:hidSeed.Text)
        }).Update();

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

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

        bool l = true;
        if (l)
        {
            if (i == 1)
            {
                hidSeed.Text = "";
                ControlBinder.pageTitleMsg(true, "OE-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"])
                {
                    ControlBinder.pageTitleMsg(true, "OE-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
                {
                    DataBinder();
                    ControlBinder.pageTitleMsg(true, "OE-M:" + labImpLotNo.Text, "<p class=\"success\">Status :  Record Saved with  <span>" + labImpLotNo.Text + " </span> </p>", div_bottom);
                }
            }
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OE-M:" + labImpLotNo.Text, "<p class=\"error\">Status :  Save failed, please check the data .  </p>", div_bottom);
        }
    }
コード例 #25
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);
    }
コード例 #26
0
    /// <summary>
    /// 数据绑定
    /// </summary>
    #region   ///Grid 数据绑定     Author:Micro   (2011-09-27)
    void DataBinder()
    {
        //tooltip.Html = ControlBinder.GetCostTotal(hidSeed.Text);
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "Single")
            .Append("o_Seed", hidSeed.Text == ""?null:hidSeed.Text)
            .Append("str", hidIDList.Text)
            .Append("o_STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("o_LocPOL", FSecurityHelper.CurrentUserDataGET()[4])
        }).GetList();



        if (ds != null && hidSeed.Text.Length > 1)
        {
            DataBinder(ds.Tables[0]);

            if (ds.Tables[1].Rows.Count > 0)
            {
                storeHBL.DataSource = ds.Tables[1];
                storeHBL.DataBind();
                double GWT = 0.000, Pieces = 0, CBM = 0.000, wm = 0.000;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    GWT    += Convert.ToDouble(ds.Tables[1].Rows[i]["o_WT"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_WT"].ToString());
                    Pieces += Convert.ToDouble(ds.Tables[1].Rows[i]["o_PKGS"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["o_PKGS"].ToString());
                    CBM    += Convert.ToDouble(ds.Tables[1].Rows[i]["o_CBM"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_CBM"].ToString());
                    wm     += Convert.ToDouble(ds.Tables[1].Rows[i]["o_WM"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_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();
                }
                totalPiece.Text = txtAPiece.Text;
                totalGWT.Text   = txtAGWT.Text;
                totalCBM.Text   = txtACBM.Text;
            }
            StoreInvoice.DataSource = ds.Tables[2];
            StoreInvoice.DataBind();
        }
        else if (ds != null && hidSeed.Text == "")
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                CmbUnit.Value             = ds.Tables[0].Rows[0]["Unit"].ToString();
                cmbPPD.SelectedItem.Value = ds.Tables[0].Rows[0]["PPD"].ToString();
                cmbLoading.Value          = ds.Tables[0].Rows[0]["Loading"].ToString();
                cmbShipperCode.setValue(ds.Tables[0].Rows[0]["Shipper"].ToString());
                cmbShipperCode.Text = ds.Tables[0].Rows[0]["ShipperName"].ToString();
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                storeHBL.DataSource = ds.Tables[1];
                storeHBL.DataBind();
                double GWT = 0.000, Pieces = 0, CBM = 0.000, wm = 0.000;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    GWT    += Convert.ToDouble(ds.Tables[1].Rows[i]["o_WT"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_WT"].ToString());
                    Pieces += Convert.ToDouble(ds.Tables[1].Rows[i]["o_PKGS"].ToString() == "" ? "0" : ds.Tables[1].Rows[i]["o_PKGS"].ToString());
                    CBM    += Convert.ToDouble(ds.Tables[1].Rows[i]["o_CBM"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_CBM"].ToString());
                    wm     += Convert.ToDouble(ds.Tables[1].Rows[i]["o_WM"].ToString() == "" ? "0.000" : ds.Tables[1].Rows[i]["o_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();
                }
                totalPiece.Text = txtAPiece.Text;
                totalGWT.Text   = txtAGWT.Text;
                totalCBM.Text   = txtACBM.Text;
            }
            ControlBinder.pageTitleMsg(false, "OE-M New", "<p>Status : New Blank  MBL. </p>", div_bottom);
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OE-M New", "<p>Status : New Blank  MBL. </p>", div_bottom);
        }

        //txtMBL.Focus(true);
        CmbGroup.Focus(true);
    }
コード例 #27
0
    /// <summary>
    /// Button 事件   修改保存
    /// </summary>
    #region    btnSave_Click()  修改保存   Author:Micro   (2011-09-05)
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        object job = ControlBinder.getDate(string.IsNullOrEmpty(txtJob.RawText.Trim()) ? DBNull.Value : (object)txtJob.RawText.Trim());
        object ETD = ControlBinder.getDate(string.IsNullOrEmpty(txtDepartDate.RawText.Trim()) ? DBNull.Value : (object)txtDepartDate.RawText.Trim());
        object ETA = ControlBinder.getDate(string.IsNullOrEmpty(txtArrivalDate.RawText.Trim()) ? DBNull.Value : (object)txtArrivalDate.RawText.Trim());

        if (cmbVesselCode.SelectedItem.Value == cmbVesselCode.SelectedItem.Text)
        {
            cmbVesselCode.SelectedItem.Value = "0";
        }
        if (cmbVesselText.SelectedItem.Value == cmbVesselText.SelectedItem.Text)
        {
            cmbVesselText.SelectedItem.Value = "0";
        }

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Other_Domestic_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("tri_Seed", hidSeed.Text == ""?null:hidSeed.Text)
            .Append("tri_MBL", txtMAWB.Text.Trim().ToUpper())
            .Append("tri_HBL", txtHAWB.Text.Trim().ToUpper())
            .Append("tri_VesselID", string.IsNullOrEmpty(cmbVesselCode.SelectedItem.Value)?"0":cmbVesselCode.SelectedItem.Value.Trim().ToUpper())
            .Append("tri_Vessel", string.IsNullOrEmpty(cmbVesselCode.SelectedItem.Text)?"":cmbVesselCode.SelectedItem.Text.Trim().ToUpper())
            .Append("tri_VoyageID", string.IsNullOrEmpty(cmbVesselText.SelectedItem.Value)?"0":cmbVesselText.SelectedItem.Value.Trim().ToUpper())
            .Append("tri_Voyage", string.IsNullOrEmpty(cmbVesselText.SelectedItem.Text)?"":cmbVesselText.SelectedItem.Text.Trim().ToUpper())
            .Append("tri_EReceipt", job)
            .Append("tri_ETD", ETD)
            .Append("tri_ETA", ETA)
            .Append("tri_LocReceived", string.IsNullOrEmpty(CmbDeparture.Value)?DBNull.Value:(object)CmbDeparture.Value.Trim().ToUpper())
            .Append("tri_LocFinal", string.IsNullOrEmpty(CmbDest.Value)?DBNull.Value:(object)CmbDest.Value.Trim().ToUpper())
            .Append("tri_LocReceivedL", txtDepL.Text.Trim().ToUpper())
            .Append("tri_LocFinalL", txtDesL.Text.Trim().ToUpper())
            .Append("tri_Sales", string.IsNullOrEmpty(CmbSalesman.Value)?DBNull.Value:(object)CmbSalesman.Value.Trim().ToUpper())
            .Append("tri_Container", string.IsNullOrEmpty(txtContainer.Text.Trim())?DBNull.Value:(object)txtContainer.Text.Trim())

            .Append("tri_Shipper", CmbShipperCode.Value.Trim().ToUpper())
            .Append("tri_ShipperLine", CmbShipperCode_name.Text.Trim().ToUpper())
            .Append("tri_Consignee", CmbConsigneeCode.Value.Trim().ToUpper())
            .Append("tri_ConsigneeLine", CmbConsigneeCode_name.Text.Trim().ToUpper())
            .Append("tri_PartyA", CmbNotify1Code.Value.Trim().ToUpper())
            .Append("tri_PartyALine", CmbNotify1Code_name.Text.Trim().ToUpper())
            .Append("tri_PartyB", CmbNotify2Code.Value.Trim().ToUpper())
            .Append("tri_PartyBLine", CmbNotify2Code_name.Text.Trim().ToUpper())
            .Append("tri_Carrier", CmbCarrierCode.Value.Trim().ToUpper())
            .Append("tri_CarrierLine", CmbCarrierCode_name.Text.Trim().ToUpper())
            .Append("tri_CoLoader", CmbCoLoader.Value.Trim().ToUpper())
            .Append("tri_CoLoaderLine", CmbCoLoader_name.Text.Trim().ToUpper())


            .Append("tri_GWT", string.IsNullOrEmpty(txtGWT.Text.Trim())?DBNull.Value:(object)txtGWT.Text)
            .Append("tri_CBM", string.IsNullOrEmpty(txtCBM.Text.Trim())?DBNull.Value:(object)txtCBM.Text)
            .Append("tri_CWT", string.IsNullOrEmpty(txtCWT.Text.Trim())?DBNull.Value:(object)txtCWT.Text)
            .Append("tri_Piece", string.IsNullOrEmpty(txtPiece.Text.Trim())?DBNull.Value:(object)txtPiece.Text)
            .Append("tri_Unit", CmbUnit.Value)

            .Append("tri_LastUser", FSecurityHelper.CurrentUserDataGET()[0].ToString())
            .Append("tri_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
            .Append("tri_SYS", "DM")
            .Append("tri_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
            .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + "DM")
            .Append("tri_Remark", string.IsNullOrEmpty(txtMAWBRemark.Text) ? "" : txtMAWBRemark.Text.ToUpper())
        }).GetTable();

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



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

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

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

        if (dt != null)
        {
            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "DM", "");
            ControlBinder.pageTitleMsg(true, "Domestic Shipment:" + 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][0].ToString()))
            {
                X.Redirect("List.aspx?seed=" + dt.Rows[0][0]);
            }
            else
            {
                DataBinder();
            }
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "Domestic Shipment:" + labLotNo.Text, "<p class=\"error\">Status :  Saved  failed ! ! !  </p>", div_bottom);
        }

        txtMAWB.Focus(true);
    }
コード例 #28
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);
        }
    }
コード例 #29
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        if (string.IsNullOrEmpty(txtHawb.Text))
        {
            div_bottom.Html = "<p class='error'> Save failed, HAWB can't be empty  ! ! !</p>";
            txtHawb.Focus(true);
            return;
        }

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

        UpdateHAWB.Add(dal.CreateIFields().Append("Option", "UpdateHAWB")
                       .Append("air_Seed", hidSeed.Text)
                       .Append("air_ToMAWB", hidMAWB.Text)
                       .Append("air_LotNo", "")

                       .Append("air_HAWB", txtHawb.Text.Trim().ToUpper())
                       .Append("air_CompanyReferance", txtReference.Text.Trim().ToUpper())
                       .Append("imp_Clearance", txtClearance.Text.Trim().ToUpper())
                       .Append("air_Insurance", chkInsurance.Checked)

                       .Append("air_LocReceived", CmbReceipt.Value)
                       .Append("air_LocFinal", CmbFinalDest.Value)
                       .Append("air_Sales", CmbSalesman.Value)
                       .Append("air_DG", chkDG.Checked)
                       .Append("imp_Surrender", chkSurrender.Checked)

                       .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_CoLoader", CmbCoLoader.Value)
                       //.Append("air_CoLoader", CmbCoLoaderName.SelectedItem.Value)
                       .Append("air_Broker", CmbBroker.Value)
                       //.Append("air_Broker", CmbBrokerName.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("imp_Warehouse", CmbWarehouse.Value)
                       //.Append("imp_Warehouse", CmbWarehouseName.SelectedItem.Value)
                       .Append("imp_StorageFrom", ControlBinder.getDate(txtFreeStorageStart.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFreeStorageStart.RawText))
                       .Append("imp_StorageTo", ControlBinder.getDate(txtFreeStorageEnd.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFreeStorageEnd.RawText))
                       .Append("imp_FreeDays", NumFreeStorage.Text.Trim().ToUpper().StartsWith("-1") ? DBNull.Value : (object)NumFreeStorage.Text)
                       .Append("imp_PickupDate", ControlBinder.getDate(txtPickUp.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtPickUp.RawText))

                       .Append("air_Remark", txtRemark.Text.Trim())
                       .Append("code", FSecurityHelper.CurrentUserDataGET()[4].ToString() + SYS)
                       .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                       .Append("air_SYS", SYS)//FSecurityHelper.CurrentUserDataGET()[11].ToString()[0])
                       .Append("User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                       );
        try
        {
            DataSet ds = GetDs("FW_AirImport_Joblist_SP", UpdateHAWB);
            hidSeed.Text = ds.Tables[0].Rows[0][0].ToString();
            string newFlag = ds.Tables[0].Rows[0][1].ToString();


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

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

            #region ForeignInvoice
            var            ForeignInvoice     = JSON.Deserialize <List <ForeignInvoice> >(e.ExtraParams["p_safety_2"]);
            List <IFields> ForeignInvoicelist = new List <IFields>();
            string         ForeignInvoiceID   = "";
            for (int i = 0; i < ForeignInvoice.Count; ++i)
            {
                ForeignInvoicelist.Add(dal.CreateIFields().Append("Option", "Update").
                                       Append("inv_Payment", ForeignInvoice[i].Kind.Trim().ToUpper()).
                                       Append("inv_InvoiceDate", ControlBinder.getDate(ForeignInvoice[i].Date.ToString().StartsWith("0001") ? DBNull.Value : (object)ForeignInvoice[i].Date)).
                                       Append("inv_InvoiceNo", ForeignInvoice[i].DN_CNNO.Trim().ToUpper()).
                                       Append("inv_CompanyCode", ForeignInvoice[i].CompanyCode.Trim().ToUpper()).
                                       Append("inv_CompanyName", ForeignInvoice[i].CompanyName.ToUpper()).
                                       Append("inv_Currency", ForeignInvoice[i].Currency.Trim().ToUpper()).
                                       Append("inv_Total", string.IsNullOrEmpty(ForeignInvoice[i].Amount) ? DBNull.Value : (object)ForeignInvoice[i].Amount).
                                       Append("inv_RowID", ForeignInvoice[i].RowID)
                                       .Append("inv_ToHouse", hidSeed.Text)
                                       .Append("inv_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                       .Append("inv_Sys", SYS)
                                       .Append("inv_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                       );
                ForeignInvoiceID += "," + ForeignInvoice[i].RowID;
            }
            //delete
            if (ForeignInvoiceID.Length > 1)
            {
                ForeignInvoiceID = ForeignInvoiceID.Substring(1, ForeignInvoiceID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActual").Append("inv_Seed", hidSeed.Text).Append("str", ForeignInvoiceID)
            }).Update();
            bool resultForeignInvoice = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", ForeignInvoicelist).Update();
            #endregion

            #region LocalDeliveryRoute
            var            LocalDeliveryRoute     = JSON.Deserialize <List <LocalDeliveryRoute> >(e.ExtraParams["p_safety_3"]);
            List <IFields> LocalDeliveryRoutelist = new List <IFields>();
            string         LocalDeliveryRouteID   = "";
            for (int i = 0; i < LocalDeliveryRoute.Count; ++i)
            {
                LocalDeliveryRoutelist.Add(dal.CreateIFields().Append("Option", "Update").
                                           Append("sr_ShipKind", LocalDeliveryRoute[i].Kind.Trim().ToUpper()).
                                           Append("sr_Carrier", LocalDeliveryRoute[i].CompanyCode.Trim().ToUpper()).
                                           //Append("sr_Carrier", LocalDeliveryRoute[i].CompanyName).
                                           Append("sr_To", LocalDeliveryRoute[i].Dest.Trim().ToUpper()).
                                           Append("sr_Voyage", LocalDeliveryRoute[i].Voyage.Trim().ToUpper()).
                                           Append("sr_ETD", ControlBinder.getDate(LocalDeliveryRoute[i].ETD.ToString().StartsWith("0001") ? DBNull.Value : (object)LocalDeliveryRoute[i].ETD)).
                                           Append("sr_ETA", ControlBinder.getDate(LocalDeliveryRoute[i].ETA.ToString().StartsWith("0001") ? DBNull.Value : (object)LocalDeliveryRoute[i].ETA)).
                                           Append("sr_RowID", LocalDeliveryRoute[i].RowID)
                                           .Append("sr_ToHouse", hidSeed.Text)
                                           .Append("sr_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                           .Append("sr_Sys", SYS)
                                           .Append("sr_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                           );
                LocalDeliveryRouteID += "," + LocalDeliveryRoute[i].RowID;
            }
            //delete
            if (LocalDeliveryRouteID.Length > 1)
            {
                LocalDeliveryRouteID = LocalDeliveryRouteID.Substring(1, LocalDeliveryRouteID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentRoute_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActual").Append("sr_Seed", hidSeed.Text).Append("str", LocalDeliveryRouteID)
            }).Update();
            bool resultLocalDeliveryRoute = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentRoute_SP", LocalDeliveryRoutelist).Update();
            #endregion

            #region ContactInformation
            var            ContactInformation     = JSON.Deserialize <List <ContactInformation> >(e.ExtraParams["p_safety_4"]);
            List <IFields> ContactInformationlist = new List <IFields>();
            string         ContactinformationID   = "";
            for (int i = 0; i < ContactInformation.Count; ++i)
            {
                ContactInformationlist.Add(dal.CreateIFields().Append("Option", "Update").
                                           Append("sc_Type", ContactInformation[i].Kind.Trim().ToUpper()).
                                           Append("sc_Company", ContactInformation[i].CompanyCode.Trim().ToUpper()).
                                           //Append("sc_Company", ContactInformation[i].CompanyName).
                                           Append("sc_Dept", ContactInformation[i].Dept.Trim().ToUpper()).
                                           Append("sc_RowID", ContactInformation[i].RowID)
                                           .Append("sc_ToHouse", hidSeed.Text)
                                           .Append("sc_Stat", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                                           .Append("sc_Sys", SYS)
                                           .Append("sc_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                                           );
                ContactinformationID += "," + ContactInformation[i].RowID;
            }
            //delete
            if (ContactinformationID.Length > 1)
            {
                ContactinformationID = ContactinformationID.Substring(1, ContactinformationID.Length - 1);
            }
            dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentContact_SP", new List <IFields> {
                dal.CreateIFields().Append("Option", "DeleteActual").Append("sc_Seed", hidSeed.Text).Append("str", ContactinformationID)
            }).Update();
            bool resultContactInformation = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_ShipmentContact_SP", ContactInformationlist).Update();
            #endregion

            //update cost(Qty,unit,total)
            //ControlBinder.UpdateCostData(hidSeed.Text, "AI", "HAWB");
            if (newFlag == "N")
            {
                ControlBinder.pageTitleMsg(true, "AI-H:" + labLotNo.Text, "<p class=\"success\">Status :   Saved successfully  ! ! ! </p>", div_bottom);
            }
            else
            {
                X.Redirect("hawb.aspx?seed=" + ds.Tables[0].Rows[0][0] + "&MAWB=" + hidMAWB.Value);
            }

            ControlBinder.pageTitleMsg(true, "AI-H:" + labLotNo.Text, "<p class=\"success\">Status :   Saved successfully  ! ! ! </p>", div_bottom);
        }
        catch
        {
            ControlBinder.pageTitleMsg(false, "AI-H:" + labLotNo.Text, "<p class=\"error\">Status : Save failed, please check the data .</p>", div_bottom);
        }
    }
コード例 #30
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);
        }
    }