Exemple #1
0
        private void FORGOT_btnCode_Click(object sender, EventArgs e)
        {
            // Check if the field is not empty
            if (FORGOT_txtCode.Text != String.Empty)
            {
                // Verify the code and send a new randomized password to the user
                if (authenticationService.ResetPassword(FORGOT_txtUsername.Text.ToLower(), FORGOT_txtCode.Text))
                {
                    // Hide insert code panel and show password successful reset panel
                    FORGOT_pnlCode.Hide();
                    FORGOT_pnlChange.Show();

                    // Clear code input and error
                    FORGOT_txtCode.Text = string.Empty;
                    errorProvider.SetError(FORGOT_txtCode, "");
                }
                else
                {
                    // Error message if the code does not match
                    errorProvider.SetError(FORGOT_txtCode, "Code does not match to the one that we send to your email");
                }
            }
            else
            {
                errorProvider.SetError(FORGOT_txtCode, "Please enter the code before continuing");
            }
        }
Exemple #2
0
        private void FORGOT_btnUsername_Click(object sender, EventArgs e)
        {
            // Check if the field is not empty
            if (FORGOT_txtUsername.Text != string.Empty)
            {
                // Check if this email exists in the database
                if (authenticationService.CheckEmailStatus(FORGOT_txtUsername.Text.ToLower()))
                {
                    // Hide the reset password username/email panel and show the insert code panel
                    FORGOT_pnlUsername.Hide();
                    FORGOT_pnlCode.Show();

                    // Send an email with a code that the user needs to fill in to request a new randomized password by email
                    authenticationService.RequestResetCode(FORGOT_txtUsername.Text.ToLower());
                }
                else
                {
                    // Error message if the email is not found
                    errorProvider.SetError(FORGOT_txtUsername, "This email address has not been registered");
                }
            }
            else
            {
                errorProvider.SetError(FORGOT_txtUsername, "Please enter your email before continuing");
            }
        }
Exemple #3
0
        private void ShowPanel(PanelType type)
        {
            HidePanels();

            if (type == PanelType.LOGIN)
            {
                pnlLogin.Show();
            }
            else if (type == PanelType.FORGOT)
            {
                pnl_ForgotPassword.Show();
                FORGOT_pnlCode.Hide();
                FORGOT_pnlChange.Hide();
            }
            else if (type == PanelType.USERSETTINGS)
            {
                pnl_Menu.Show();
                pnl_UserSettings.Show();
            }
            else if (type == PanelType.DASHBOARD)
            {
                InitDashBoard();

                pnl_Menu.Show();
                pnl_Dashboard.Show();
            }
            else if (type == PanelType.USERMANAGEMENT)
            {
                // Clean or add filter text
                USER_txtFilter.Text       = "Filter by choice";
                USER_txtFilter.GotFocus  += new EventHandler(RemoveText);
                USER_txtFilter.LostFocus += new EventHandler(AddText);

                // Start filtering selection at 1 aka Email
                USER_cbFilter.SelectedIndex = 1;

                // Init listview
                InitUserListView();

                pnl_Menu.Show();
                pnlUser.Show();
            }
            else if (type == PanelType.INCIDENTMANAGEMENT)
            {
                // Clean or add filter text
                TICKETS_txtFilter.Text       = "Filter by email";
                TICKETS_txtFilter.GotFocus  += new EventHandler(RemoveTextEmail);
                TICKETS_txtFilter.LostFocus += new EventHandler(AddTextEmail);

                // Start filtering selection at 2 aka User
                TICKETS_comboFilter.SelectedIndex = 2;

                // Init listview
                InitTicketOverview();

                // Show remove button if employee level access
                if (authenticationService.GetCurrentUser().Type == UserType.Employee)
                {
                    TICKET_btnRemove.Visible = true;
                }
                else
                {
                    TICKET_btnRemove.Visible = false;
                }

                pnl_Menu.Show();
                pnlTicketOverview.Show();
            }
        }
Exemple #4
0
 private void FORGOT_btnNewCode_Click(object sender, EventArgs e)
 {
     FORGOT_pnlUsername.Show();
     FORGOT_pnlCode.Hide();
     FORGOT_pnlChange.Hide();
 }