Exemple #1
0
 void DataBinder()
 {
     try
     {
         DataFactory dal = new DataFactory();
         DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Other_ShipmentList_SP", new List <IFields>()
         {
             dal.CreateIFields()
             .Append("Option", "GetList")
             .Append("tri_MBL", txtMBL.Text.Trim())
             //.Append("tri_HBL", txtHBL.Text.Trim())
             .Append("tri_LotNo", txtLotNo.Text.Trim())
             .Append("tri_Shipper", txtShipper.Text.Trim())
             //.Append("tri_Consignee", txtCNEE.Text.Trim())
             .Append("tri_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
             .Append("From", ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText)?"1900/01/01":(object)txtFrom.RawText))
             .Append("To", ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText)?DateTime.Now.AddYears(1).ToString("yyyy/MM/dd"):(object)txtTo.RawText))
             .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
             .Append("tri_Active", chbVoid.Checked?"1":"0")//2014-12-16 Grace (修改查询条件)
             .Append("tri_LocFinal", txtDest.Text.Trim())
         }).GetList();
         storeList.DataSource = ds;
         storeList.DataBind();
         if (FSecurityHelper.CurrentUserDataGET()[27].ToString().ToUpper() == "MANAGER")
         {
             gridList.ColumnModel.SetHidden(12, false);
             gridList.ColumnModel.SetColumnWidth(4, 73);
             gridList.ColumnModel.SetColumnWidth(5, 73);
         }
     }
     catch
     {
     }
 }
    void DataBinder()
    {
        try
        {
            DataFactory dal = new DataFactory();
            DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Ocean_OIJobList_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "OIJobList")
                .Append("LotNo", txtLotNo.Text.Trim())
                .Append("MBL", txtMBL.Text.Trim())
                .Append("POL", txtPOL.Text.Trim())
                //.Append("POD", txtPOD.Text.Trim())
                .Append("Vessel", txtVessel.Text.Trim())
                .Append("From", ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText)?"1900/01/01":(object)txtFrom.RawText))
                .Append("To", ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText)?DateTime.Now.AddYears(1).ToString("yyyy/MM/dd"):(object)txtTo.RawText))
                .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("SYS", "OI")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("o_Shipper", txtShipper.Text.Trim())//2014-12-18 Grace (修改查询条件)
                .Append("o_Active", chbVoid.Checked?"1":"0")
            }).GetList();
            storeList.DataSource = ds;
            storeList.DataBind();

            if (FSecurityHelper.CurrentUserDataGET()[27].ToString().ToUpper() == "MANAGER")
            {
                gridList.ColumnModel.SetHidden(13, false);
                gridList.ColumnModel.SetColumnWidth(7, 68);
            }
        }
        catch
        {
        }
    }
    void DataBinder()
    {
        try
        {
            DataFactory dal = new DataFactory();
            DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "AssignJobList")
                .Append("o_LotNo", txtLotNo.Text.Trim())
                .Append("o_MBL", txtMBL.Text.Trim())
                .Append("o_LocFinal", txtDest.Text.Trim())
                .Append("o_ETD", ControlBinder.getDate(string.IsNullOrEmpty(txtETDFrom.RawText)?"1900-01-01":(object)txtETDFrom.RawText))
                .Append("o_ETA", ControlBinder.getDate(string.IsNullOrEmpty(txtETDTo.RawText)?DateTime.MaxValue.ToString("yyyy/MM/dd"):(object)txtETDTo.RawText))
                .Append("o_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("o_SYS", "OE")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("o_Shipper", txtShipper.Text.Trim())//2014-12-16 Grace (修改查询条件)
                .Append("o_Active", chbVoid.Checked?"1":"0")
                .Append("User", cmbOP.Text)
            }).GetList();
            storeList.DataSource = ds;
            storeList.DataBind();

            if (FSecurityHelper.CurrentUserDataGET()[27].ToString().ToUpper() == "MANAGER")
            {
                gridList.ColumnModel.SetHidden(16, false);
                gridList.ColumnModel.SetColumnWidth(6, 68);
            }
        }
        catch
        {
        }
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object ETD    = ControlBinder.getDate(string.IsNullOrEmpty(txtETDFrom.RawText) ? "1900/01/01" : (object)txtETDFrom.RawText);
        object ETA    = ControlBinder.getDate(string.IsNullOrEmpty(txtETDTo.RawText) ? DateTime.Now.AddYears(1).ToString("yyyy/MM/dd") : (object)txtETDTo.RawText);
        string param  = "sys=OE&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim()) + "&MBL=" + Server.UrlEncode(txtMBL.Text.Trim()) + "&Dest=" + Server.UrlEncode(txtDest.Text.Trim()) + "&ETD=" + Server.UrlEncode(ETD.ToString()) + "&ETA=" + Server.UrlEncode(ETA.ToString()) + "&Shipper=" + Server.UrlEncode(txtShipper.Text.Trim());
        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
