示例#1
0
    private void invpro()
    {
        try
        {
            bl.inv_no = Request.QueryString["inv"].ToString();;
            DataSet ds2 = new DataSet();
            ds2 = dl.select_inv_item_detail(bl);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                string pro  = "";
                string desc = "";
                string qty  = "";
                string rate = "";
                string per  = "";
                string amo  = "";
                string sr   = "";
                // string tax = "";
                string dec = "";
                //     string no="";


                for (int i = 0; i < ds2.Tables[0].Rows.Count; i++)
                {
                    sr   = sr + (i + 1) + "</br>";
                    pro  = pro + ds2.Tables[0].Rows[i]["item_name"].ToString() + "</br>";
                    desc = desc + ds2.Tables[0].Rows[i]["descr"].ToString() + "</br>";
                    qty  = qty + ds2.Tables[0].Rows[i]["qty"].ToString() + "</br>";
                    //   tax = tax + "</br>" + ds2.Tables[0].Rows[i]["tax"].ToString();
                    dec = dec + "</br>" + ds2.Tables[0].Rows[i]["disc"].ToString();

                    if (ds2.Tables[0].Rows[i]["rate"].ToString() == "")
                    {
                        rate = rate + "</br>" + ds2.Tables[0].Rows[i]["rate"].ToString();
                    }
                    else
                    {
                        rate = rate + "</br>" + ds2.Tables[0].Rows[i]["rate"].ToString() + ".00";
                    }

                    per = per + "</br>" + ds2.Tables[0].Rows[i]["per"].ToString();
                    if (ds2.Tables[0].Rows[i]["amount"].ToString() == "")
                    {
                        amo = amo + "</br>" + ds2.Tables[0].Rows[i]["amount"].ToString();
                    }
                    else
                    {
                        amo = amo + "</br>" + ds2.Tables[0].Rows[i]["amount"].ToString() + ".00";
                    }
                }

                //  lbl_no.Text = no;
                lbl_sr.Text     = sr;
                lbl_itm_nm.Text = pro;
                lbl_qty.Text    = qty;
            }
        }
        catch
        {
        }
    }
示例#2
0
    private void invpro()
    {
        try
        {
            bl.inv_no = Request.QueryString["inv"].ToString();
            DataSet ds2 = new DataSet();
            ds2 = dl.select_inv_item_detail(bl);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                string pro  = "";
                string desc = "";
                string qty  = "";
                string rate = "";
                string per  = "";
                string amo  = "";
                string sr   = "";
                // string tax = "";
                string dec = "";
                //     string no="";


                for (int i = 0; i < ds2.Tables[0].Rows.Count; i++)
                {
                    sr   = sr + (i + 1) + "</br>";
                    pro  = pro + ds2.Tables[0].Rows[i]["item_name"].ToString() + "</br>";
                    desc = desc + ds2.Tables[0].Rows[i]["descr"].ToString() + "</br>";
                    qty  = qty + ds2.Tables[0].Rows[i]["qty"].ToString() + "</br>";
                    //   tax = tax + "</br>" + ds2.Tables[0].Rows[i]["tax"].ToString();
                    if (ds2.Tables[0].Rows[i]["disc"].ToString() != string.Empty)
                    {
                        dec = dec + "</br>" + ds2.Tables[0].Rows[i]["disc"].ToString();
                    }
                    if (ds2.Tables[0].Rows[i]["rate"].ToString() == "")
                    {
                        rate = rate + ds2.Tables[0].Rows[i]["rate"].ToString() + "</br>";
                    }
                    else
                    {
                        string str = ds2.Tables[0].Rows[i]["rate"].ToString();
                        double st  = Convert.ToDouble(str);

                        str = string.Format("{0:0.00}", st);

                        rate = rate + str + "</br>";
                    }

                    per = per + ds2.Tables[0].Rows[i]["per"].ToString() + "</br>";
                    if (ds2.Tables[0].Rows[i]["amount"].ToString() == "")
                    {
                        amo = amo + ds2.Tables[0].Rows[i]["amount"].ToString() + "</br>";
                    }
                    else
                    {
                        string str = ds2.Tables[0].Rows[i]["amount"].ToString();
                        double st  = Convert.ToDouble(str);

                        str = string.Format("{0:0.00}", st);
                        amo = amo + str + "</br>";
                    }
                }

                //  lbl_no.Text = no;
                lbl_itm_nm.Text = pro;
                ;// double aqty = Convert.ToDouble(qty);

                lbl_qty.Text = qty;
                lbl_rt.Text  = rate;
                lbl_par.Text = per;
                if (dec != string.Empty && dec != "0")
                {
                    lbl_extra.Text      = "Discount";
                    lbl_extraprice.Text = dec;
                }// lbl_dis.Text = dec;
                lbl_total_amt.Text = amo;
                lbl_sr.Text        = sr;
            }
        }
        catch
        {
        }
    }