public ActionResult Index() { XCLCMS.View.AdminWeb.Models.UserInfo.UserInfoListVM viewModel = new XCLCMS.View.AdminWeb.Models.UserInfo.UserInfoListVM(); #region 初始化查询条件 viewModel.Search = new XCLNetSearch.Search(); viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>() { new XCLNetSearch.SearchFieldInfo("用户ID", "UserInfoID|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("用户名", "UserName|string|text", ""), new XCLNetSearch.SearchFieldInfo("真实姓名", "RealName|string|text", ""), new XCLNetSearch.SearchFieldInfo("昵称", "NickName|string|text", ""), new XCLNetSearch.SearchFieldInfo("年龄", "Age|number|text", ""), new XCLNetSearch.SearchFieldInfo("性别", "SexType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.UserSexTypeEnum))), new XCLNetSearch.SearchFieldInfo("出生日期", "Birthday|dateTime|text", ""), new XCLNetSearch.SearchFieldInfo("手机号", "Tel|string|text", ""), new XCLNetSearch.SearchFieldInfo("QQ", "QQ|string|text", ""), new XCLNetSearch.SearchFieldInfo("电子邮件", "Email|string|text", ""), new XCLNetSearch.SearchFieldInfo("其它联系方式", "OtherContact|string|text", ""), new XCLNetSearch.SearchFieldInfo("备注", "Remark|string|text", ""), new XCLNetSearch.SearchFieldInfo("角色", "RoleName|string|text", ""), new XCLNetSearch.SearchFieldInfo("用户状态", "UserState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.UserStateEnum))), new XCLNetSearch.SearchFieldInfo("用户类别", "UserType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.UserTypeEnum))), 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.UserInfoAPI.PageList(request).Body; viewModel.UserInfoList = response.ResultList; viewModel.PagerModel = response.PagerInfo; return(View("~/Views/UserInfo/UserInfoList.cshtml", viewModel)); }
public ActionResult Index() { XCLCMS.View.AdminWeb.Models.UserInfo.UserInfoListVM viewModel = new XCLCMS.View.AdminWeb.Models.UserInfo.UserInfoListVM(); #region 初始化查询条件 viewModel.Search = new XCLNetSearch.Search(); viewModel.Search.TypeList = new List <XCLNetSearch.SearchFieldInfo>() { new XCLNetSearch.SearchFieldInfo("用户ID", "UserInfoID|number|text", ""), new XCLNetSearch.SearchFieldInfo("所属商户", "FK_MerchantID|number|text", ""), new XCLNetSearch.SearchFieldInfo("所属应用", "FK_MerchantAppID|number|text", ""), new XCLNetSearch.SearchFieldInfo("用户名", "UserName|string|text", ""), new XCLNetSearch.SearchFieldInfo("真实姓名", "RealName|string|text", ""), new XCLNetSearch.SearchFieldInfo("昵称", "NickName|string|text", ""), new XCLNetSearch.SearchFieldInfo("年龄", "Age|number|text", ""), new XCLNetSearch.SearchFieldInfo("性别", "SexType|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.UserSexTypeEnum))), new XCLNetSearch.SearchFieldInfo("出生日期", "Birthday|dateTime|text", ""), new XCLNetSearch.SearchFieldInfo("手机号", "Tel|string|text", ""), new XCLNetSearch.SearchFieldInfo("QQ", "QQ|string|text", ""), new XCLNetSearch.SearchFieldInfo("电子邮件", "Email|string|text", ""), new XCLNetSearch.SearchFieldInfo("其它联系方式", "OtherContact|string|text", ""), new XCLNetSearch.SearchFieldInfo("备注", "Remark|string|text", ""), new XCLNetSearch.SearchFieldInfo("角色", "RoleName|string|text", ""), new XCLNetSearch.SearchFieldInfo("用户状态", "UserState|string|select", XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.UserStateEnum))), 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.UserInfoAPI.PageList(request).Body; viewModel.UserInfoList = response.ResultList; viewModel.PagerModel = response.PagerInfo; return(View("~/Views/UserInfo/UserInfoList.cshtml", viewModel)); }