Exemplo n.º 1
0
        public ActionResult SetBrand(Guid typeId)
        {
            var loginUser = (UserInfo)Session["LoginUser"];

            ViewBag.TypeId = typeId;
            var typeList = _manager.GetBrandList(typeId);
            var brand    = _manager.GetAllBrand(loginUser.UserId);

            ViewBag.TypeList = typeList;
            ViewBag.Brand    = brand;
            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 给某个商品类型添加商品品牌
        /// </summary>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public ActionResult SetBrand(Guid typeId)
        {
            Guid managerId = (Guid)ViewBag.ManagerId;

            ViewBag.TypeId = typeId;
            var typeList = _manager.GetBrandList(typeId);
            var brand    = _manager.GetAllBrand(managerId);

            ViewBag.TypeList = typeList;
            ViewBag.Brand    = brand;
            return(View());
        }
Exemplo n.º 3
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());
        }