Пример #1
0
        public ActionResult Index(FormCollection c)
        {
            if (c["itemIDs"].IsNullOrTrimEmpty())
            {
                return(View());
            }

            var itemIDs    = c["itemIDs"].Split(',').ToList();
            var checkedIds = new CartService().CheckedCarts(itemIDs).Select(a => a.CartID);

            if (checkedIds.Any() == false)
            {
                return(View());
            }

            CookieHelper.SetCookie("cartids", string.Join(",", checkedIds));
            return(Redirect("/cart/Settlement"));
        }
Пример #2
0
        public ActionResult Settlement()
        {
            var cartIds = CookieHelper.GetCookieValue("cartids").Split(',').ToList();
            var result  = new CartService().CheckedCarts(cartIds);
            var member  = _customersService.GetMemberByMemberId(CurrentMember.MemberId);

            if (member == null)
            {
                member = new Customers();
            }

            if (result.Any() == false)
            {
                return(Redirect("/cart"));
            }
            var curMaxInadvanceHours = result.Max(o => o.InadvanceHours);

            ViewBag.earlyAllowDistributionTime = new SettlementService().GetEarlyAllowDistributionTime(curMaxInadvanceHours);
            ViewBag.Sites = new LogisticsSiteService().GetLogisticsSitesByProvince("福建省");
            ViewBag.shortcutSubProductList = _productService.GetShortcutSubProduct();
            ViewBag.member = member;
            ViewBag.curMaxInadvanceHours = curMaxInadvanceHours;
            return(View(result));
        }