Exemple #5
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "Update")
            .Append("cxh_ROWID", hidID.Text)
            .Append("cxh_Company", cmbShipperCode.Value)
            .Append("cxh_Date", ControlBinder.getDate(txtDate.RawText.StartsWith("0001")?DBNull.Value:(object)txtDate.RawText))
            .Append("cxh_Amount", string.IsNullOrEmpty(txtAmount.Text)?DBNull.Value:(object)txtAmount.Text)
            .Append("cxh_InvoiceNo", txtInv.Text.Trim().ToUpper())
            .Append("cxh_User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("stat", FSecurityHelper.CurrentUserDataGET()[12])
        }).GetList();

        hidHeadSeed.Text = ds.Tables[0].Rows[0][0].ToString();

        var            CostList    = JSON.Deserialize <List <Cost> >(e.ExtraParams["gridList"]);
        string         RowID       = "";
        List <IFields> listCosting = new List <IFields>();

        for (int i = 0; i < CostList.Count; ++i)
        {
            listCosting.Add(dal.CreateIFields().Append("Option", "UpdateDetail").
                            Append("cxd_Seed", hidHeadSeed.Text).
                            Append("cxd_LotSeed", CostList[i].cxd_LotSeed).
                            Append("cxd_Sys", CostList[i].cxd_Sys).
                            Append("cxd_LotNo", CostList[i].cxd_LotNo.Trim().ToUpper()).
                            Append("cxd_Master", CostList[i].cxd_Master.Trim().ToUpper()).
                            Append("cxd_House", CostList[i].cxd_House.Trim().ToUpper())
                            .Append("cxd_ROWID", CostList[i].cxd_ROWID)
                            .Append("cxd_User", FSecurityHelper.CurrentUserDataGET()[0].ToString())
                            .Append("stat", FSecurityHelper.CurrentUserDataGET()[12])
                            );
            RowID += "," + CostList[i].cxd_ROWID;
        }
        if (RowID.Length > 1)
        {
            RowID = RowID.Substring(1, RowID.Length - 1);
        }
        dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", new List <IFields> {
            dal.CreateIFields().Append("Option", "DeleteDetail").Append("cxd_Seed", hidHeadSeed.Text).Append("str", RowID)
        }).Update();
        bool resultCost = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", listCosting).Update();

        if (hidID.Text == "0")
        {
            //this.parent.winCombineCostDetail.close();
            X.AddScript("this.parent.window.loadCost();this.parent.winCombineCostDetail.close();");
        }
        else
        {
            DataBinder();
        }
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object from = ControlBinder.getDate(string.IsNullOrEmpty(txtDate.RawText.Trim()) ? "1900/01/01" : (object)txtDate.RawText.Trim());
        object to   = ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText.Trim()) ? DateTime.MaxValue : (object)txtTo.RawText.Trim());

        string param  = "sys=DO&Company=" + ((string.IsNullOrEmpty(ACCompany.Value))? "": ACCompany.Value.Trim()) + "&do_Active=" + (chbVoid.Checked ? "1" : "0") + "&Date=" + Server.UrlEncode(from.ToString()) + "&TO=" + Server.UrlEncode(to.ToString());
        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
    /// <summary>
    /// 添加Invoice
    /// </summary>
    #region    btnAddNewInvoice_Click(object,DirectEventArgs)    Author:Micro   (2011-09-28)
    //protected void btnAddNewInvoice_Click(object sender, DirectEventArgs e)
    //{
    //    if (string.IsNullOrEmpty(CmbCompanyRightCode.Text) || string.IsNullOrEmpty(CmbCurrencyRight.Text))
    //    {
    //        X.Msg.Alert("Stauts", " Input can't for empty ! ! ! ", new JFunction { Handler = "Ext.get('CmbCompanyRightCode').focus()" }).Show();
    //        return;
    //    }
    //    //sys=AI&M=1932777&Company=3VIETECTW01&Currency=USD&rate=7.750&FL=F
    //    string url = "../../AirImport/AIShipmentJobList/invoice.aspx?sys=OI&M=" + Request["seed"] + "&Company=" + CmbCompanyRightCode.Value + "&Currency=" + CmbCurrencyRight.Text + "&rate=" + txtcur_Rate.Text + "&FL=" + (radForeign.Checked ? "F" : "L");
    //    X.Js.AddScript("window.open('" + url + "','_blank')");
    //}

    /// <summary>
    /// 选择是否本地货币
    /// </summary>
    //protected void CmbCurrencyRight_Select(object sender, DirectEventArgs e)
    //{
    //    DataTable ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Invoice_SP", new List<IFields>() { dal.CreateIFields().
    //            Append("Option", "Currency").
    //            Append("inv_Stat", FSecurityHelper.CurrentUserDataGET()[12]).
    //            Append("cur_code",CmbCurrencyRight.Text).
    //            Append("inv_Sys",FSecurityHelper.CurrentUserDataGET()[11][0]) }).GetTable();
    //    if (ds != null && ds.Rows.Count > 0)
    //    {
    //        radForeign.Checked = Convert.ToBoolean(ds.Rows[0][0]);
    //        radLocal.Checked = Convert.ToBoolean(ds.Rows[0][1]);
    //        txtcur_Rate.Text = ds.Rows[0][2].ToString();
    //    }
    //}
    #endregion


    public void txtFreeStoregeStart_Blur(object sender, DirectEventArgs e)
    {
        string freeStoreage = ControlBinder.getDate(txtFreeStorageStart.RawText).ToString();

        //X.Msg.Alert("Title", freeStoreage).Show();
        if (!string.IsNullOrEmpty(freeStoreage))
        {
            DateTime dt = Convert.ToDateTime(freeStoreage);
            dt = dt.AddDays(2);
            txtFreeStorageEnd.Text = dt.ToString("yyyy-MM-d");
        }
    }
Exemple #8
0
    public void JobDataBinding()
    {
        //DataFactory dal = new DataFactory();
        //DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AllSystem_Reference_SP", new List<IFields>() {
        //    dal.CreateIFields()
        //    .Append("Option", "DataBinder")
        //    .Append("Stat",FSecurityHelper.CurrentUserDataGET()[12])
        //    .Append("SYS",hidsys.Text)
        //    .Append("Shipper",cmbShipperCode.Value)
        //    .Append("Consignee",cmbConsigneeCode.Value)
        //    .Append("DateFrom",ControlBinder.getDate(txtETDFrom.RawText.StartsWith("0001")?DBNull.Value:(object)txtETDFrom.RawText))
        //    .Append("DateTo",ControlBinder.getDate(txtETDTo.RawText.StartsWith("0001")?DBNull.Value:(object)txtETDTo.RawText))
        //    .Append("Dest",cmbDest.Value)
        //    .Append("Sales",cmbSalesman.Value)
        //    .Append("JobNo",txtJobNo.Text.Trim())
        //    .Append("Master",txtMBL.Text)
        //    .Append("House",txtHBL.Text)
        //    .Append("Vessel",txtVessel.Text.Trim())
        //    .Append("Voyage",txtVoyage.Text.Trim())
        //    .Append("Container",txtContainer.Text.Trim())
        //    .Append("Coloader",CmbColoader.Value)
        //}).GetList();

        string[] nums = new string[18] {
            "Option", "Stat", "SYS", "Shipper", "Consignee", "DateFrom", "DateTo", "Dest", "Sales", "JobNo", "Master", "House", "Vessel", "Voyage", "Container", "Coloader", "active", "VerifyNo"
        };
        object[] values = new object[18];
        values[0]  = "GetJobData"; // DataBinder
        values[1]  = FSecurityHelper.CurrentUserDataGET()[12];
        values[2]  = hidsys.Text;
        values[3]  = cmbShipperCode.Value;
        values[4]  = cmbConsigneeCode.Value;
        values[5]  = ControlBinder.getDate(txtETDFrom.RawText.StartsWith("0001")?DBNull.Value:(object)txtETDFrom.RawText);
        values[6]  = ControlBinder.getDate(txtETDTo.RawText.StartsWith("0001")?DBNull.Value:(object)txtETDTo.RawText);
        values[7]  = cmbDest.Value == null?"":cmbDest.Value;
        values[8]  = cmbSalesman.Value == null?"":cmbSalesman.Value;
        values[9]  = txtJobNo.Text.Trim();
        values[10] = txtMBL.Text.Trim();
        values[11] = txtHBL.Text.Trim();
        values[12] = txtVessel.Text.Trim();
        values[13] = txtVoyage.Text.Trim();
        values[14] = txtContainer.Text.Trim();
        values[15] = CmbColoader.Value;
        values[16] = chkVoid.Checked ? 0 : 1;
        values[17] = txtVerifyNo.Text.Trim();

        //txtMBL.Text = DateTime.Now.ToString("HH:mm:ss.fff");
        DataSet ds = PageHelper.GetDs("FW_AllSystem_Reference_SP", nums, values);

        //txtHBL.Text = DateTime.Now.ToString("HH:mm:ss.fff");
        gridReference.GetStore().DataSource = ds;
        gridReference.GetStore().DataBind();
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object From = ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText) ? "1900/01/01" : (object)txtFrom.RawText);
        object To   = ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText) ? DateTime.Now.AddYears(1).ToString("yyyy/MM/dd") : (object)txtTo.RawText);
        //2014-12-18 Grace (修改查询条件)
        //string param = "sys=OI&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim()) + "&MBL=" + Server.UrlEncode(txtMBL.Text.Trim()) + "&POL=" + Server.UrlEncode(txtPOL.Text.Trim()) + "&POD=" + Server.UrlEncode(txtPOD.Text.Trim());
        string param = "sys=OI&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim()) + "&MBL=" + Server.UrlEncode(txtMBL.Text.Trim()) + "&POL=" + Server.UrlEncode(txtPOL.Text.Trim()) + "&Shipper=" + Server.UrlEncode(txtShipper.Text.Trim());

        param += "&Vessel=" + Server.UrlEncode(txtVessel.Text.Trim()) + "&From=" + Server.UrlEncode(From.ToString()) + "&To=" + Server.UrlEncode(To.ToString());
        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
    void DataBinder()
    {
        txtHawb.Focus(true);
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ConsolManagement_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "List")
            .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12]).Append("air_HAWB", txtHawb.Text.Trim()).Append("air_Shipper", txtShipper.Text.Trim()).Append("air_BookNo", txtRef.Text.Trim())
            .Append("air_ETD", ControlBinder.getDate(txtDateFrom.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtDateFrom.RawText.Trim())).Append("air_Active", chkVoid.Checked?0:1)
        }).GetList();

        storeList.DataSource = ds;
        storeList.DataBind();
    }
