Esempio n. 1
0
        public ActionResult GoodDetails(int id)
        {
            Good good = ModelService.GetGoodById(id);

            good.CalcPrice();
            return(View(good));
        }
Esempio n. 2
0
        public ActionResult CartView()
        {
            if (Session["Cart"] == null)
            {
                Session["Cart"] = new Dictionary <int, int>();
            }
            Dictionary <int, int> cart = (Dictionary <int, int>)Session["Cart"];

            Dictionary <Good, int> goods = new Dictionary <Good, int>();

            foreach (var item in cart)
            {
                Good tmp = ModelService.GetGoodById(item.Key);
                tmp.CalcPrice();
                goods.Add(tmp, item.Value);
            }
            return(View(goods));
        }