private void btn_Admin_Click(object sender, EventArgs e) { string Username = "******", Password = "******"; if (CheckEmployee(Username, Password)) { Form_Home newform = new Form_Home(GetEmployee(Username, Encrypt(Password))); Hide(); newform.ShowDialog(); Close(); } else { MessageBox.Show("The Username or the password don't match", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }
private void btn_LogIn_Click(object sender, EventArgs e) { if (CheckForm()) { if (CheckEmployee(txt_Username.Text, txt_Password.Text)) { //Form_HomePage newform = new Form_HomePage(GetEmployee(txt_Username.Text, Encrypt(txt_Password.Text))); //Hide(); //newform.ShowDialog(); //Close(); Form_Home newform = new Form_Home(GetEmployee(txt_Username.Text, Encrypt(txt_Password.Text))); Hide(); newform.ShowDialog(); Close(); } else { MessageBox.Show("The Username or the password doesn't match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }