Esempio n. 1
0
    public Boolean BindBOLData(string BOLNumber)
    {
        DataSet dsGER       = new DataSet();
        DataSet dsBOLDetail = new DataSet();
        string  ColumnNames = "*, convert(varchar,RcptQty) + BaseUOM as UMQty, UOMatlAmt/RcptQty as MatlCost";

        ColumnNames += ", UODutyAmt/RcptQty as DutyPerUnit";
        ColumnNames += ", UOOceanFrghtAmt/RcptQty as OceanPerUnit";
        ColumnNames += ", UOBrokerageAmt/RcptQty as BrokerPerUnit";
        ColumnNames += ", UODrayAmt/RcptQty as DrayPerUnit";
        ColumnNames += ", (UOMerchProcFee+UOHarborMaintFee)/RcptQty as HarborPerUnit";
        ColumnNames += ", UOMiscFeeAmt/RcptQty as MiscPerUnit";
        ColumnNames += ", UOTrkFrghtAmt/RcptQty as TruckPerUnit";
        ColumnNames += ", (1000*UOMatlAmt/PcsPerAlt)/RcptQty as MatlK";
        dsGER        = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                                new SqlParameter("@tableName", "GERHeaderHist"),
                                                new SqlParameter("@columnNames", "*"),
                                                new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));
        // get the detail data
        dsBOLDetail = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                               new SqlParameter("@tableName", "GERDetailHist"),
                                               new SqlParameter("@columnNames", ColumnNames),
                                               new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));

        if (dsGER.Tables[0] != null)
        {
            dtBOLData = dsGER.Tables[0];
            BOLHeaderLeft.DataSource = dtBOLData;
            BOLHeaderLeft.DataBind();
            BOLHeaderCenter.DataSource = dtBOLData;
            BOLHeaderCenter.DataBind();
            BOLHeaderRight.DataSource = dtBOLData;
            BOLHeaderRight.DataBind();
            if (dtBOLData.Rows.Count == 0)
            {
                lblErrorMessage.Text = "BOL Number not on file";
                return(false);
            }
            else
            {
                //
                // Assign the BOL number in header[Used to print the report]
                //
                lblBOLNumber.Text = dtBOLData.Rows[0]["BOLNo"].ToString();

                dtBOLDetail          = dsBOLDetail.Tables[0];
                BOLDetail.DataSource = dtBOLDetail;
                BOLDetail.DataBind();
                //PrintButton.Visible = true;
                return(true);
            }
        }
        else
        {
            lblErrorMessage.Text = "BOL Number not on file";
            return(false);
        }
    }
Esempio n. 2
0
    public Boolean BindBOLData(string BOLNumber)
    {
        DataSet dsGER       = new DataSet();
        DataSet dsBOLDetail = new DataSet();
        string  ColumnNames = "";

        dsGER = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                         new SqlParameter("@tableName", "GERHeaderHist"),
                                         new SqlParameter("@columnNames", "*"),
                                         new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));
        // get the detail data
        dsBOLDetail = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                               new SqlParameter("@tableName", "GERDetailHist"),
                                               new SqlParameter("@columnNames", "*"),
                                               new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));

        if (dsGER.Tables[0] != null)
        {
            dtBOLData = dsGER.Tables[0];
            BOLHeaderLeft.DataSource = dtBOLData;
            BOLHeaderLeft.DataBind();
            BOLHeaderCenter.DataSource = dtBOLData;
            BOLHeaderCenter.DataBind();
            BOLHeaderRight.DataSource = dtBOLData;
            BOLHeaderRight.DataBind();
            if (dtBOLData.Rows.Count == 0)
            {
                lblErrorMessage.Text = "BOL Number not on file";
                return(false);
            }
            else
            {
                //
                // Assign the BOL number in header[Used to print the report]
                //
                lblBOLNumber.Text = dtBOLData.Rows[0]["BOLNo"].ToString();

                dtBOLDetail          = dsBOLDetail.Tables[0];
                BOLDetail.DataSource = dtBOLDetail;
                BOLDetail.DataBind();
                //PrintButton.Visible = true;
                return(true);
            }
        }
        else
        {
            lblErrorMessage.Text = "BOL Number not on file";
            return(false);
        }
    }