예제 #1
0
        private void signinButton_Click(object sender, EventArgs e)
        {
            if (accountPassword == null)
            {
                Cursor.Current  = Cursors.WaitCursor;
                accountPassword = SQLHelper.GetAcountPassword(out bool DBErrorOccured);
                Cursor.Current  = Cursors.Default;

                if (DBErrorOccured)
                {
                    Messages.ShowDBErrorMsg();
                    return;
                }
            }

            if (passwordTextBox.Text != accountPassword)
            {
                if (!passwordTextBox.Text.Equals(""))
                {
                    passwordTextBox.BackColor = Color.LightCoral;
                    incorrectLabel.Visible    = true;
                }
            }
            else
            {
                FormShower.ShowDashboardForm();
                Hide();
            }
        }
예제 #2
0
 private void editButton_Click(object sender, EventArgs e)
 {
     if (labelListBox.SelectedIndex != -1)
     {
         FormShower.ShowChangePasswordForm(records[labelListBox.SelectedIndex]);
         RefreshRecords();
     }
 }
예제 #3
0
        private void Login_Shown(object sender, EventArgs e)
        {
            Cursor.Current  = Cursors.WaitCursor;
            accountPassword = SQLHelper.GetAcountPassword(out bool DBErrorOccured);
            Cursor.Current  = Cursors.Default;

            if (DBErrorOccured)
            {
                Messages.ShowDBErrorMsg();
            }
            else if (accountPassword == null)
            {
                FormShower.ShowSignUpForm();
                Hide();
            }
        }
예제 #4
0
        private void createButton_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (SQLHelper.IsValidPassword(passwordTextBox.Text))
            {
                if (SQLHelper.CreateUser(passwordTextBox.Text, out bool DBErrorOccurred) && !DBErrorOccurred)
                {
                    Cursor.Current = Cursors.Default;

                    DialogResult answer = Messages.ShowContinueMsg();

                    if (answer == DialogResult.Yes)
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        SQLHelper.DeleteAllRecords(out bool DBErrorOccured);
                        Cursor.Current = Cursors.Default;

                        if (DBErrorOccured)
                        {
                            Messages.ShowDBErrorMsg();
                        }
                        else
                        {
                            Messages.ShowWarningMsg();
                            FormShower.ShowDashboardForm();
                            Hide();
                        }
                    }
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                    Messages.ShowDBErrorMsg();
                }
            }
            else
            {
                Cursor.Current = Cursors.Default;
                Messages.ShowPasswordReqMsg();
            }
        }
예제 #5
0
 private void createLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     FormShower.ShowSignUpForm();
     Hide();
 }
예제 #6
0
 private void backLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     FormShower.ShowLoginForm();
     Hide();
 }
예제 #7
0
 private void addButton_Click(object sender, EventArgs e)
 {
     FormShower.ShowNewPasswordForm();
     RefreshRecords();
 }