Exemple #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));
            }
        }
        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));
        }
Exemple #3
0
        public ActionResult List(string articleTitle, string Keyword, string sortColumn, string sortDirection, int?articleClassId1, int pageSize = 10, int pageNumber = 1)
        {
            pageSize = WorkContext.SiteConfig.pageSize;
            int articleClassId = 0;

            if (articleClassId1 == null)
            {
                articleClassId = 233;
            }
            else
            {
                articleClassId = (int)articleClassId1;
            }

            ArticleClassInfo classInfo = ArticleClass.AdminGetModelById(articleClassId);

            //if (classInfo == null)
            //    return PromptView("文章分类不存在");

            ////管理菜单
            //if ((classInfo.ClassType.Equals(-1)) || (classInfo.ClassType.Equals(0)))
            //    Response.Redirect(classInfo.AdminUrl);
            ////单页
            //if (classInfo.ClassType.Equals(1))
            //    return RedirectToAction("Page", new { articleClassId = articleClassId });
            string condition = Article.AdminGetArticleListCondition(articleClassId, articleTitle);
            //string condition = " [Keyword] = 1 ";
            string    condition1 = condition + @" or [Keyword] = 1  ";
            string    sort       = Article.AdminGetArticleListSort(sortColumn, sortDirection);
            PageModel pageModel  = new PageModel(pageSize, pageNumber, Article.AdminGetArticleCount(condition1));
            //
            ArticleListModel model = new ArticleListModel()
            {
                DataList       = Article.AdminGetArticleList(pageModel.PageSize, pageModel.PageNumber, condition1, sort),
                PageModel      = pageModel,
                SortColumn     = sortColumn,
                SortDirection  = sortDirection,
                ArticleClassID = articleClassId,
                ArticleTitle   = articleTitle,
                ClassInfo      = classInfo
            };
            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(articleClassId);

            ViewData["classPath"] = classPath;
            SiteUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&articleClassId={5}&newsTitle={6}",
                                                          Url.Action("List"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          sortColumn,
                                                          sortDirection,
                                                          articleClassId,
                                                          articleTitle));
            return(View(model));
        }
        public ActionResult Add(int productClassId)
        {
            ProductModel model = new ProductModel()
            {
                AddTime = DateTime.Now, UpdateTime = DateTime.Now, IsShow = 1
            };

            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(productClassId);

            ViewData["classPath"] = classPath;

            Load();

            return(View(model));
        }
        public ActionResult List(string articleTitle, string Keyword, string sortColumn, string sortDirection, int?articleClassId1, int pageSize = 15, int pageNumber = 1)
        {
            pageSize = WorkContext.SiteConfig.pageSize;
            int articleClassId = 0;

            if (articleClassId1 == null)
            {
                articleClassId = 243;
            }
            else
            {
                articleClassId = (int)articleClassId1;
            }

            ArticleClassInfo classInfo = ArticleClass.AdminGetModelById(articleClassId);

            int userID = WorkContext.Uid;

            string condition = Article.AdminGetArticleListCondition(articleClassId, articleTitle);

            string    condition1 = @" ( " + condition + @" or [Keyword] = 4 ) " + " and [AdminID] = " + userID;
            string    sort       = Article.AdminGetArticleListSort(sortColumn, sortDirection);
            PageModel pageModel  = new PageModel(pageSize, pageNumber, Article.AdminGetArticleCount(condition1));

            ArticleListModel model = new ArticleListModel()
            {
                DataList       = Article.AdminGetArticleList(pageModel.PageSize, pageModel.PageNumber, condition1, sort),
                PageModel      = pageModel,
                SortColumn     = sortColumn,
                SortDirection  = sortDirection,
                ArticleClassID = articleClassId,
                ArticleTitle   = articleTitle,
                ClassInfo      = classInfo
            };

            SiteUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&articleClassId={5}&newsTitle={6}",
                                                          Url.Action("List"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          sortColumn,
                                                          sortDirection,
                                                          articleClassId,
                                                          articleTitle));
            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(articleClassId);

            ViewData["classPath"] = classPath;
            return(View(model));
        }
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="articleTitle"></param>
        /// <param name="sortColumn"></param>
        /// <param name="sortDirection"></param>
        /// <param name="articleClassId"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageNumber"></param>
        /// <returns></returns>
        public ActionResult List(string productTitle, string sortColumn, string sortDirection, int productClassId, int pageSize = 15, int pageNumber = 1)
        {
            pageSize = WorkContext.SiteConfig.pageSize;
            ArticleClassInfo classInfo = ArticleClass.AdminGetModelById(productClassId);

            if (classInfo == null)
            {
                return(PromptView("文章分类不存在"));
            }


            string    condition = Product.AdminGetProductListCondition(productClassId, productTitle);
            string    sort      = Product.AdminGetProductListSort(sortColumn, sortDirection);
            PageModel pageModel = new PageModel(pageSize, pageNumber, Product.AdminGetProductCount(condition));

            ProductListModel model = new ProductListModel()
            {
                DataList       = Product.AdminGetProductList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel      = pageModel,
                SortColumn     = sortColumn,
                SortDirection  = sortDirection,
                ProductClassID = productClassId,
                ProductTitle   = productTitle,
                ClassInfo      = classInfo
            };

            SiteUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&productClassId={5}&productTitle={6}",
                                                          Url.Action("List"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          sortColumn,
                                                          sortDirection,
                                                          productClassId,
                                                          productTitle));

            //List<SelectListItem> list = new List<SelectListItem>();
            //list.Add(new SelectListItem() { Text = "全部类型", Value = "0" });
            //foreach (NewsTypeInfo newsTypeInfo in AdminNews.GetNewsTypeList())
            //{
            //    list.Add(new SelectListItem() { Text = newsTypeInfo.Name, Value = newsTypeInfo.NewsTypeId.ToString() });
            //}
            //ViewData["newsTypeList"] = list;
            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(productClassId);

            ViewData["classPath"] = classPath;
            return(View(model));
        }
        public ActionResult Edit(int productid = -1)
        {
            ProductInfo productInfo = Product.GetModelByProductID(productid);

            if (productInfo == null)
            {
                return(PromptView("产品不存在"));
            }

            ProductModel model = new ProductModel()
            {
                ProductClassID = productInfo.ProductClassID,
                Title          = productInfo.Title,
                Code           = productInfo.Code,
                Type           = productInfo.Type,
                Provider       = productInfo.Provider,
                Digest         = productInfo.Digest,
                ImgUrl         = productInfo.ImgUrl,
                Body           = productInfo.Body,
                IsShow         = productInfo.IsShow,
                IsBest         = productInfo.IsBest,
                IsTop          = productInfo.IsTop,
                AddTime        = productInfo.AddTime,
                AdminID        = productInfo.AdminID,
                BigImgUrl      = productInfo.BigImgUrl,
                DisplayOrder   = productInfo.DisplayOrder,
                Hits           = productInfo.Hits,
                Keys           = productInfo.Keys,
                UpdateTime     = productInfo.UpdateTime,
                Keyword        = productInfo.Keyword,
                Description    = productInfo.Description
            };


            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(productInfo.ProductClassID);

            ViewData["classPath"] = classPath;

            Load();

            ViewData["referer"] = SiteUtils.GetAdminRefererCookie();

            return(View(model));
        }
