protected void BtnUserSearch_Click(object sender, EventArgs e) { TestorCoreUser[] users = UserSearchHelper.FindUsers(userName.Text, TestorUserRole.NotDefined, TestorUserStatus.Any, 0, false); GridViewUsers.EmptyDataText = String.Format("Поиск: <b>{0}*</b>. Пользователи не найдены.", userName.Text); GridViewUsers.DataKeyNames = new string[] { "UserId" }; GridViewUsers.DataSource = users; GridViewUsers.DataBind(); GridViewUsers_SelectedIndexChanged(sender, e); }
public byte[] FindUsers(string userInfo, TestorUserRole userRole, TestorUserStatus userStatus, bool getRemoved, int groupId, int takeCount) { if (Provider.CurrentUser.UserRole == TestorUserRole.NotDefined || Provider.CurrentUser.UserRole == TestorUserRole.Anonymous || Provider.CurrentUser.UserRole == TestorUserRole.Student) { if (userRole != TestorUserRole.NotDefined && userRole != TestorUserRole.Anonymous && userRole != TestorUserRole.Student) { Provider.ThrowAccessFaultException(); } } return(DataCompressor.CompressData <TestorCoreUser[]>(UserSearchHelper.FindUsers(userInfo, userRole, userStatus, groupId, getRemoved, takeCount, true))); }