/// <summary>
        /// 搜索详情
        /// </summary>
        /// <param name="req">请求</param>
        /// <returns></returns>
        public ActionResult Search(CommodityListReq req)
        {
            var text = req.sText;

            var listComm = new List <Commodity_Stageprice_View>();

            var listCommView = CommodityFunc.Instance.GetViewBySearch(text, req.PageNo == null ? 1 : req.PageNo);
            var Count        = CommodityFunc.Instance.GetViewBySearchCount(text);

            ViewBag.Count    = Count;
            ViewBag.NowPage  = req.PageNo == null ? 1 : req.PageNo;
            ViewBag.PageSum  = Count % 15 == 0 ? (Count / 15) : (Count / 15 + 1);
            ViewBag.ListComm = listCommView;
            #region 废弃代码
            //var priceCount = CommodityFunc.Instance.GetPriceCount(listCommView);
            //var starsCount = CommodityFunc.Instance.GetStarCount(listCommView);
            //var salesCount = CommodityFunc.Instance.GetSalesCount(listCommView);
            //var listColor = CommodityFunc.Instance.GetColorCount(listCommView);
            //ViewBag.priceCount = priceCount;
            //ViewBag.starsCount = starsCount;
            //ViewBag.salesCount = salesCount;
            //ViewBag.listColor = listColor;
            #endregion

            ViewBag.text       = text;
            ViewBag.isCommList = 1;
            return(View());
        }
