Пример #1
0
        public ActionResult ShoppingCar()
        {
            var loginUser = (UserInfo)ViewBag.User;
            var list      = _order.GetShoppingCar(loginUser);
            var mj        = _active.CheckManjiujian(loginUser, ViewBag.ManagerId);
            var ms        = _active.CheckManSong(loginUser, ViewBag.ManagerId);
            var dpses     = _active.CheckDPS(list, loginUser.TypeId, loginUser.AreaNum);

            ViewBag.Mj    = mj;
            ViewBag.Ms    = ms;
            ViewBag.List  = list;
            ViewBag.DPSES = dpses;
            return(View());
        }
Пример #2
0
        /// <summary>
        /// 加载购物车
        /// </summary>
        /// <param name="method"></param>
        /// <returns></returns>
        public string LoadShoopingCarCount()
        {
            var loginUser = GetUserInfo();

            if (loginUser != null)
            {
                var managerId = GetManagerId(loginUser);
                var list      = _order.GetShoppingCar(loginUser);
                var manjian   = _active.CheckManjiujian(loginUser, managerId);
                var dps       = _active.CheckDPS(list, loginUser.TypeId, loginUser.AreaNum);
                var mansong   = _active.CheckManSong(loginUser, managerId);
                dps.ForEach(x =>
                {
                    var model = _goodsmanager.GetGoodInfoById(x.SendGoodsId);
                    if (model != null)
                    {
                        x.SendGoodsNum = model.pic1;
                    }
                });
                var obj = new
                {
                    list    = list,
                    manjian = manjian,
                    dps     = dps,
                    mansong = mansong
                };
                _response.Result = obj;
                _response.Stutas = true;
            }
            else
            {
                _response.Stutas = false;
                _response.Msg    = "请先登录";
            }
            string result = Utils.SerializeObject(_response);

            return(result);
        }