Exemple #11
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object From = ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText) ? "1900/01/01" : (object)txtFrom.RawText);
        object To   = ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText) ? DateTime.Now.AddYears(1).ToString("yyyy/MM/dd") : (object)txtTo.RawText);
        //string param = "sys=OB&Shipper=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&MBL=" + Server.UrlEncode(txtMBL.Text.Trim().Replace(" ", "")) + "&HBL=" +Server.UrlEncode(txtHBL.Text.Trim()) + "&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim());
        //param += "&Consignee=" +Server.UrlEncode(txtCNEE.Text.Trim()) + "&From=" + Server.UrlEncode(From.ToString()) + "&To=" + Server.UrlEncode(To.ToString());

        string param = "sys=OB&Shipper=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&MBL=" + Server.UrlEncode(txtMBL.Text.Trim().Replace(" ", "")) + "&HBL=" + Server.UrlEncode(txtMBL.Text.Trim()) + "&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim());

        param += "&Consignee=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&From=" + Server.UrlEncode(From.ToString()) + "&To=" + Server.UrlEncode(To.ToString()) + "&Dest=" + Server.UrlEncode(txtDest.Text.Trim());
        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
Exemple #12
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object from = ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText) ? "1900/01/01" : (object)txtFrom.RawText);
        object to   = ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText) ? DateTime.Now.AddYears(1).ToString("yyyy/MM/dd") : (object)txtTo.RawText);

        //2014-12-16 Grace (修改查询条件)
        //string param = "sys=AI&air_Shipper=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&air_MAWB=" + Server.UrlEncode(txtMawb.Text.Trim().Replace(" ", "")) + "&air_LocLoad=" + Server.UrlEncode(cmbFrom.Text.Trim()) + "&air_Normal=" + (chbNormal.Checked ? "1" : "0") + "&air_IsDirect=" + (chbDirect.Checked ? "1" : "0");
        string param = "sys=AI&air_Shipper=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&air_MAWB=" + Server.UrlEncode(txtMawb.Text.Trim().Replace(" ", "")) + "&air_LocLoad=" + Server.UrlEncode(txtDest.Text.Trim()) + "&air_Normal=" + (chbNormal.Checked ? "1" : "0") + "&air_IsDirect=" + (chbDirect.Checked ? "1" : "0");

        param += "&air_Status=" + (chbClosed.Checked ? "10" : "0") + "&air_Active=" + (chbVoid.Checked ? "1" : "0") + "&from=" + Server.UrlEncode(from.ToString()) + "&to=" + Server.UrlEncode(to.ToString()) + "&lotNo=" + Server.UrlEncode(txtLotNo.Text.Trim());
        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        object ETD   = ControlBinder.getDate(txtFlightFrom.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFlightFrom.RawText.Trim());
        object ETA   = ControlBinder.getDate(txtFlightTo.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFlightTo.RawText.Trim());
        string param = "sys=AE&MAWB=" + Server.UrlEncode(txtMAWB.Text.Replace(" ", "").Trim()) + "&LotNo=" + Server.UrlEncode(txtLotNo.Text.Trim().Replace(" ", "")) + "&Dest=" + Server.UrlEncode(txtDest.Text.Trim());

        //2014-12-16 Grace (修改查询条件)
        //param += "&ETD=" + Server.UrlEncode(ETD.ToString()) + "&ETA=" + Server.UrlEncode(ETA.ToString()) + "&Shipper=" + Server.UrlEncode(cmbShipperCode.Value) + "&Consignee=" + Server.UrlEncode(cmbConsigneeCode.Value);
        //param += "&Coloader=" + Server.UrlEncode(cmbColoader.Value);
        param += "&ETD=" + Server.UrlEncode(ETD.ToString()) + "&ETA=" + Server.UrlEncode(ETA.ToString()) + "&Shipper=" + Server.UrlEncode(txtShipper.Text.Trim()) + "&Consignee=" + Server.UrlEncode(txtShipper.Text.Trim());
        param += "&Coloader=" + Server.UrlEncode(txtColoader.Text.Trim());

        string script = "window.open('/AllSystem/PrintLotList.aspx?" + param + "','_blank')";

        X.AddScript(script);
    }
    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();
        }
    }
Exemple #15
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();
        }
    }
Exemple #16
0
    void DataBinder()
    {
        try
        {
            DataSet dsDO = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_DeliveryOrder_Pool_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "List")
                .Append("do_OrderDate", ControlBinder.getDate(string.IsNullOrEmpty(txtDate.RawText.Trim()) ? "1900/01/01" : (object)txtDate.RawText.Trim()))
                .Append("do_OrderTo", ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText.Trim()) ? DateTime.MaxValue : (object)txtTo.RawText.Trim()))
                .Append("do_Company", string.IsNullOrEmpty(ACCompany.Value) ? "": ACCompany.Value.Trim())
                .Append("DO", txtDO.Text.Trim())
                .Append("do_Stat", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("pageSize", pageSize)
                .Append("pageIndex", CurrentPageIndex)
            }).GetList();


            PageCount = (Int32)dsDO.Tables[1].Rows[0]["pcount"];
            startNum  = (CurrentPageIndex - 1) * pageSize + 1;
            totalNum  = (Int32)dsDO.Tables[1].Rows[0]["tcount"];
            if (CurrentPageIndex > PageCount)
            {
                CurrentPageIndex = PageCount;
            }
            if (CurrentPageIndex == PageCount && totalNum % pageSize != 0)
            {
                endNum = (CurrentPageIndex - 1) * pageSize + totalNum % pageSize;
            }
            else
            {
                endNum = CurrentPageIndex * pageSize;
            }

            RepListDO.DataSource = dsDO.Tables[0];
            RepListDO.DataBind();
        }
        catch
        {
        }
    }
