private void btnAddToCart_Click(object sender, EventArgs e) { DataRow row = CartTable.NewRow(); row["ProductCode"] = searchLookUpMedicine.EditValue.ToString(); row["ProductName"] = searchLookUpMedicine.Properties.View.GetFocusedDisplayText(); row["Qty"] = txtQuantity.Text; CartTable.Rows.Add(row); searchLookUpMedicine.Text = ""; txtQuantity.Text = ""; searchLookUpMedicine.Focus(); }
protected void AddProduct(string id, string itemcode, int productid, string description, decimal price, int qty, string imagefile, string imagefile2) { DataTable dt = new DataTable(); dr = CartTable.NewRow(); dr["id"] = id; dr["itemcode"] = itemcode; dr["productid"] = productid; dr["imagefile"] = imagefile; dr["description"] = description; dr["qty"] = qty; dr["price"] = price; dr["Total"] = price; dr["imagefile2"] = imagefile2; CartTable.Rows.Add(dr); addCartItemToTable(dr); HttpContext.Current.Session["carttable"] = CartTable; }