예제 #1
0
        protected void bntcalculateResult_Click(object sender, EventArgs e)
        {
            DataSet      ds  = new DataSet();
            PropPurchase obj = new PropPurchase();

            obj.pName            = ddlSearchItemName.SelectedItem.Text;
            obj.Destination_name = ddlSitename.SelectedItem.Text;

            ds = BusinessSearch.buscalculatefill(obj);
            decimal minprice = Convert.ToDecimal(ds.Tables[1].Rows[0]["Column1"].ToString());
            decimal maxprice = Convert.ToDecimal(ds.Tables[2].Rows[0]["Column1"].ToString());

            avgprice           = Convert.ToDecimal(ds.Tables[3].Rows[0]["Column1"].ToString());
            lblopminprice.Text = minprice.ToString() + " " + " Rs.";
            lblOpMaxPrice.Text = maxprice.ToString() + " " + " Rs.";
            lblOpAvg.Text      = avgprice.ToString() + " " + " Rs.";



            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                decimal qty  = Convert.ToDecimal(ds.Tables[0].Rows[i]["Purchase_qty"].ToString());
                decimal rate = Convert.ToDecimal(ds.Tables[0].Rows[i]["Purchase_rate"].ToString());

                qtyresult = qtyresult + qty;
                result    = result + qty * rate;

                pnlResult.Visible = true;
                lblqty.Text       = qtyresult.ToString();

                lblOpResult.Text = result.ToString() + " " + " Rs.";
            }
        }
예제 #2
0
        protected void btnSearchbyPurcahseOr_Click(object sender, EventArgs e)
        {
            PropPurchase obj = new PropPurchase();

            obj.pName                = ddlSearchItemName.SelectedItem.Text;
            obj.Destination_name     = ddlSitename.SelectedItem.Text;
            GridVieworder.DataSource = BusinessSearch.buscalculatefill(obj);
            DataSet ds = new DataSet();

            ds = BusinessSearch.buscalculatefill(obj);
            PanelOrder.Visible = true;
            GridVieworder.DataBind();

            if (ds.Tables[0].Rows.Count > 0)
            {
                bntcalculateResult.Visible = true;
            }
            else
            {
                bntcalculateResult.Visible = false;
                pnlResult.Visible          = false;
            }
        }