Exemple #17
0
    void DataBinder()
    {
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Ocean_OIJobList_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "OIJobList")
            .Append("LotNo", txtLotNo.Text.Trim())
            .Append("MBL", txtMBL.Text.Trim())
            .Append("POL", txtPOL.Text.Trim())
            .Append("POD", txtPOD.Text.Trim())
            .Append("Vessel", txtVessel.Text.Trim())
            .Append("ETD", ControlBinder.getDate(txtETD.RawText.StartsWith("0001")?DBNull.Value:(object)txtETD.RawText))
            .Append("ETA", ControlBinder.getDate(txtETA.RawText.StartsWith("0001")?DBNull.Value:(object)txtETA.RawText))
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
            .Append("SYS", "OI")
        }).GetList();

        storeList.DataSource = ds;
        storeList.DataBind();
    }
    void Binder()
    {
        object status    = cmbStatus.Value ?? "0";
        object BeginDate = ControlBinder.getDate(txtBeginDate.RawText == "" ? "01/01/1900" : (object)txtBeginDate.RawText.Trim());
        object EndDate   = ControlBinder.getDate(txtEndDate.RawText == "" ? DateTime.Now.AddDays(1).ToString("dd/MM/yyyy") : (object)txtEndDate.RawText.Trim());

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_CLP_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "filter")
            .Append("M", txtMHno.Text)
            .Append("stat", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("vv_VerifyNo", txtSheetNo.Text)
            .Append("lotno", txtLotno.Text)
            .Append("status", status)
            .Append("vv_ReceivedDate", BeginDate)
            .Append("vv_ReturnedDate", EndDate)
        }).GetTable();

        storeList.DataSource = dt;
        storeList.DataBind();
    }
Exemple #19
0
    /// <summary>
    /// Grid 绑定
    /// </summary>
    #region  DataBinder()   Author:Micro  (2011-09-01)
    void DataBinder()
    {
        try
        {
            object from = ControlBinder.getDate(string.IsNullOrEmpty(txtFrom.RawText) ? "1900/01/01" : (object)txtFrom.RawText);
            object to   = ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText) ? DateTime.Now.AddYears(1).ToString("yyyy/MM/dd") : (object)txtTo.RawText);

            DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Joblist_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "List")
                .Append("from", from)
                .Append("to", to)
                .Append("air_LotNo", txtLotNo.Text.Trim())
                .Append("air_SYS", "AI")
                .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("air_Shipper", txtShipper.Text.Trim())
                .Append("air_MAWB", txtMawb.Text.Trim().Replace(" ", ""))
                //.Append("air_LocLoad", cmbFrom.Text.Trim())
                .Append("air_LocLoad", txtDest.Text.Trim()) //2014-12-16 Grace (修改查询条件)
                .Append("air_Normal", chbNormal.Checked?1:0)
                .Append("air_IsDirect", chbDirect.Checked?"1":"0")
                .Append("air_Status", chbClosed.Checked?"10":"0")
                .Append("air_Active", chbVoid.Checked?"1":"0")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
            }).GetList();
            storeList.DataSource = ds;
            storeList.DataBind();
            if (FSecurityHelper.CurrentUserDataGET()[27].ToString().ToUpper() == "MANAGER")
            {
                gridList.ColumnModel.SetHidden(15, false);
                gridList.ColumnModel.SetColumnWidth(4, 74);
                gridList.ColumnModel.SetColumnWidth(5, 80);
            }
        }
        catch
        {
        }
    }
    void DataBinder()
    {
        txtLotNo.Focus();
        tp.SetFocusAtLast("txtLotNo");
        try
        {
            bool        a   = txtFlightFrom.RawText.Trim().ToUpper().StartsWith("0001");
            DataFactory dal = new DataFactory();

            DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ViewConsol_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "List")
                .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12]).Append("air_MAWB", txtMAWB.Text.Replace(" ", "").Trim()).Append("air_LotNo", txtLotNo.Text.Trim())
                .Append("air_LocFinal", txtDest.Text.Trim()).Append("air_ETD", ControlBinder.getDate(txtFlightFrom.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFlightFrom.RawText.Trim()))
                .Append("air_ETA", ControlBinder.getDate(txtFlightTo.RawText.Trim().ToUpper().StartsWith("0001") ? DBNull.Value : (object)txtFlightTo.RawText.Trim()))
                //2014-12-16 Grace (修改查询条件)
                //.Append("air_Shipper",cmbShipperCode.Value)
                //.Append("air_Consignee",cmbConsigneeCode.Value)
                .Append("air_Shipper", txtShipper.Text.Trim())
                .Append("air_CoLoader", txtColoader.Text.Trim())
                .Append("air_Active", chbVoid.Checked?"1":"0")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
            }).GetList();

            storeList.DataSource = ds;
            storeList.DataBind();

            if (FSecurityHelper.CurrentUserDataGET()[27].ToString().ToUpper() == "MANAGER")
            {
                gridList.ColumnModel.SetHidden(14, false);
                gridList.ColumnModel.SetColumnWidth(8, 70);
                gridList.ColumnModel.SetColumnWidth(9, 70);
                gridList.ColumnModel.SetColumnWidth(10, 70);
            }
        }
        catch
        {
        }
    }
