private void btn_login_Click(object sender, EventArgs e) { int type = _loginBusiness.getUserType(this.username.Text, this.password.Text); if (type == -1) { //wrong credentials MessageBox.Show("Ai gresit, mai incearca!"); return; } if (type == 1) { Form userForm = new MainUserForm(); this.Hide(); userForm.FormClosed += userForm_FormClosed; userForm.Show(); } else { Form userForm = new MainUserForm(); this.Hide(); userForm.FormClosed += userForm_FormClosed; userForm.Show(); } }