public void UserSearchList( string filter , int pageNumber , string mode , GlobalTemplateMembers.CommonHeadFootTemplate head , UserSearchListTemplate item , GlobalTemplateMembers.CommonHeadFootTemplate foot , GlobalTemplateMembers.NodataTemplate nodata ) { AdminUserFilter searchFilter; UserCollection users = new UserCollection(); int rowCount = 0; searchFilter = AdminUserFilter.GetFromFilter(filter); if (!string.IsNullOrEmpty(mode) && (mode.IndexOf("admin", StringComparison.OrdinalIgnoreCase) >= 0 || mode.IndexOf("realname", StringComparison.OrdinalIgnoreCase )>=0)) { if (searchFilter == null) { searchFilter = new AdminUserFilter(); searchFilter.Order = UserOrderBy.UserID; searchFilter.IsDesc = true; } if (searchFilter.FuzzySearch == null) searchFilter.FuzzySearch = true;//默认就是模糊搜索 users = UserBO.Instance.AdminSearchUsers(My.UserID, searchFilter, pageNumber, out rowCount); } else { if (searchFilter == null) return; } if (rowCount > 0) { head.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize)); foreach (User user in users) { item.Invoke(user); } foot.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize)); } else { nodata.Invoke(); } }
public void InviteSerialList( string filter , string mode , int pageNumber , InviteSerialManagerTemplate listItem , GlobalTemplateMembers.CommonHeadFootTemplate foot , GlobalTemplateMembers.CommonHeadFootTemplate head ) { InviteSerialFilter searchFilter = InviteSerialFilter.GetFromFilter(filter); InviteSerialCollection inviteSerials; int rowCount; if (searchFilter == null) searchFilter = new InviteSerialFilter(); int? owner = null; if (string.IsNullOrEmpty(mode) || !mode.Equals("admin", StringComparison.OrdinalIgnoreCase)) { if (searchFilter.Status == null) { searchFilter.Status = InviteSerialStatus.Unused; } owner =User.CurrentID; } inviteSerials = InviteBO.Instance.GetInviteSerials(User.Current, owner,searchFilter, pageNumber, out rowCount); UserBO.Instance.FillSimpleUsers(inviteSerials, 0); head.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize)); foreach (InviteSerial s in inviteSerials) { listItem.Invoke(s); } foot.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize)); }