private void LoginDiry_Click(object sender, EventArgs e) { if (UsertextBox.Text == "" || PasswordtextBox.Text == "") { MessageBox.Show("Username or Password can not be empty"); } else { UserDataServices userService = new UserDataServices(); bool result = userService.LoginValidation(UsertextBox.Text, PasswordtextBox.Text); if (result) { ShowDiry diary = new ShowDiry(); diary.Show(); this.Hide(); } else { MessageBox.Show("Invalid Username or Password"); } } }