示例#1
0
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Article.ArticleListVM viewModel = new XCLCMS.View.AdminWeb.Models.Article.ArticleListVM();

            #region 初始化查询条件

            viewModel.Search          = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>()
            {
                new XCLNetSearch.SearchFieldInfo("文章ID", "ArticleID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户", "FK_MerchantID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属应用", "FK_MerchantAppID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("标题", "Title|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("作者", "AuthorName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("来源", "FromInfo|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("文章类型", "ArticleContentType|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("浏览数", "ViewCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("评论数", "CommentCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("热度", "HotCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("文章状态", "ArticleState|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("记录状态", "RecordState|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建时间", "CreateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建者名", "CreaterName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新时间", "UpdateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新人名", "UpdaterName|string|text", "")
            };
            string strWhere  = string.Format("RecordState='{0}'", XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum.N.ToString());
            string strSearch = viewModel.Search.StrSQL;
            if (!string.IsNullOrEmpty(strSearch))
            {
                strWhere = string.Format("{0} and ({1})", strWhere, strSearch);
            }

            #endregion 初始化查询条件

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.WebAPIEntity.RequestEntity.PageListConditionEntity>(base.UserToken);
            request.Body = new Data.WebAPIEntity.RequestEntity.PageListConditionEntity()
            {
                PagerInfoSimple = base.PageParamsInfo.ToPagerInfoSimple(),
                Where           = strWhere
            };
            var response = XCLCMS.Lib.WebAPI.ArticleAPI.PageList(request).Body;
            viewModel.ArticleList = response.ResultList;
            viewModel.PagerModel  = response.PagerInfo;

            return(View("~/Views/Article/ArticleList.cshtml", viewModel));
        }
示例#2
0
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Article.ArticleListVM viewModel = new XCLCMS.View.AdminWeb.Models.Article.ArticleListVM();

            #region 初始化查询条件

            viewModel.Search          = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>()
            {
                new XCLNetSearch.SearchFieldInfo("文章ID", "ArticleID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户ID", "FK_MerchantID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属应用ID", "FK_MerchantAppID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户名", "MerchantName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属应用名", "MerchantAppName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("标题", "Title|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("作者", "AuthorName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("来源", "FromInfo|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("内容类型", "ArticleContentType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.ArticleContentTypeEnum))),
                new XCLNetSearch.SearchFieldInfo("浏览数", "ViewCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("评论数", "CommentCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("热度", "HotCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("文章状态", "ArticleState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.ArticleStateEnum))),
                new XCLNetSearch.SearchFieldInfo("记录状态", "RecordState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum))),
                new XCLNetSearch.SearchFieldInfo("发布时间", "PublishTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建时间", "CreateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建者名", "CreaterName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新时间", "UpdateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新人名", "UpdaterName|string|text", "")
            };
            string strWhere = viewModel.Search.StrSQL;

            #endregion 初始化查询条件

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.WebAPIEntity.RequestEntity.PageListConditionEntity>(base.UserToken);
            request.Body = new Data.WebAPIEntity.RequestEntity.PageListConditionEntity()
            {
                PagerInfoSimple = base.PageParamsInfo.ToPagerInfoSimple(),
                Where           = strWhere
            };
            var response = XCLCMS.Lib.WebAPI.ArticleAPI.PageList(request).Body;
            viewModel.ArticleList = response.ResultList;
            viewModel.PagerModel  = response.PagerInfo;

            return(View("~/Views/Article/ArticleList.cshtml", viewModel));
        }
示例#3
0
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Article.ArticleListVM viewModel = new XCLCMS.View.AdminWeb.Models.Article.ArticleListVM();

            #region 初始化查询条件

            viewModel.Search          = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>()
            {
                new XCLNetSearch.SearchFieldInfo("文章ID", "ArticleID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户ID", "FK_MerchantID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属应用ID", "FK_MerchantAppID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户名", "MerchantName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属应用名", "MerchantAppName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("唯一标识", "Code|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("标题", "Title|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("子标题", "SubTitle|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("作者", "AuthorName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("来源", "FromInfo|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("内容类型", "ArticleContentType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.ArticleContentTypeEnum))),
                new XCLNetSearch.SearchFieldInfo("正文", "Contents|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("概述", "Summary|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("浏览数", "ViewCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("是否能够评论", "IsCanComment|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("评论数", "CommentCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("点【好】数", "GoodCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("点【中】数", "MiddleCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("点【差】数", "BadCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("热度", "HotCount|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("打开方式", "URLOpenType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.URLOpenTypeEnum))),
                new XCLNetSearch.SearchFieldInfo("文章状态", "ArticleState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.ArticleStateEnum))),
                new XCLNetSearch.SearchFieldInfo("审核状态", "VerifyState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.VerifyStateEnum))),
                new XCLNetSearch.SearchFieldInfo("是否推荐", "IsRecommend|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("是否为精华", "IsEssence|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("是否置顶", "IsTop|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("置顶开始时间", "TopBeginTime|dateTime|text", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("置顶结束时间", "TopEndTime|dateTime|text", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.YesNoEnum))),
                new XCLNetSearch.SearchFieldInfo("关键字", "KeyWords|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("标签", "Tags|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("点评", "Comments|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("链接地址", "LinkUrl|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("记录状态", "RecordState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum))),
                new XCLNetSearch.SearchFieldInfo("发布时间", "PublishTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建时间", "CreateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("创建者名", "CreaterName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新时间", "UpdateTime|dateTime|text", ""),
                new XCLNetSearch.SearchFieldInfo("更新人名", "UpdaterName|string|text", "")
            };
            string strWhere = viewModel.Search.StrSQL;

            if (!XCLCMS.Lib.Permission.PerHelper.HasPermission(base.UserID, Data.CommonHelper.Function.FunctionEnum.SysFun_DataFilter_ShowAllRecordState))
            {
                strWhere = XCLNetTools.DataBase.SQLLibrary.JoinWithAnd(new List <string>()
                {
                    strWhere,
                    "RecordState='N'"
                });
            }

            #endregion 初始化查询条件

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.WebAPIEntity.RequestEntity.PageListConditionEntity>(base.UserToken);
            request.Body = new Data.WebAPIEntity.RequestEntity.PageListConditionEntity()
            {
                PagerInfoSimple = base.PageParamsInfo.ToPagerInfoSimple(),
                Where           = strWhere
            };
            var response = XCLCMS.Lib.WebAPI.ArticleAPI.PageList(request).Body;
            viewModel.ArticleList = response.ResultList;
            viewModel.PagerModel  = response.PagerInfo;

            return(View("~/Views/Article/ArticleList.cshtml", viewModel));
        }