public ActionResult ToPaidShoppingList(int basketId) { try { ShoppingListDAO shopListDAO = new ShoppingListDAO(); shopListDAO.paid(Convert.ToInt32(basketId)); ViewData["basketId"] = basketId; foreach (var n in shopListDAO.getList(basketId)) { if (n.statusId == 2) { new ProductDAO().paid(n.productId, new ProductDAO().getOne(n.productId).amount); } } return(RedirectToAction(basketId.ToString(), "Home/Details", new { basketId })); } catch (Exception e) { Logger.log.Error(e.Message); return(RedirectToAction(basketId.ToString(), "Home/Details", new { basketId })); } }
public ActionResult Details(int id) { ViewData["basketId"] = id; ViewData["totalPay"] = new ShoppingListDAO().totalPayable(id); return(View(basketDAO.getOne(id))); }