public ActionResult RemoveFromCart(Guid id) { PhoneItem phone = PhoneItemManager.Get(id); if (phone != null) { GetCart().RemoveLine(phone); } return(RedirectToAction("Index", "Cart")); }
public RedirectToRouteResult PlusQuantityFromCart(Guid id) { PhoneItem phone = PhoneItemManager.Get(id); if (phone != null) { GetCart().AddItem(phone, 1); } ViewBag.Count = GetCart().Lines.Count(); return(RedirectToAction("Index", "Cart")); }
public ActionResult Edit(Guid id) { var result = PhoneItemManager.Get(id); if (result == null) { return(RedirectToAction("Index", "Home")); } else { return(View(result)); } }
public ActionResult Details(Guid id) { var result = PhoneItemManager.Get(id); if (result == null) { return(RedirectToRoute(new { controller = "Home", action = "Index" })); } else { return(View("../Phone/Details", result)); } }
public ActionResult DeleteConfirmed(Guid id) { var onephone = PhoneItemManager.Get(id); if (onephone == null) { return(RedirectToRoute(new { controller = "Home", action = "Index" })); } else { PhoneItemManager.DeletePhone(id); return(RedirectToRoute(new { controller = "Home", action = "Index" })); } }
public ActionResult Delete(Guid id) { var onephone = PhoneItemManager.Get(id); if (onephone != null) { return(View(onephone)); } else { var resultlist = PhoneItemManager.GetPhones(); var result = resultlist.ToPagedList(1, 3); return(View(result)); } }