Exemple #21
0
    void DataBinder()
    {
        DataFactory dal = new DataFactory();

        if (hidPostSeed.Text != "")
        {
            DataSet dsDefault = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "GetDefaultValue")
                .Append("stat", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("seed", hidPostSeed.Text)
            }).GetList();
            if (dsDefault != null && dsDefault.Tables[0].Rows.Count > 0)
            {
                txtLotNo.Text = dsDefault.Tables[0].Rows[0][0].ToString();
                txtMBL.Text   = dsDefault.Tables[0].Rows[0][1].ToString();
                txtHBL.Text   = dsDefault.Tables[0].Rows[0][2].ToString();
            }
        }
        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_ComplexCost_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "GetCostList")
            .Append("stat", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("cxh_Company", cmbShipperCode.Value)
            .Append("cxh_InvoiceNo", txtInvNo.Text.Trim())
            .Append("cxd_LotNo", txtLotNo.Text.Trim())
            .Append("cxd_Master", txtMBL.Text.Trim())
            .Append("cxd_House", txtHBL.Text.Trim())
            .Append("seed", hidPostSeed.Text)
            .Append("DateFrom", ControlBinder.getDate(txtDateFrom.RawText.StartsWith("0001")?DBNull.Value:(object)txtDateFrom.RawText))
            .Append("DateTo", ControlBinder.getDate(txtDateTo.RawText.StartsWith("0001")?DBNull.Value:(object)txtDateTo.RawText))
        }).GetList();

        storeList.DataSource = ds;
        storeList.DataBind();
    }
Exemple #22
0
    public static bool IsSave(string sys, string date)
    {
        if (sys != "" || date != "")
        {
            DataFactory dal = new DataFactory();
            DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_CompareLockDate_SP", new System.Collections.Generic.List <IFields>()
            {
                dal.CreateIFields()
                .Append("Sys", sys)
                .Append("date", ControlBinder.getDate(date == "" ? DBNull.Value : (object)date))
            }).GetList();

            if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1].Rows[0][0].ToString() == "Y")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        return(false);
    }
Exemple #23
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();
        }
    }
    void DataBinder()
    {
        try
        {
            DataFactory dal = new DataFactory();

            DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_DeliveryOrder_System_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "List")
                .Append("do_OrderDate", ControlBinder.getDate(string.IsNullOrEmpty(txtDate.RawText.Trim()) ? "1900/01/01" : (object)txtDate.RawText.Trim()))
                .Append("do_OrderTo", ControlBinder.getDate(string.IsNullOrEmpty(txtTo.RawText.Trim()) ? DateTime.MaxValue : (object)txtTo.RawText.Trim()))
                .Append("do_Company", (string.IsNullOrEmpty(ACCompany.Value))? "": ACCompany.Value.Trim())
                .Append("do_IsVoid", chbVoid.Checked?"1":"0")
                .Append("do_Stat", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("DO", txtDO.Text.Trim())
            }).GetList();

            storeList.DataSource = ds;
            storeList.DataBind();
        }
        catch
        {
        }
    }
    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);
        }
    }
Exemple #26
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);
        }
    }
