// GET: ShoppingCarts public ActionResult Index() { using (ShoppingCartDAL scService = new ShoppingCartDAL()) { string username = Session["username"] != null ? Session["username"].ToString() : string.Empty; return(View(scService.GetAllData(username).ToList())); } }
public ActionResult CheckOut() { if (User.Identity.IsAuthenticated) { using (ShoppingCartDAL service = new ShoppingCartDAL()) { string username = Session["username"] != null ? Session["username"].ToString() : string.Empty; return(View(service.GetAllData(username).ToList())); } } else { return(RedirectToAction("Login", "Account")); } }