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();
     }
 }
        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();
            }
        }
 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();
 }