Exemplo n.º 1
0
        public ActionResult Index()
        {
            var goods     = _goodLogic.GetAll();
            var goodViews = _adminHelper.GoodDtoListToGoodAdminViewList(goods);

            return(View(goodViews));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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 }));
        }