protected void rptrCart_OnItemDatabound(object source, RepeaterItemEventArgs e)
    {
        //    Control footer = rptrCart.Controls[rptrCart.Controls.Count - 1].Controls[0];
        //    Label lblFinalTotal = (Label)footer.FindControl("lblFinalTotal");
        //    Label lblAmountinWords = (Label)footer.FindControl("lblAmountinWords");


        //    if (lblFinalTotal != null)
        //    {
        //        DataTable dtprod = new DataTable();
        //        dtprod = cls.ReturnDataTable("Select_InvoiceProductDetailsFromID", new SqlParameter("@InvoiceId", invoiceid));

        //        lblFinalTotal.Text = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString();

        //        NumbertoWords num = new NumbertoWords();
        //        lblAmountinWords.Text = num.NumberToWords(Convert.ToInt32(lblFinalTotal.Text)) + " only.";
        //        lblFinalTotal.Text = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString("N2");
        //    }

        NumbertoWords num    = new NumbertoWords();
        DataTable     dtprod = new DataTable();

        dtprod = cls.ReturnDataTable("Select_InvoiceProductDetailsFromID", new SqlParameter("@InvoiceId", invoiceid));
        if (dtprod.Rows.Count > 0)
        {
            lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString();
            lblAmountinWords.Text = num.NumberToWords(Convert.ToInt32(lblFinalTotal.Text)) + " only.";
            lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString();
        }
    }
    protected void BindFooter(double invoiceid)
    {
        NumbertoWords num    = new NumbertoWords();
        DataTable     dtprod = new DataTable();

        dtprod                = cls.ReturnDataTable("Select_InvoiceProductDetailsFromIDForOnline", new SqlParameter("@InvoiceId", invoiceid));
        lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString();
        lblAmountinWords.Text = num.NumberToWords(Convert.ToInt32(lblFinalTotal.Text)) + " only.";
        lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["OrderAmount"])).ToString();
    }
Пример #3
0
    protected void rptrCart_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        NumbertoWords num    = new NumbertoWords();
        DataTable     dtprod = new DataTable();

        dtprod = cls.ReturnDataTable("Select_InvoiceDispatchProductDetailsFromID", new SqlParameter("@InvoiceId", invoiceid),
                                     new SqlParameter("@InvoiceDispatchID", invoicedispatchid));
        lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["InvoiceAmount"])).ToString();
        lblAmountinWords.Text = num.NumberToWords(Convert.ToInt32(lblFinalTotal.Text)) + " only.";
        lblFinalTotal.Text    = Math.Round(Convert.ToDouble(dtprod.Rows[0]["InvoiceAmount"])).ToString();
    }