private void button1_Click(object sender, EventArgs e) { if ((logInUserText.Text != null && logInUserText.Text.Length > 0) && (loginPassText.Text != null && loginPassText.Text.Length > 0)) { LogInService log = new LogInService(); int result = log.LoginValidation(logInUserText.Text, loginPassText.Text); if (result == 1) { MessageBox.Show("Welcome " + logInUserText.Text); CurrentLog = logInUserText.Text; Form5 f5 = new Form5(); this.Hide(); f5.Show(); } else { MessageBox.Show("Invalid User."); } } else { MessageBox.Show("Please Fill all field."); } }