public ViewResult Index() { var items = _shopSite.getShopItems(); _shopSite.listShopItems = items; var obj = new ShopSiteViewModel { shopSite = _shopSite }; return(View(obj)); }
public IActionResult Checkout(Order order) { shopSite.listShopItems = shopSite.getShopItems(); if (shopSite.listShopItems.Count == 0) { ModelState.AddModelError("", "У вас должны быть товары"); } if (ModelState.IsValid) { allOrders.createOrder(order); shopSite.ClearShopitems(); return(RedirectToAction("Complete")); } return(View(order)); }