예제 #1
0
        public ActionResult Index()
        {
            ViewBag.CustomerDetail = objSession.GetSessionCustomer(this);
            ViewBag.PRODUCTRECOMMEND = _DataFactory.GetProductRecommend().Take(5);
            ApplicationHelpers.getCookieOrders(this);
            ViewBag.OrderDetail = null;
            if (Session["Orders"] != null)
            {
                ViewBag.OrderDetail = (List<ItemOrderEntity>)Session["Orders"];
            }

            ViewBag.CurentPage = "Cart";
            ViewBag.Title = "SHOP A HORIC By Jiffy | Cart";

            OrderDetailEntity _OrderDetailEntity = new OrderDetailEntity();

            return View();
        }
예제 #2
0
        public ActionResult Index(List<ItemOrderEntity> model, string button)
        {
            ViewBag.CustomerDetail = objSession.GetSessionCustomer(this);
            ViewBag.PRODUCTRECOMMEND = _DataFactory.GetProductRecommend().Take(5);
            ApplicationHelpers.getCookieOrders(this);
            ViewBag.OrderDetail = null;
            switch (button)
            {
                case "Update":
                    if (Session["Orders"] != null)
                    {

                        List<ItemOrderEntity> objOrders = (List<ItemOrderEntity>)Session["Orders"];
                        foreach (var item in model)
                        {
                            ItemOrderEntity Orders = objOrders.Where(p => p.ItemId == item.ItemId).FirstOrDefault();
                            Orders.Amount = item.Amount;
                            ViewBag.OrderDetail = objOrders;
                        }

                    }
                    break;
                case "More":
                    return RedirectToAction("Index", "Home");
                    break;
                default:
                    break;
            }

            ViewBag.CurentPage = "Cart";
            ViewBag.Title = "SHOP A HORIC By Jiffy | Cart";

            OrderDetailEntity _OrderDetailEntity = new OrderDetailEntity();

            return View();
        }