Exemple #27
0
    public DataTable GetData(ref List <string[]> list)
    {
        DataFactory dal = new DataFactory();
        DataTable   dt  = new DataTable();

        list.Clear();
        if (labSys.Text == "AI")
        {
            list.Add(new string[] { "No.", "Direct", "Lot No.#", "MAWB", "Shipper", "Consignee", "Flight No.", "Arrival", "From", "To", "GWT", "CWT" });
            list.Add(new string[] { "Direct", "LotNo", "MAWB", "Shipper", "Consignee", "Flight", "Arrival", "From", "To", "GWT", "CWT" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirImport_Joblist_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "List")
                .Append("Option", "List")
                .Append("from", string.IsNullOrEmpty(txtAIfrom.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtAIfrom.Text).ToString("yyyy-MM-dd"))
                .Append("to", string.IsNullOrEmpty(txtAIto.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtAIto.Text).ToString("yyyy-MM-dd"))
                .Append("air_LotNo", txtAIlotno.Text.Trim())
                .Append("air_SYS", "AI")
                .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("air_Shipper", txtAIshipper.Text.Trim())
                .Append("air_MAWB", txtAImawb.Text.Trim().Replace(" ", ""))
                .Append("air_LocLoad", drpAIfromto.Text.Trim())
                .Append("air_Normal", chkAINormal.Checked?1:0)
                .Append("air_IsDirect", chkAIDirect.Checked?"1":"0")
                .Append("air_Status", "10")
                .Append("air_Active", chkAIVoid.Checked?"1":"0")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
            }).GetTable();
            dt.DefaultView.Sort = " LotNo asc";
            dt = dt.DefaultView.ToTable();
        }
        else if (labSys.Text == "AE")
        {
            list.Add(new string[] { "No.", "Out", "Sell", "Direct", "Lot No.#", "MAWB No.", "Flight Date", "Dest.", "Flight No.", "G.WT", "V.WT", "C.WT" });
            list.Add(new string[] { "Coload", "Sell", "Direct", "LotNo", "MAWB", "FlightDate", "Dest", "FlightNo", "GWT", "VWT", "CWT" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_AirExport_ViewConsol_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "List")
                .Append("air_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("air_MAWB", txtAEmawb.Text.Replace(" ", "").Trim())
                .Append("air_LotNo", txtAElot.Text.Trim())
                .Append("air_LocFinal", drpAEdest.Text.Trim())
                .Append("air_ETD", string.IsNullOrEmpty(txtAEfrom.Text)?DateTime.Parse("1900-01-01 0:00:00").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtAEfrom.Text).ToString("yyyy-MM-dd 23:59:59"))
                .Append("air_ETA", string.IsNullOrEmpty(txtAEto.Text)?DateTime.Parse("2900-01-01 0:00:00").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtAEto.Text).ToString("yyyy-MM-dd 23:59:59"))
                .Append("air_Shipper", txtAEshipper.Text.Trim())
                .Append("air_Consignee", txtAEconsignee.Text.Trim())
                .Append("air_CoLoader", txtAEcoloader.Text.Trim())
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
            }).GetTable();
            dt.DefaultView.Sort = " LotNo asc";
            dt = dt.DefaultView.ToTable();
        }
        else if (labSys.Text == "OI")
        {
            list.Add(new string[] { "No.", "ETD", "ETA", "Lot No.#", "POL", "POD", "MBL No.#", "Vessel", "Voyage", "Service Mode", "P/C" });
            list.Add(new string[] { "ETD", "ETA", "imp_LotNo", "POL", "POD", "MBL", "Vessel", "Voyage", "ServiceMode", "PPCC" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Ocean_OIJobList_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "OIJobList")
                .Append("LotNo", txtOIlot.Text.Trim())
                .Append("MBL", txtOImbl.Text.Trim())
                .Append("POL", txtOIpol.Text.Trim())
                .Append("POD", txtOIpod.Text.Trim())
                .Append("Vessel", txtOIvessel.Text.Trim())
                .Append("From", string.IsNullOrEmpty(txtOIfrom.Text) ? DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtOIfrom.Text).ToString("yyyy-MM-dd"))
                .Append("To", string.IsNullOrEmpty(txtOIto.Text) ? DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtOIto.Text).ToString("yyyy-MM-dd"))
                .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("SYS", "OI")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("o_Shipper", txtOIShipper.Text.Trim())//2014-12-18 Grace (修改查询条件)
                .Append("o_Active", chbOIVoid.Checked?"1":"0")
            }).GetTable();
            dt.DefaultView.Sort = " imp_LotNo asc";
            dt = dt.DefaultView.ToTable();
        }
        else if (labSys.Text == "OE")
        {
            list.Add(new string[] { "No.", "ETD", "Type", "Lot No.#", "POL", "POD", "MBL No.#", "Vessel", "Voyage", "ETA", "P/C", "By", });
            list.Add(new string[] { "ETD", "o_ServiceType", "LotNo", "POL", "POD", "MBL", "Vessel", "Voyage", "ETA", "PPCC", "o_User", });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_MBL_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "AssignJobList")
                .Append("o_LotNo", txtOElot.Text.Trim())
                .Append("o_MBL", txtOEmbl.Text.Trim())
                .Append("o_LocFinal", txtOEdest.Text.Trim())
                .Append("o_ETD", string.IsNullOrEmpty(txtOEfrom.Text)?DateTime.Parse("1900-01-01 0:00:00").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtOEfrom.Text).ToString("yyyy-MM-dd"))
                .Append("o_ETA", string.IsNullOrEmpty(txtOEto.Text)?DateTime.Parse("2900-01-01 0:00:00").ToString("yyyy-MM-dd 0:00:00"):DateTime.Parse(txtOEto.Text).ToString("yyyy-MM-dd"))
                .Append("o_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("o_SYS", "OE")
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("o_Shipper", txtOEShipper.Text.Trim())//2014-12-16 Grace (修改查询条件)
                .Append("o_Active", chbOEVoid.Checked ? "1" : "0")
            }).GetTable()
            ;
            dt.DefaultView.Sort = " LotNo asc";
            dt = dt.DefaultView.ToTable();
        }

        else if (labSys.Text == "TG")
        {
            list.Add(new string[] { "No.", "Type", "MBL/MAWB", "HBL/HAWB", "Lot No.#", "Shipper", "Consignee", "ETD", "ETA", "Depart.", "Dest." });
            list.Add(new string[] { "Type", "tri_MBL", "tri_HBL", "tri_LotNo", "tri_ShipperLine", "tri_ConsigneeLine", "tri_ETD", "tri_ETA", "tri_LocReceived", "tri_LocFinal" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Triangle_ShipmentList_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "GetList")
                .Append("tri_MBL", txtTGmbl.Text.Trim())
                .Append("tri_HBL", txtTGhbl.Text.Trim())
                .Append("tri_LotNo", txtTGLotNo.Text.Trim())
                .Append("tri_Shipper", txtTGshipper.Text.Trim())
                .Append("tri_Consignee", txtTGconsignee.Text.Trim())
                .Append("tri_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("From", string.IsNullOrEmpty(txtTGfrom.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtTGfrom.Text).ToString("yyyy-MM-dd"))
                .Append("To", string.IsNullOrEmpty(txtTGto.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtTGto.Text).ToString("yyyy-MM-dd"))
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("tri_Active", chbTGVoid.Checked ? "1" : "0")//2014-12-16 Grace (修改查询条件)
                .Append("tri_LocFinal", txtTGdest.Text.Trim())
            }).GetTable();
            dt.DefaultView.Sort = " tri_LotNo asc";
            dt = dt.DefaultView.ToTable();
        }

        else if (labSys.Text == "OB")
        {
            list.Add(new string[] { "No.", "Type", "MBL", "HBL", "Lot No.#", "Shipper", "Consignee", "ETD", "ETA", "Depart.", "Dest." });
            list.Add(new string[] { "Type", "tri_MBL", "tri_HBL", "tri_LotNo", "tri_ShipperLine", "tri_ConsigneeLine", "tri_ETD", "tri_ETA", "tri_LocReceived", "tri_LocFinal" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_Other_ShipmentList_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "GetList")
                .Append("tri_MBL", txtOBmbl.Text.Trim())
                .Append("tri_HBL", txtOBhbl.Text.Trim())
                .Append("tri_LotNo", txtOBlotNo.Text.Trim())
                .Append("tri_Shipper", txtOBshipper.Text.Trim())
                .Append("tri_Consignee", txtOBconsignee.Text.Trim())
                .Append("tri_STAT", FSecurityHelper.CurrentUserDataGET()[12].ToString())
                .Append("From", string.IsNullOrEmpty(txtOBfrom.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtOBfrom.Text).ToString("yyyy-MM-dd"))
                .Append("To", string.IsNullOrEmpty(txtOBto.Text)?DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd"):DateTime.Parse(txtOBto.Text).ToString("yyyy-MM-dd"))
                .Append("UserGrade", FSecurityHelper.CurrentUserDataGET()[27].ToString())
                .Append("tri_Active", chbOBVoid.Checked ? "1" : "0")//2014-12-16 Grace (修改查询条件)
                .Append("tri_LocFinal", txtOBdest.Text.Trim())
            }).GetTable();
            dt.DefaultView.Sort = " tri_LotNo asc";
            dt = dt.DefaultView.ToTable();
        }

        else if (labSys.Text == "DO")
        {
            list.Add(new string[] { "No.", "Void", "DO #", "Date", "PO #", "Shipper", "Pick up place", "CTNS", "GW", "VOL/CBM", "Cost" });
            list.Add(new string[] { "IsVoid", "DO", "OrderDate", "PO", "Shipper", "ADDR", "CTNS", "GW", "CBM", "Cost" });
            dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_DeliveryOrder_System_SP", new List <IFields>()
            {
                dal.CreateIFields()
                .Append("Option", "List")
                .Append("do_OrderDate", ControlBinder.getDate(string.IsNullOrEmpty(txtDODate.Text.Trim()) ? "1900/01/01" : (object)txtDODate.Text.Trim()))
                .Append("do_OrderTo", ControlBinder.getDate(string.IsNullOrEmpty(txtDOTo.Text.Trim()) ? DateTime.MaxValue : (object)txtDOTo.Text.Trim()))
                .Append("do_Company", ddlDOCompany.Text.Trim())
                .Append("do_IsVoid", cbDOVoid.Checked?"1":"0")
                .Append("do_Stat", FSecurityHelper.CurrentUserDataGET()[12])
            }).GetTable();
            dt.DefaultView.Sort = " DO asc";
            dt = dt.DefaultView.ToTable();
        }

        return(dt);
    }