Exemple #8
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", "链接失效!"));
            }
        }
Exemple #9
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));
        }
        /// <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));
        }
Exemple #11
0
        public ActionResult List(string articleTitle, string Keywords, string sortColumn, string sortDirection, string dayTime, string status, string setArticleClassId, int?articleClassId1, int pageSize = 10, int pageNumber = 1)
        {
            if (setArticleClassId == null)
            {
                setArticleClassId = "";
            }
            //查询条件
            string condition = " [DisplayType] in (0,2,4) ";

            //审核状态 选中状态
            string[] statusArray = new string[3];
            if (!string.IsNullOrEmpty(status) && !status.Equals("4"))
            {
                statusArray[Convert.ToInt32(status)] = "selected";
                condition = condition + " and ApprovalStatus=" + status;
            }
            ViewData["statusArray"] = statusArray;
            if (!string.IsNullOrEmpty(setArticleClassId) && Convert.ToInt32(setArticleClassId) > 0)
            {
                DataTable articleClassDt = Article.GetArtClaIdByParentArticleClassIDs(Convert.ToInt32(setArticleClassId));
                if (articleClassDt != null && articleClassDt.Rows.Count > 0)
                {
                    string articleClasss = "";
                    for (int i = 0; i < articleClassDt.Rows.Count; i++)
                    {
                        DataTable articleClassDt2 = Article.GetArtClaIdByParentArticleClassIDs(Convert.ToInt32(articleClassDt.Rows[i]["ArticleClassID"].ToString()));
                        if (articleClassDt2 != null && articleClassDt2.Rows.Count > 0)
                        {
                            for (int j = 0; j < articleClassDt2.Rows.Count; j++)
                            {
                                articleClasss += Convert.ToInt32(articleClassDt2.Rows[j]["ArticleClassID"].ToString()) + ",";
                            }
                        }
                        else
                        {
                            articleClasss += Convert.ToInt32(articleClassDt.Rows[i]["ArticleClassID"].ToString()) + ",";
                        }
                    }
                    articleClasss = articleClasss.Substring(0, articleClasss.Length - 1);
                    condition     = condition + "  and ArticleClassID in " + "(" + articleClasss + ")";
                }
                else
                {
                    //没有下级菜单
                    condition = condition + " and ArticleClassID=" + Convert.ToInt32(setArticleClassId);
                }
            }
            ViewData["setArticleClassId"] = setArticleClassId;
            MenuModel menuModel = new MenuModel();

            menuModel.MenuList   = BonSite.Services.ArticleClass.AdminGetArticleClassTreeList();
            ViewData["MenuList"] = menuModel.MenuList;
            //时间选择状态
            if (!string.IsNullOrEmpty(dayTime))
            {
                DateTime dtStart = TypeHelper.StringToDateTime(dayTime);
                DateTime dtEnd   = dtStart.AddDays(1);
                condition = condition + " and AddTime > '" + dtStart + "' and AddTime < '" + dtEnd + "'";
            }
            ViewData["dayTime"] = dayTime;
            //标题关键字
            if (Keywords != null && !string.IsNullOrEmpty(Keywords))
            {
                ViewData["Keywords"] = Keywords;
                condition            = condition + " and Title like '%" + Keywords + "%'";
            }



            pageSize = WorkContext.SiteConfig.pageSize;
            int articleClassId = 0;

            if (articleClassId1 == null)
            {
                articleClassId = 299;
            }
            else
            {
                articleClassId = (int)articleClassId1;
            }

            ArticleClassInfo classInfo = ArticleClass.AdminGetModelById(articleClassId);
            //string condition = Article.AdminGetArticleListCondition(articleClassId, articleTitle);
            //string condition1 = condition + @" or [Keyword] = 1  ";
            string    sort      = Article.AdminGetArticleListSort(sortColumn, sortDirection);
            PageModel pageModel = new PageModel(pageSize, pageNumber, Article.AdminGetArticleCount(condition));
            //
            ArticleListModel model = new ArticleListModel()
            {
                DataList       = Article.AdminGetArticleList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel      = pageModel,
                SortColumn     = sortColumn,
                SortDirection  = sortDirection,
                ArticleClassID = articleClassId,
                ArticleTitle   = articleTitle,
                ClassInfo      = classInfo
            };
            //foreach (DataRow item in model.DataList.Rows)
            //{
            //    //获取一级分类
            //    int ParentArticleClassID = 0;
            //    int ArticleClassID = Convert.ToInt32(item["ArticleClassID"].ToString());
            //    ParentArticleClassID = Article.GetNameByArticleClassID2(ArticleClassID);
            //    if (ParentArticleClassID > 0)
            //    {
            //        ArticleClassID = Article.GetNameByArticleClassID2(ParentArticleClassID);
            //        if (ArticleClassID > 0)
            //        {
            //            ParentArticleClassID = Article.GetNameByArticleClassID2(ArticleClassID);
            //            if (ParentArticleClassID > 0)
            //            {
            //                ArticleClassID = Article.GetNameByArticleClassID2(ParentArticleClassID);
            //                if (ArticleClassID > 0)
            //                {
            //                    ParentArticleClassID = Article.GetNameByArticleClassID2(ArticleClassID);
            //                    if (ParentArticleClassID > 0)
            //                    {

            //                    }
            //                    else
            //                    {
            //                        //如果没有上级菜单,则取当前栏目
            //                        ParentArticleClassID = ArticleClassID;
            //                    }
            //                }
            //            }
            //            else
            //            {
            //                //如果没有上级菜单,则取当前栏目
            //                ParentArticleClassID = ArticleClassID;
            //            }
            //        }
            //    }
            //    else
            //    {
            //        //如果没有上级菜单,则取当前栏目
            //        ParentArticleClassID = ArticleClassID;
            //    }
            //    item["ArticleClassID"] = ParentArticleClassID;
            //}
            List <ArticleClassInfo> classPath = ArticleClass.GetArticleClassPath(articleClassId);

            ViewData["classPath"] = classPath;
            SiteUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&articleClassId={5}&newsTitle={6}",
                                                          Url.Action("List"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          sortColumn,
                                                          sortDirection,
                                                          articleClassId,
                                                          articleTitle));
            return(View(model));
        }