protected void Page_Load(object sender, EventArgs e) { GetCID(); if (Session["cartToday"] == null) { Session["cartToday"] = 0; } if (Session["BuyerID"] == null) { var queryString = Request.QueryString; buyerid = int.Parse(queryString["bID"]); Session["BuyerID"] = buyerid; } if (Session["orderToday"] == null) { adpOrd.Insert(2, (int)Session["BuyerID"], null, 0, null, DateTime.Now); int oID = (int)adpOrd.GetOID(); Session["orderToday"] = oID; } if (Session["cartItems"] == null) { List <Buyer.Products> cartShop = new List <Buyer.Products>(); Session["cartItems"] = cartShop; } }
// this will be used to add items to cart public bool InsertOrder(OrderBLL order) { int result = adpOrder.Insert(order.ItemId, order.ItemId, order.shippedAddr, order.Price, order.Shipped); return(result == 1); }