예제 #2
0
        // GET: CommodityList
        public ActionResult Index(CommodityListReq req)
        {
            var gradeId    = req.gradeId;
            var g          = GradeFunc.Instance.GetAllGradeRes(gradeId);
            var IsMoreInfo = Request.QueryString["IsMoreInfo"] != null ? Request.QueryString["IsMoreInfo"].ToString() : "";

            //用于侧边栏
            ViewBag.grade = g;
            var gradeSingle = GradeFunc.Instance.GetAllGradeResSingle(gradeId);
            var commList    = CommodityFunc.Instance.GetAllCommList();

            if (gradeSingle == null)
            {
                g           = GradeFunc.Instance.GetAllScenceRes(gradeId);
                gradeSingle = GradeFunc.Instance.GetAllScenceResSingle(gradeId);
                var tempG = GradeFunc.Instance.GetBranchGradeRes(g, gradeId);
                ViewBag.gradeSingle  = gradeSingle;
                ViewBag.listCommView = commList.Where(p => p.ScenceIds.Contains($",{gradeId}|")).ToList();
                ViewBag.gradeId      = gradeId;
                ViewBag.gradeInfo    = "scence";
            }
            else
            {
                ViewBag.gradeSingle = gradeSingle;
                var Ids = CommodityFunc.Instance.GetGradeIdsByGradeRes(GradeFunc.Instance.GetBranchGradeRes(g, gradeId));
                ViewBag.listCommView = commList.Where(p => Ids.Contains(p.GradeId.Value)).ToList();
                ViewBag.gradeId      = gradeId;
                ViewBag.gradeInfo    = "grade";
            }
            if (IsMoreInfo.ToLower() == "true")
            {
                return(View());
            }
            else
            {
                return(View("GradeType"));
            }
            #region 暂时废弃代码
            //List<Commodity_Stageprice_View> listComm2 = new List<Commodity_Stageprice_View>();
            //var priceCount = new List<CommPrice_Amount_CommIds>();
            //var starsCount = new List<CommStarsCount>();
            //var salesCount = new List<CommSalesCount>();
            //List<Commodityspview> listComm = new List<Commodityspview>();
            //priceCount = CommodityFunc.Instance.GetPriceCount(listCommView);
            //starsCount = CommodityFunc.Instance.GetStarCount(listCommView);
            //salesCount = CommodityFunc.Instance.GetSalesCount(listCommView);
            //var listColor = CommodityFunc.Instance.GetColorCount(listCommView);
            //var threeGrade = GradeFunc.Instance.GetThreeGrade(g, gradeId);
            //ViewBag.threeGrade = threeGrade;

            //ViewBag.priceCount = priceCount;
            //ViewBag.starsCount = starsCount;
            //ViewBag.salesCount = salesCount;
            //ViewBag.listColor = listColor;

            #endregion
        }
        /// <summary>
        /// 主页
        /// </summary>
        /// <param name="req">请求</param>
        /// <returns></returns>
        public ActionResult Index(CommodityListReq req)
        {
            var gradeId = req.gradeId;
            var g       = GradeFunc.Instance.GetAllGradeRes(gradeId);

            if (g == null)
            {
                g = GradeFunc.Instance.GetAllScenceRes(gradeId);
                ViewBag.gradeInfo = "scence";
            }
            //用于侧边栏
            ViewBag.grade = g;

            List <Commodityspview> listComm = new List <Commodityspview>();
            var tempG        = GradeFunc.Instance.GetBranchGradeRes(g, gradeId);
            var listCommView = CommodityFunc.Instance.GetListCommViewByGrade(tempG);
            var threeGrade   = GradeFunc.Instance.GetThreeGrade(g, gradeId);

            ViewBag.threeGrade   = threeGrade;
            ViewBag.gradeId      = gradeId;
            ViewBag.listCommView = listCommView;
            #region 废弃代码
            //var priceCount = new List<CommPrice_Amount_CommIds>();
            //var starsCount = new List<CommStarsCount>();
            //var salesCount = new List<CommSalesCount>();
            //priceCount = CommodityFunc.Instance.GetPriceCount(listCommView);
            //starsCount = CommodityFunc.Instance.GetStarCount(listCommView);
            //salesCount = CommodityFunc.Instance.GetSalesCount(listCommView);
            //ViewBag.priceCount = priceCount;
            //ViewBag.starsCount = starsCount;
            //ViewBag.salesCount = salesCount;
            //var listColor = CommodityFunc.Instance.GetColorCount(listCommView);
            //ViewBag.listColor = listColor;
            //ViewBag.isCommList = 1;
            #endregion

            return(View());
        }
        /// <summary>
        /// 主页
        /// </summary>
        /// <param name="req">请求</param>
        /// <returns></returns>
        public ActionResult GradeInfo(CommodityListReq req)
        {
            var gradeId = req.gradeId;
            var g       = GradeFunc.Instance.GetAllGradeRes(gradeId);

            if (g == null)
            {
                g = GradeFunc.Instance.GetAllScenceRes(gradeId);
                ViewBag.gradeInfo = "scence";
            }
            //用于侧边栏
            ViewBag.grade = g;

            List <Commodityspview> listComm = new List <Commodityspview>();
            var tempG        = GradeFunc.Instance.GetBranchGradeRes(g, gradeId);
            var listCommView = CommodityFunc.Instance.GetListCommViewByGrade(tempG);
            var threeGrade   = GradeFunc.Instance.GetThreeGrade(g, gradeId);

            ViewBag.threeGrade   = threeGrade;
            ViewBag.gradeId      = gradeId;
            ViewBag.listCommView = listCommView;
            return(View());
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public ActionResult Search(CommodityListReq req)
        {
            var text         = req.sText;
            var commList     = CommodityFunc.Instance.GetAllCommList();
            var listCommView = commList.Where(p => p.Name.Contains(text) || (p.Content != null && p.ProductNo.Contains(text)) || (p.Introduce != null && p.Introduce.Contains(text)) || (p.ProductNo != null && p.ProductNo.Contains(text))).ToList();

            ViewBag.text         = text;
            ViewBag.listCommView = listCommView;
            #region 暂时废弃代码
            //var listComm = new List<Commodity_Stageprice_View>();
            //var priceCount = CommodityFunc.Instance.GetPriceCount(listCommView);
            //var starsCount = CommodityFunc.Instance.GetStarCount(listCommView);
            //var salesCount = CommodityFunc.Instance.GetSalesCount(listCommView);
            //var listColor = CommodityFunc.Instance.GetColorCount(listCommView);
            ////价格
            //ViewBag.priceCount = priceCount;
            ////评价
            //ViewBag.starsCount = starsCount;
            ////销量
            //ViewBag.salesCount = salesCount;
            //ViewBag.listColor = listColor;
            #endregion
            return(View());
        }