private void btn_login_sudo_Click(object sender, EventArgs e)
        {
            Employee new_employeelogin = new Employee(txtBx_email_sudo.Text, txtBx_password_sudo.Text);

            if (db.VerifyEmployee(new_employeelogin))
            {
                new_employeelogin = db.List_of_employees.Find(x => x.Email == new_employeelogin.Email && x.Password == new_employeelogin.Password);
                current_employee  = new_employeelogin;
                this.Close();
                this.Dispose();
                SudoForm1 sudo1 = new SudoForm1(db);
                sudo1.ShowDialog();
            }
            else
            {
                // On ajoute une icône : celle d'une erreur. On change aussi les boutons.
                MessageBox.Show("This is not a valid username and/or password", "Titre", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
 public SudoForm1(DbManager db)
 {
     Current = this;
     this.db = db;
     InitializeComponent();
 }