Пример #1
0
        /// <summary>
        /// 已经生成的品牌上新商品列表
        /// </summary>
        /// <param name="brandNo">品牌ID</param>
        /// <returns></returns>
        public ActionResult NewShelfBrandProductList(string brandNo, string DateShelf)
        {
            if (brandNo == null || brandNo == "")
            {
                brandNo = "B0543";
            }
            DateShelf = DateShelf == null || DateShelf == "" ? System.DateTime.Now.ToString("yyyy-MM-dd HH") : DateShelf;
            if (Request.QueryString["keyWord"] != null)
            {
                ViewBag.keyWord = Request.QueryString["keyWord"];
            }
            if (Request.QueryString["CategoryNo"] != null)
            {
                ViewBag.category = Request.QueryString["CategoryNo"];
            }
            if (Request.QueryString["Gender"] != null)
            {
                ViewBag.Gender = Request.QueryString["Gender"];
            }
            NewShelfBrandProductService service = new NewShelfBrandProductService();
            List <ProductInfoNew>       list    = service.NewProductList(brandNo, Convert.ToDateTime(DateShelf), ViewBag.keyWord, ViewBag.category, ViewBag.Gender);

            for (int i = 0; i < list.Count(); i++)//循环去取商品价格的信息
            {
                list[i] = service.SelectSpfSkuPrice(list[i], list[i].ProductNo);
            }
            return(View(list));
        }
Пример #2
0
        /// <summary>
        /// ajax调用删除方法
        /// </summary>
        /// <param name="brandNo"></param>
        /// <param name="ProductNoStr"></param>
        /// <returns></returns>
        public ActionResult DeleteNewShelfBrandProductList(string idStr, string brandNo, string DateShelf, int IsCount10)
        {
            idStr = idStr.Trim().TrimEnd(',');
            NewShelfBrandProductService service = new NewShelfBrandProductService();

            service.DeleteNewProductList(idStr, brandNo, Convert.ToDateTime(DateShelf), IsCount10);
            return(Json(new { message = "删除成功" }));
        }
Пример #3
0
        /// <summary>
        /// 管理品牌对应的上新商品列表
        /// </summary>
        /// <returns></returns>

        public ActionResult NewShelfProductList(string brandNo, string startDate, string endDate, string pageIndex, int pageSize = 20)
        {
            pageIndex = pageIndex == null || pageIndex == "" ? "1" : pageIndex;
            NewShelfBrandProductService service = new NewShelfBrandProductService();
            int count = 0;
            Dictionary <string, List <ProductInfoNew> > dic = service.SelectNewBrandWeekDaysProduct(Convert.ToInt32(pageIndex), pageSize, brandNo, startDate, endDate, out count);

            ViewBag.page       = pageIndex;
            ViewBag.pageSize   = pageSize;
            ViewBag.totalCount = count;
            return(View(dic));
        }
Пример #4
0
        /// <summary>
        /// ajax调用的添加上新商品的方法
        /// </summary>
        /// <param name="brandNo"></param>
        /// <param name="ProductNoStr"></param>
        /// <returns></returns>
        public ActionResult AddShelfProduct(string brandNo, string ProductNoStr, string DateShelf)
        {
            DateShelf    = DateShelf == null || DateShelf == "" ? System.DateTime.Now.ToString("yyyy-MM-dd HH") : DateShelf;
            ProductNoStr = ProductNoStr.Trim().TrimEnd(',');
            NewShelfBrandProductService service = new NewShelfBrandProductService();
            int WeekDays = (int)Convert.ToDateTime(DateShelf).DayOfWeek;

            WeekDays = WeekDays == 0 ? 7 : WeekDays;
            Passport passport = PresentationHelper.GetPassport();

            service.AddShelfProduct(brandNo.ToUpper(), ProductNoStr, passport.UserName, 1, Convert.ToDateTime(DateShelf), WeekDays);//还为添加用户ID
            return(Json(new { message = "添加成功" }));
        }
Пример #5
0
        /// <summary>
        /// 置顶操作
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="brandNo"></param>
        /// <param name="dateShelf"></param>
        /// <returns></returns>
        public ActionResult TopOneSortShelfProduct(string Id, string brandNo, string dateShelf)
        {
            try
            {
                NewShelfBrandProductService service = new NewShelfBrandProductService();
                service.TopOneSortShelfProduct(Id, brandNo, Convert.ToDateTime(dateShelf));
                return(Json(new { message = "操作成功" }));
            }
            catch (Exception e)
            {
                return(Json(new { message = e.ToString() }));

                throw;
            }
        }
Пример #6
0
        /// <summary>
        /// ajax保存排序
        /// </summary>
        /// <param name="brandNo"></param>
        /// <param name="ProductNoStr"></param>
        /// <returns></returns>
        public ActionResult SortShelfProduct(string idStr, string sortStr, string memcache_key)
        {
            try
            {
                idStr = idStr.Trim().TrimEnd(',');
                NewShelfBrandProductService service = new NewShelfBrandProductService();
                sortStr = sortStr.Trim().TrimEnd(',');
                service.UpdateShelfProductSort(idStr, sortStr);
                EnyimMemcachedClient.Instance.Remove(memcache_key);
                return(Json(new { message = "保存成功" }));
            }
            catch (Exception e)
            {
                return(Json(new { message = e.ToString() }));

                throw;
            }
        }
Пример #7
0
        /// <summary>
        /// 添加上新商品列表
        /// </summary>
        /// <param name="brandNo">品牌ID</param>
        /// <returns></returns>
        public ActionResult AddNewShelfProductList(string brandNo, string pageIndex, string DateShelf, int pageSize = 20)
        {
            pageIndex = pageIndex == null || pageIndex == "" ? "1" : pageIndex;
            DateShelf = DateShelf == null || DateShelf == "" ? System.DateTime.Now.ToString("yyyy-MM-dd HH") : DateShelf;
            if (Request.QueryString["keyWord"] != null)
            {
                ViewBag.keyWord = Request.QueryString["keyWord"];
            }
            if (Request.QueryString["CategoryNo"] != null)
            {
                ViewBag.categoryNo = Request.QueryString["CategoryNo"];
            }
            if (Request.QueryString["Gender"] != null)
            {
                ViewBag.Gender = Request.QueryString["Gender"];
            }
            if (Request.QueryString["startDate"] != null)
            {
                ViewBag.startDate = Request.QueryString["startDate"];
            }
            if (Request.QueryString["endDate"] != null)
            {
                ViewBag.endDate = Request.QueryString["endDate"];
            }
            NewShelfBrandProductService service = new NewShelfBrandProductService();
            int total = 0;
            List <ProductInfoNew> list = service.BrandNewShelfProductList(brandNo, Convert.ToInt32(pageIndex), pageSize, Convert.ToDateTime(DateShelf), ViewBag.keyword, ViewBag.categoryNo, ViewBag.Gender, ViewBag.startDate, ViewBag.endDate, out total);

            ViewBag.page       = pageIndex;
            ViewBag.pageSize   = pageSize;
            ViewBag.totalCount = total;
            //找出当前品牌下已经有的上新商品的总数
            List <ProductInfoNew> newPlist = service.NewProductList(brandNo, Convert.ToDateTime(DateShelf), null, null, null);

            ViewBag.NrePcount = newPlist.Count;
            return(View(list));
        }