Friday, 22 February 2013

c sharp total price

public void totalprice()
   {
       float pricee;
       int quantityy;
      float totalprice;
       foreach (GridViewRow row in GridView1.Rows)
       {
           int pro_id = Convert.ToInt32(GridView1.DataKeys[row.RowIndex][0]);
           pricee = dal.getprice(pro_id);
           quantityy = dal.getquantity(pro_id);
           totalprice += quantityy * pricee;
       }
      lbltprice.Text = totalprice.ToString();
   }

1 comment: