private void buttonBack_Click(object sender, EventArgs e) { try { this.Hide(); root.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) //autentificare { bool login = false; int rol = 0; using (var db = new BibliotecaEntities()) { var query = from p in db.People select p; foreach (var item in query) { if (item.Utilizator == username.Text) { if (item.Parola == PasswordHash.GetHashString(password.Text)) { rol = item.Rol; login = true; } } } } if (login) { if (rol == 1) { this.Close(); var membru = new MembruForm(); membru.Show(); } if (rol == 2) { this.Close(); var administrator = new AdministratorForm(); administrator.Show(); } } else { MessageBox.Show("Parola sau Nume de utilizator Incorect"); } }
private void buttonBack_Click(object sender, EventArgs e) { this.Hide(); root.Show(); this.Close(); }