Пример #1
0
    protected void SearchUsers_Click(object sender, EventArgs e)
    {
        RegistrationService.RegistrationService registrationService = ServiceAccess.GetInstance().GetRegistration();


        RegistrationService.UserRole userRole = (RegistrationService.UserRole)Convert.ToInt32(RoleDropDownList.SelectedValue);
        string firstName = FirstNameTextBox.Text;
        string lastName  = LastNameTextBox.Text;
        string userName  = UserNameTextBox.Text;

        try
        {
            RegistrationService.RegistrationInfo[] searchResults = registrationService.GetUsersList(userRole, firstName, lastName, userName);
            SearchUsersResultGridView.DataSource = searchResults;
            SearchUsersResultGridView.DataBind();
            ViewState["dataSource"]     = searchResults;
            SearchCriteriaPanel.Visible = false;
            SearchResultsPanel.Visible  = true;
            ResultCountLiteral.Text     = "Users result - " + searchResults.Length + " users found";
        }
        catch (Exception ex)
        {
            log.Error("Error searching Users", ex);
            ErrorLiteral.Text = "Error searching Users";
        }
    }
Пример #2
0
 protected void SearchUsersResultGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     SearchUsersResultGridView.PageIndex  = e.NewPageIndex;
     SearchUsersResultGridView.DataSource = (RegistrationService.RegistrationInfo[])ViewState["dataSource"];
     SearchUsersResultGridView.DataBind();
 }