public ActionResult GoodDetails(int id) { Good good = ModelService.GetGoodById(id); good.CalcPrice(); return(View(good)); }
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)); }