public IActionResult OnGetUserPage(VUserListConditionInput input) { int pageCount; var data = userService.GetUserList(input, out pageCount); return(new JsonResult(new VModelTableOutput <UserInfoDto>(data, input.draw, pageCount))); }
public List <VUserListModel> GetUserList(VUserListConditionInput input, out int pageCount) { List <string> sqlwhere = new List <string>(); string whereStr = ""; if (!string.IsNullOrEmpty(input.name)) { sqlwhere.Add(" name like @name"); } if (!string.IsNullOrEmpty(input.phone)) { sqlwhere.Add(" phone = @phone"); } if (input.sex > -1) { sqlwhere.Add(" sex = @sex"); } if (sqlwhere.Count > 0) { whereStr = string.Join("and", sqlwhere); } var user = Repository.QueryList(input.pageNum, input.pageSize, whereString: whereStr, param: new { name = "%" + input.name + "%", phone = input.phone, sex = input.sex }, order: "createTime"); pageCount = user.pageCount; var res = ModelConvertUtil <UserInfo, VUserListModel> .ModelCopy(user.data); return(res); }
public List <AdminUserDto> GetUserList(VUserListConditionInput input, out int pageCount) { var user = adminRepository.GetUserInfoByQueryCondition(input, "CreateTime", false); pageCount = user.pageCount; return(ModelConvertUtil <AdminUserInfo, AdminUserDto> .ModelCopy(user.data)); }
public IActionResult QueryUserList(VUserListConditionInput input) { if (input == null) { input = new VUserListConditionInput(); } int pageCount; var data = accountService.GetUserList(input, out pageCount); return(new JsonResult(new VModelTableOutput <AdminUserDto>(data, input.draw, pageCount))); }
public IPage <AdminUserInfo> GetUserInfoByQueryCondition(VUserListConditionInput input, string orderBy, bool isAsc) { List <string> sqlwhere = new List <string>(); string whereStr = ""; if (!string.IsNullOrEmpty(input.realname)) { sqlwhere.Add(" RealName like @RealName "); } if (!string.IsNullOrEmpty(input.username)) { sqlwhere.Add(" UserName like @UserName "); } if (!string.IsNullOrEmpty(input.phone)) { sqlwhere.Add(" Phone = @Phone "); } if (!string.IsNullOrEmpty(input.email)) { sqlwhere.Add(" Email = @Email "); } if (input.isdisable > -1) { sqlwhere.Add(" IsDisable = @IsDisable "); } if (sqlwhere.Count > 0) { whereStr = string.Join("and", sqlwhere); } return(QueryList(input.pageNum, input.pageSize, whereString: whereStr, param: new { RealName = "%" + input.realname + "%", UserName = "******" + input.username + "%", Phone = input.phone, Email = input.email, IsDisable = input.isdisable }, order: orderBy, asc: isAsc)); }
public IPage <UserInfo> GetUserInfoByQueryCondition(VUserListConditionInput input, string orderBy, bool isAsc) { List <string> sqlwhere = new List <string>(); string whereStr = ""; if (!string.IsNullOrEmpty(input.name)) { sqlwhere.Add(" name like @name"); } if (!string.IsNullOrEmpty(input.phone)) { sqlwhere.Add(" phone = @phone"); } if (input.sex > -1) { sqlwhere.Add(" sex = @sex"); } if (sqlwhere.Count > 0) { whereStr = string.Join("and", sqlwhere); } return(QueryList(input.pageNum, input.pageSize, whereString: whereStr, param: new { name = "%" + input.name + "%", phone = input.phone, sex = input.sex }, order: orderBy, asc: isAsc)); }