コード例 #1
0
 private void LogIn(object sender, EventArgs e)
 {
     if (tbUsername.TextLength >= 3)
     {
         if (Administration.LogIn(tbUsername.Text, tbPassword.Text))
         {
             Form form = new HoofdForm(Administration);
             form.Show();
             this.Hide();
         }
         else
         {
             tbPassword.Text = string.Empty;
             MessageBox.Show("De combinatie van gebruikersnaam en wachtwoord bestaat niet!", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         tbPassword.Text = string.Empty;
         MessageBox.Show("Gebruikersnaam is te kort.", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #2
0
 //Closes this screen, and brings the user back to the main menu
 private void HulpVragen_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (!questionOpened)
     {
         Form form = new HoofdForm(Administration);
         form.Show();
     }
 }
コード例 #3
0
        private void btnProceed_Click(object sender, EventArgs e)
        {
            string ErrorMessage = string.Empty;
            string name = this.tbName.Text;
            string address = this.tbAdress.Text;
            string city = this.tbCity.Text;
            string sex = this.cbSex.SelectedItem.ToString();
            string role = this.cbRoles.SelectedItem.ToString();
            string avatarPath = ofd.FileName;
            string password = this.tbPassword1.Text;
            string email = this.tbEmail.Text;

            //Check if the account is filled in correctly
            if (Administration.CreateAccount(name, address, city, password, avatarPath, role, sex, email, out ErrorMessage))
            {
                //If role is 'hulpbehoevende', it's done
                if (cbRoles.SelectedIndex == 0)
                {
                     if (Administration.RegisterAccount())
                     {
                         Form form = new HoofdForm(Administration);
                         form.Show();
                         this.Hide();
                     }
                }
                else
                {
                    //else, send the 'hulpverlener' to the next screen
                    Form form = new Registreren2(this, Administration);
                    form.Show();
                    this.Hide();
                }
            }
            else
                MessageBox.Show(ErrorMessage);
        }