コード例 #1
0
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAppListVM viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantAppListVM();

            #region 初始化查询条件

            viewModel.Search          = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>()
            {
                new XCLNetSearch.SearchFieldInfo("商户应用ID", "MerchantAppID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("商户应用Key", "AppKey|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("商户应用名", "MerchantAppName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户ID", "FK_MerchantID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户名", "MerchantName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("静态资源版本号", "ResourceVersion|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("联系人邮箱", "Email|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("版权信息", "CopyRight|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta描述", "MetaDescription|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta关键字", "MetaKeyWords|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta标题", "MetaTitle|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("站点网址", "WebURL|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("备注", "Remark|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("记录状态", "RecordState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum))),
                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.MerchantAppAPI.PageList(request).Body;
            viewModel.MerchantAppList = response.ResultList;
            viewModel.PagerModel      = response.PagerInfo;

            return(View("~/Views/Merchant/MerchantAppList.cshtml", viewModel));
        }
コード例 #2
0
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAppListVM viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantAppListVM();

            #region 初始化查询条件

            viewModel.Search          = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>()
            {
                new XCLNetSearch.SearchFieldInfo("商户应用ID", "MerchantAppID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("商户应用名", "MerchantAppName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户ID", "FK_MerchantID|number|text", ""),
                new XCLNetSearch.SearchFieldInfo("所属商户名", "MerchantName|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("静态资源版本号", "ResourceVersion|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("联系人邮箱", "Email|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("版权信息", "CopyRight|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta描述", "MetaDescription|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta关键字", "MetaKeyWords|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("Meta标题", "MetaTitle|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("站点网址", "WebURL|string|text", ""),
                new XCLNetSearch.SearchFieldInfo("备注", "Remark|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.MerchantAppAPI.PageList(request).Body;
            viewModel.MerchantAppList = response.ResultList;
            viewModel.PagerModel      = response.PagerInfo;

            return(View("~/Views/Merchant/MerchantAppList.cshtml", viewModel));
        }