private void btnLogin_Click(object sender, EventArgs e) { if ((txtUname.Text == "cab") && (txtPword.Text == "123")) { MessageBox.Show("Welcome " + txtUname.Text, "Login successful", MessageBoxButtons.OK); formAdmin next = new formAdmin(txtUname.Text); txtUname.Text = ""; txtPword.Text = ""; this.Visible = false; next.ShowDialog(); this.Visible = true; } else { MessageBox.Show("The username or password you entered is incorrect\nPlease try again", "Login unsuccessful", MessageBoxButtons.OK); } }
public Repairs(formAdmin Admin) { InitializeComponent(); _formAdmin = Admin; }