public ActionResult CommitToBuy() { CustomerListCart clc = new CustomerListCart(); clc.ShoppingCart = new ShoppingCart(); clc.CustomerList = new CustomerList(); clc.CustomerList.Load(); GetShoppingCart(); clc.ShoppingCart = cart; return(View(clc)); }
public ActionResult CommitToBuy(CustomerListCart clc) { try { GetShoppingCart(); clc.ShoppingCart = cart; clc.ShoppingCart.CustomerId = clc.CustomerId; User currentUser = (User)Session["user"]; clc.ShoppingCart.CheckOut(currentUser.Id); Session["cart"] = null; return(RedirectToAction("OrderPlaced")); } catch (Exception ex) { return(View(clc)); } }