private void button1_Click(object sender, EventArgs e) { if (checkBox1.Checked) { var admin = Public.AdminLogIn(Public.admins, textBox1.Text, textBox2.Text); if (Public.admins.Contains(admin)) { MessageBox.Show("Hello,\n " + admin.getUsername(), "Success"); admin_interface f1 = new admin_interface(); this.Hide(); f1.ShowDialog(); this.Close(); } else { MessageBox.Show("Invalid username or password", "Login error"); } } else { Public.user = Public.UserLogIn(Public.users, textBox1.Text, textBox2.Text); if (Public.users.Contains(Public.user)) { Form1 f1 = new Form1(); this.Hide(); f1.ShowDialog(); this.Close(); } else { MessageBox.Show("Invalid username or password", "Login error"); } } }
private void button5_Click(object sender, EventArgs e) { admin_interface f1 = new admin_interface(); this.Hide(); f1.ShowDialog(); this.Close(); }