Exemple #28
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);
        }
    }
    private void DecodeURL()
    {
        if (Request["Sys"] != null)
        {
            hidsys.Text = Request["Sys"];
        }
        if (Request["From"] != null)
        {
            hidfrom.Text = Server.UrlDecode(Request["From"]);
            if (hidfrom.Text == "")
            {
                hidfrom.Text = "1900/01/01";
            }
            else
            {
                hidfrom.Text = (string)ControlBinder.getDate(hidfrom.Text);
            }
        }
        if (Request["To"] != null)
        {
            hidto.Text = Server.UrlDecode(Request["To"]);
            if (hidto.Text == "")
            {
                hidto.Text = "2100/01/01";
            }
            else
            {
                hidto.Text = (string)ControlBinder.getDate(hidto.Text);
            }
        }
        if (Request["Dest"] != null)
        {
            hiddest.Text = Server.UrlDecode(Request["Dest"]);
        }
        if (Request["Sales"] != null)
        {
            hidsales.Text = Server.UrlDecode(Request["Sales"]);
        }
        if (Request["Shipper"] != null)
        {
            hidshipper.Text = Server.UrlDecode(Request["Shipper"]);
        }
        if (Request["Consignee"] != null)
        {
            hidconsignee.Text = Server.UrlDecode(Request["Consignee"]);
        }
        if (Request["JobNo"] != null)
        {
            hidJob.Text = Server.UrlDecode(Request["JobNo"]);
        }
        if (Request["MBL"] != null)
        {
            hidMbl.Text = Server.UrlDecode(Request["MBL"]);
        }
        if (Request["HBL"] != null)
        {
            hidHbl.Text = Server.UrlDecode(Request["HBL"]);
        }

        if (Request["Container"] != null)
        {
            hidContainer.Text = Server.UrlDecode(Request["Container"]);
        }
        if (Request["Vessel"] != null)
        {
            hidVessel.Text = Server.UrlDecode(Request["Vessel"]);
        }
        if (Request["Voyage"] != null)
        {
            hidVoyage.Text = Server.UrlDecode(Request["Voyage"]);
        }
        if (Request["Coloader"] != null)
        {
            hidColoader.Text = Server.UrlDecode(Request["Coloader"]);
        }
    }
    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);
        }
    }