Esempio n. 1
0
    public void BindBOLData(string BOLNumber)
    {
        DataSet dsGER        = new DataSet();
        DataSet dsCharges    = new DataSet();
        DataSet dsBOLCharges = new DataSet();
        string  ColumnNames  = "";

        ColumnNames  = "BOLNo ,";
        ColumnNames += "BOLDate,";
        ColumnNames += "VendNo,VendName,";
        ColumnNames += "APInvoiceNumber,PurchReceiptNumber,";
        ColumnNames += "TransferOrderNumber,TransferShipmentNumber,";
        ColumnNames += "UOMatlAmtLanded";
        dsGER        = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                                new SqlParameter("@tableName", "GERBOLSummary"),
                                                new SqlParameter("@columnNames", ColumnNames),
                                                new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));
        // get the detail data
        ColumnNames  = "UOMatlAmt,";
        ColumnNames += "UODutyAmt,";
        ColumnNames += "UOOceanFrghtAmt,";
        ColumnNames += "UOBrokerageAmt,";
        ColumnNames += "UODrayAmt,";
        ColumnNames += "UOMerchProcFee,";
        ColumnNames += "UOHarborMaintFee,";
        ColumnNames += "UOMiscWghtFee,";
        ColumnNames += "UOMiscFeeAmt,";
        ColumnNames += "UOTrkFrghtAmt";
        dsBOLCharges = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "UGEN_SP_Select",
                                                new SqlParameter("@tableName", "GERBOLSummary"),
                                                new SqlParameter("@columnNames", ColumnNames),
                                                new SqlParameter("@whereClause", "BOLNo='" + BOLNumber + "'"));

        if (dsGER.Tables[0] != null)
        {
            dtBOLData             = dsGER.Tables[0];
            BOLDetails.DataSource = dtBOLData;
            BOLDetails.DataBind();
            if (dtBOLData.Rows.Count == 0)
            {
                lblErrorMessage.Text = "BOL Number not on file";
            }
            else
            {
                dtBOLChargeData       = dsBOLCharges.Tables[0];
                BOLAmounts.DataSource = dtBOLChargeData;
                BOLAmounts.DataBind();
                PrintButton.Visible = true;
            }
        }
        else
        {
            lblErrorMessage.Text = "BOL Number not on file";
        }
    }
Esempio n. 2
0
    public void BindBOLData(string BOLNumber)
    {
        DataSet dsGER = new DataSet();

        dsGER = SqlHelper.ExecuteDataset(connectionString, "pGERGetBOLSummary",
                                         new SqlParameter("@BOL", BOLNumber));
        if (dsGER.Tables[0] != null)
        {
            dtBOLData             = dsGER.Tables[0];
            BOLDetails.DataSource = dtBOLData;
            BOLDetails.DataBind();
            if (dtBOLData.Rows.Count == 0)
            {
                lblErrorMessage.Text = "BOL Number not on file";
            }
            else
            {
                dtChargeData          = dsGER.Tables[1];
                BOLAmounts.DataSource = dtChargeData;
                BOLAmounts.DataBind();
                dtInvoiceData = dsGER.Tables[2];
                if (dtInvoiceData.Rows.Count > 0)
                {
                    decimal MatTot = 0;
                    // total the materials
                    foreach (DataRow drow in dtInvoiceData.Rows)
                    {
                        MatTot += (decimal)drow["UOMatlAmt"];
                    }
                    dtInvoiceData.Rows.Add(new object[] { BOLNumber, "TOTAL", "", MatTot });
                }
                GERInvoiceGridView.DataSource = dtInvoiceData;
                GERInvoiceGridView.DataBind();
                PrintButton.Visible = true;
            }
        }
        else
        {
            lblErrorMessage.Text = "BOL Number not on file";
        }
    }