protected void btnAddtocart_Click(object sender, EventArgs e) { ShoppingCartActions Action = new ShoppingCartActions(); string pName = Action.getProductName(); AddToCart(pName); }
protected void Page_Load(object sender, EventArgs e) { //Session["userID"] = "Preethi"; //Session["productName"] = "How to Deal with Anger"; Team2_BookDBEntities DB = new Team2_BookDBEntities(); ShoppingCartActions Action = new ShoppingCartActions(); string pName = Action.getProductName(); var data1 = from b in DB.products where b.productName == pName select b; WebDL.product book = data1.FirstOrDefault(); var data2 = from c in DB.categories where c.categoryID == book.categoryID select c; WebDL.category cat = data2.First(); imgCover.ImageUrl = book.productImage; lbBooktitle.Text = book.productName; tbDescription.Text = book.productDescription; lbCategory1.Text = cat.categoryName.ToString(); lbPrice1.Text = book.productPrice.ToString(); lbbookDiscount.Text = book.productDiscount.ToString(); lbBookqty.Text = book.productQty.ToString(); lbDiscountedPrice1.Text = book.productDiscountedPrice.ToString(); }