private void MetroButton1_Click(object sender, EventArgs e) { var info = context.Authorities.FirstOrDefault(u => u.Email == txtUsername.Text && u.Password == txtPass.Text); var info1 = context.Users.FirstOrDefault(u => u.Email == txtUsername.Text && u.Password == txtPass.Text); // MessageBox.Show("invalid emails and password"); if (info != null) { LoginHelper.AInfo = info; AuthorityDashBoard A1 = new AuthorityDashBoard(); A1.Visible = true; this.Visible = false; } else if (info1 != null) { LoginHelper.UInfo = info1; UserDashBoard u1 = new UserDashBoard(); u1.Visible = true; this.Hide(); } else { MessageBox.Show("invalid emails and password"); } }
private void MetroButton3_Click(object sender, EventArgs e) { AuthorityDashBoard a1 = new AuthorityDashBoard(); a1.Visible = true; this.Visible = false; }