Esempio n. 1
0
        /// <summary>
        /// 产品详情
        /// </summary>
        /// <returns></returns>
        public ActionResult Details()
        {
            int id = GetRouteInt("id");

            if (id == 0)
            {
                id = WebHelper.GetQueryInt("id");
            }

            ProductInfo info = Product.GetModelByProductID(id);

            if (info == null)
            {
                return(PromptView("/", "您访问的页面不存在"));
            }


            ProductModel model = new ProductModel
            {
                ProductInfo      = info,
                ArticleClassInfo = ArticleClass.GetModelById(info.ProductClassID),
                ClassPath        = ArticleClass.GetArticleClassPath(info.ProductClassID)
            };

            if (model.ArticleClassInfo.ContentView.Length > 0)
            {
                return(View("details." + model.ArticleClassInfo.ContentView, model));
            }
            else
            {
                return(View(model));
            }
        }
Esempio n. 2
0
        public ActionResult Index(int?id)
        {
            int id1 = id == null ? 0 : (int)id;

            ArticleInfo info = Article.GetModelByArticleID(id1);

            if (info == null)
            {
                return(PromptView("/Null/Index", "链接失效!"));
            }

            ArticleModel model = new ArticleModel();


            model.ArticleInfo      = info;
            model.ArticleClassInfo = ArticleClass.GetModelById(info.ArticleClassID);
            model.ClssPath         = ArticleClass.GetArticleClassPath(info.ArticleClassID);
            //访问量加一
            ArticleInfo info2 = Article.GetModelByArticleID(id1);
            int         Hits  = Convert.ToInt32(info2.Hits) + 1;

            info2.Hits = Hits;
            Article.Update(info2);
            return(View(model));
        }
Esempio n. 3
0
        //预览
        public ActionResult Preview(int id = -1)
        {
            ArticleInfo      articleInfo      = Article.GetModelByArticleID(id);
            ArticleClassInfo articleClassInfo = ArticleClass.GetModelById(articleInfo.ArticleClassID);
            ArticleModel     model            = new ArticleModel()
            {
                ArticleClassID = articleInfo.ArticleClassID,
                Title          = articleInfo.Title,
                SpecialID      = articleInfo.SpecialID,
                DisplayType    = articleInfo.DisplayType,
                Url            = articleInfo.Url,
                Digest         = articleInfo.Digest,
                ImgUrl         = articleInfo.ImgUrl,
                Body           = articleInfo.Body,
                Author         = articleInfo.Author,
                ComeForm       = articleInfo.ComeForm,
                IsShow         = articleInfo.IsShow,
                IsHome         = articleInfo.IsHome,
                IsBest         = articleInfo.IsBest,
                IsTop          = articleInfo.IsTop,
                AddTime        = articleInfo.AddTime,
                Keyword        = articleInfo.Keyword,
                Description    = articleInfo.Description,
                InformType     = articleInfo.InformType,
                EndTime        = articleInfo.EndTime,
                InformGroup    = articleInfo.InformGroup,
                MicroVideo     = articleInfo.MicroVideo
            };

            if (articleInfo != null)
            {
                if (articleInfo.DisplayType.Equals(4))
                {
                    ViewData["actlcle"]    = "display:none";
                    ViewData["video"]      = "";
                    ViewData["ArticleImg"] = "display:none";
                }
                else
                {
                    ViewData["actlcle"]    = "";
                    ViewData["video"]      = "display:none";
                    ViewData["ArticleImg"] = "display:none";
                }
                if (articleClassInfo.ClassType.Equals(3))
                {
                    ViewData["actlcle"]    = "";
                    ViewData["video"]      = "display:none";
                    ViewData["ArticleImg"] = "";
                }
                //外部链接转向
                if (articleInfo.DisplayType.Equals(1))
                {
                    return(Redirect(articleInfo.Url));
                }
            }
            return(View(model));
        }
Esempio n. 4
0
        /// <summary>
        /// 产品列表
        /// </summary>
        /// <returns></returns>
        public ActionResult List()
        {
            int classid = GetRouteInt("classid");

            if (classid == 0)
            {
                classid = WebHelper.GetQueryInt("classid");
            }
            int page = GetRouteInt("page");

            if (page == 0)
            {
                page = WebHelper.GetQueryInt("page");
            }

            ArticleClassInfo info = ArticleClass.GetModelById(classid);

            if (info == null)
            {
                return(PromptView("/", "您访问的页面不存在"));
            }

            string condition = Product.GetProductListCondition(classid, "");
            string sort      = Product.GetProductListSort("", "");

            PageModel pageModel = new PageModel(20, page, Product.GetProductCount(condition));



            ProductListModel model = new ProductListModel
            {
                ArticleClassID   = classid,
                ArticleClassInfo = info,
                ClassPath        = ProductClass.GetProductClassPath(classid),
                ProductList      = Product.GetProductList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel        = pageModel
            };

            if (info.ListView.Length > 0)
            {
                return(View("List." + info.ListView, model));
            }
            else
            {
                return(View(model));
            }
        }
Esempio n. 5
0
        //班牌内容
        public ActionResult View(int?id)
        {
            //select TOP 1 [ArticleId] from [bs_Article] where (ArticleClassId=243) order by UpdateTime desc
            int id1            = 0;
            int articleClassId = 0;

            articleClassId = Article.GetArticleClassIdByIsClassBrand();

            if (id == null)
            {
                //获取班牌专栏最新新闻
                id1 = Article.GetTopArticleIdByArticleClassId(articleClassId);
            }
            else
            {
                id1 = (int)id;
            }

            ArticleInfo info = Article.GetModelByArticleID(id1);

            if (info == null)
            {
                return(PromptView("/Null/Index", "链接失效!"));
            }

            //if (info.IsShow == 0)
            //    return PromptView("/", "您访问的页面不存在");
            ArticleModel model = new ArticleModel();

            if (info.IsClassBrand == 1)
            {
                model.ArticleInfo      = info;
                model.ArticleClassInfo = ArticleClass.GetModelById(info.ArticleClassID);
                model.ClssPath         = ArticleClass.GetArticleClassPath(info.ArticleClassID);

                return(View(model));
            }
            else
            {
                return(PromptView("/Null/Index", "链接失效!"));
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 门店列表
        /// </summary>
        /// <returns></returns>
        public ActionResult List()
        {
            int classid = GetRouteInt("classid");

            if (classid == 0)
            {
                classid = WebHelper.GetQueryInt("classid");
            }

            string city = GetRouteString("city");

            if (city == "")
            {
                city = WebHelper.GetQueryString("city");
            }
            if (city == "")
            {
                city = "全部";
            }


            int page = GetRouteInt("page");

            if (page == 0)
            {
                page = WebHelper.GetQueryInt("page");
            }


            ArticleClassInfo info = ArticleClass.GetModelById(classid);

            if (info == null)
            {
                return(PromptView("/", "您访问的页面不存在"));
            }


            string condition = Job.GetJobListCondition(city, "");
            string sort      = Job.GetJobListSort("", "asc");

            PageModel pageModel = new PageModel(20, page, Job.GetJobCount(condition));



            JobListModel model = new JobListModel
            {
                ArticleClassID   = classid,
                ArticleClassInfo = info,
                ClassPath        = ArticleClass.GetArticleClassPath(classid),
                City             = city,
                JobList          = Job.GetJobList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel        = pageModel
            };

            //if (info.ListView.Length > 0)
            //    return View("List." + info.ListView, model);
            //else
            //    return View(model);


            List <SelectListItem> jobcityList = new List <SelectListItem>();

            jobcityList.Add(new SelectListItem()
            {
                Text  = "全部",
                Value = ""
            });
            foreach (DataRow drRow in Job.GetJobCityList().Rows)
            {
                jobcityList.Add(new SelectListItem()
                {
                    Text  = drRow["city"].ToString(),
                    Value = drRow["city"].ToString()
                });
            }

            ViewData["jobcityList"] = jobcityList;


            return(View(model));
        }
Esempio n. 7
0
        /// <summary>
        /// 门店列表
        /// </summary>
        /// <returns></returns>
        public ActionResult List()
        {
            int classid = GetRouteInt("classid");

            if (classid == 0)
            {
                classid = WebHelper.GetQueryInt("classid");
            }

            string area = GetRouteString("area");

            if (area == "")
            {
                area = WebHelper.GetQueryString("area");
            }
            if (area == "")
            {
                area = "全部";
            }


            int page = GetRouteInt("page");

            if (page == 0)
            {
                page = WebHelper.GetQueryInt("page");
            }


            ArticleClassInfo info = ArticleClass.GetModelById(classid);

            if (info == null)
            {
                return(PromptView("/", "您访问的页面不存在"));
            }


            string condition = Shop.GetShopListCondition(area, "全部", "");
            string sort      = Shop.GetShopListSort("", "asc");

            PageModel pageModel = new PageModel(20, page, Shop.GetShopCount(condition));



            ShopListModel model = new ShopListModel
            {
                ArticleClassID   = classid,
                ArticleClassInfo = info,
                ClassPath        = ArticleClass.GetArticleClassPath(classid),
                Area             = area,
                ShopList         = Shop.GetShopList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel        = pageModel
            };

            //if (info.ListView.Length > 0)
            //    return View("List." + info.ListView, model);
            //else
            //    return View(model);


            List <SelectListItem> shopareaList = new List <SelectListItem>();

            shopareaList.Add(new SelectListItem()
            {
                Text  = "全部",
                Value = ""
            });
            foreach (DataRow drRow in Shop.GetShopAreaList().Rows)
            {
                shopareaList.Add(new SelectListItem()
                {
                    Text  = drRow["area"].ToString(),
                    Value = drRow["area"].ToString()
                });
            }

            ViewData["shopareaList"] = shopareaList;

            return(View(model));
        }