public ActionResult Create(int id) { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); cart.AddToCart(id); return(RedirectToAction("Index")); }
//GET: ShoppingCart//AddToCart public ActionResult AddToCart(int id) { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); cart.AddToCart(id); return(RedirectToAction("Index")); //redirects user to index page }
public ActionResult Index() { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); CreateOrderViewModel vm = new CreateOrderViewModel() { RegisteredItems = cart.GetRegistrationItems(), TotalTickets = cart.GetTotalTickets() }; return(View(vm)); }
// GET: ShoppingCart/Index //Tickets Ordered Page public ActionResult Index() { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); RegistrationCartViewModel vm = new RegistrationCartViewModel() { CartItems = cart.GetCartItems() }; return(View(vm)); }
public ActionResult Cancel(int id) { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); int itemCnt = cart.RemoveFromCart(id); CancelOrderViewModel vm = new CancelOrderViewModel() { ItemCount = itemCnt, DeleteId = id, CartCount = 0, Message = "Your ticket has been cancelled", OrderStatus = "Cancelled" }; return(Json(vm)); }
public ActionResult RemoveFromCart(int id) { RegistrationCart cart = RegistrationCart.GetCart(this.HttpContext); Event eventSelected = db.Carts.SingleOrDefault(c => c.RecordId == id).EventSelected; int newItemCount = cart.RemoveFromCart(id); DeleteCartViewModel vm = new DeleteCartViewModel() { DeleteId = id, ItemCount = newItemCount, Message = eventSelected.Title + " has been removed from the cart" }; return(Json(vm)); //error that allows code to compile still //throw new NotImplementedException(); }