public ActionResult Index() { var goods = _goodLogic.GetAll(); var goodViews = _adminHelper.GoodDtoListToGoodAdminViewList(goods); return(View(goodViews)); }
public ActionResult Index() { ViewBag.Categories = _goodHelper.GetCategories(); ViewBag.Colors = _goodHelper.GetColors(); var goods = _goodLogic.GetAll(); var goodViews = Mapper.Map <IEnumerable <GoodDTO>, IEnumerable <GoodViewModel> >(goods); return(View(goodViews)); }
public RedirectToRouteResult AddToCart(Cart cart, int goodId, string returnUrl) { var good = _goodLogic.GetAll() .FirstOrDefault(g => g.Id == goodId); if (good != null) { cart.AddItem(good, 1); } return(RedirectToAction("Index", new { returnUrl })); }