Ejemplo n.º 1
0
        public ActionResult AddDiscount()
        {
            var  loginUser = (UserInfo)ViewBag.User;
            Guid managerId = (Guid)ViewBag.ManagerId;

            ViewBag.TypeList     = _good.GetDownGoodsType(Guid.Empty, managerId);
            ViewBag.UserTypeList = _user.GetTypeList();
            return(View());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 商品类型列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult GoodsTypeList(string id = "")
        {
            Guid managerId = (Guid)ViewBag.ManagerId;

            var guid = Utils.ParseGuid(id);
            var type = _manager.GetTypeById(guid);
            var list = _manager.GetDownGoodsType(guid, managerId);

            ViewBag.GoodsTypeList = list;
            ViewBag.ParentId      = type != null?type.ParentId.ToString() : "";

            ViewBag.TypeId = guid;
            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult GoodsTypeList(string id = "")
        {
            if (Session["LoginUser"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            var loginUser = (UserInfo)Session["LoginUser"];
            var guid      = Utils.ParseGuid(id);
            var list      = _manager.GetDownGoodsType(guid, loginUser.UserId);

            ViewBag.GoodsTypeList = list;
            ViewBag.TypeId        = guid;
            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult SetHomePageType()
        {
            var topTypes = _goods.GetDownGoodsType(Guid.Empty, ViewBag.ManagerId);

            ViewBag.List = topTypes;
            return(View());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取商品类型列表
        /// </summary>
        /// <param name="parentId">上级</param>
        /// <param name="method"></param>
        /// <returns></returns>
        public string GetTypeList(string parentId)
        {
            var loginUser = GetUserInfo();

            if (loginUser != null)
            {
                Guid typeId = Utils.ParseGuid(parentId);
                var  list   = _goodsmanager.GetDownGoodsType(typeId, loginUser.CreateUserId);
                _response.Result = list;
                _response.Stutas = true;
            }
            else
            {
                _response.Stutas = false;
                _response.Msg    = "请先登录";
            }
            string result = Utils.SerializeObject(_response);

            return(result);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 商品销售统计
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="key"></param>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public ActionResult ShopCount(string start = "", string end = "", string key = "", string typeId = "")
        {
            Guid     managerId = (Guid)ViewBag.ManagerId;
            var      typeList  = _good.GetDownGoodsType(Guid.Empty, managerId);
            var      list      = new List <GoodsSaleMode>();
            DateTime startTime = new DateTime();
            DateTime endTime   = new DateTime();
            DateTime now       = DateTime.Now;
            DateTime dateTime  = now.AddDays(-1);

            if (string.IsNullOrEmpty(start))
            {
                startTime = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, 16, 0, 0);
            }
            else
            {
                startTime = Utils.GetTime(start, true);
            }
            if (string.IsNullOrEmpty(end))
            {
                endTime = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0);
            }
            else
            {
                endTime = Utils.GetTime(end);
            }
            if (!string.IsNullOrWhiteSpace(start))
            {
                list = _order.GetGoodsSaleInfo(startTime, endTime, key, typeId, managerId);
            }

            ViewBag.TypeList = typeList;
            ViewBag.List     = list;
            ViewBag.Start    = startTime;
            ViewBag.End      = endTime;
            ViewBag.Key      = key;
            ViewBag.TypeId   = typeId;
            return(View());
        }
Ejemplo n.º 7
0
        public ActionResult Product(string fst = "", string sec = "", string trd = "", string brandId = "", string key = "")
        {
            var    fstType     = _manager.GetGoodsType(fst);
            var    secType     = _manager.GetGoodsType(sec);
            var    trdType     = _manager.GetGoodsType(trd);
            var    loginUser   = (UserInfo)ViewBag.User;
            string para        = "fst";
            string CurrentPara = "";
            Guid   parentId    = Guid.Empty;
            var    TypeList    = new List <GoodsType>();
            var    BrandList   = new List <GoodsBrand>();

            if (!string.IsNullOrWhiteSpace(trd))
            {
                para        = "trd";
                CurrentPara = "trd";
                parentId    = Utils.ParseGuid(trd);
                secType     = _manager.GetGoodsType(trdType.ParentId.ToString());
                fstType     = _manager.GetGoodsType(secType.ParentId.ToString());
            }
            else if (!string.IsNullOrWhiteSpace(sec))
            {
                para        = "trd";
                CurrentPara = "sec";

                parentId = Utils.ParseGuid(sec);
                fstType  = _manager.GetGoodsType(secType.ParentId.ToString());
            }
            else if (!string.IsNullOrWhiteSpace(fst))
            {
                para        = "sec";
                CurrentPara = "fst";

                parentId = Utils.ParseGuid(fst);
            }
            TypeList = _manager.GetDownGoodsType(parentId, loginUser.CreateUserId);
            if (para == "trd" && !string.IsNullOrWhiteSpace(trd))
            {
                TypeList = new List <GoodsType>();
                TypeList.Add(_manager.GetGoodsType(parentId.ToString()));
            }
            BrandList = _manager.GetBrandList(parentId);
            if (!string.IsNullOrWhiteSpace(brandId))
            {
                var model = BrandList.FirstOrDefault(x => x.Id.ToString() == brandId);
                if (model != null)
                {
                    BrandList = new List <GoodsBrand>()
                    {
                        model
                    };
                }
            }
            ViewBag.CurrentPara = CurrentPara;
            ViewBag.TypeList    = TypeList;
            ViewBag.BrandList   = BrandList;
            ViewBag.Para        = para;
            ViewBag.ParentGuid  = parentId;
            ViewBag.FstType     = fstType;
            ViewBag.SecType     = secType;
            ViewBag.TrdType     = trdType;
            ViewBag.brandId     = brandId;
            ViewBag.fst         = fst;
            ViewBag.sec         = sec;
            ViewBag.trd         = trd;
            ViewBag.Key         = key;
            return(View());
        }