Good evening, I would like you to help me.
I am new to c # and I would like you to help me. I am making a login but when I enter I want to enter another form and close the form that I logged in.
This is the current code:
private void btnIngresar_Click(object sender, EventArgs e)
{
try
{
if (txtUsuario.Text.Trim() == "")
{
MessageBox.Show("Ingrese el Usuario", "Aviso del Sistema");
}
else if (txtpassword.Text.Trim() == "")
{
MessageBox.Show("Ingrese su Password", "Aviso del Sistema");
}
else
{
obj.Alu_Usuario = txtUsuario.Text;
obj.Alu_llave = txtpassword.Text;
obj.Opc = 1;
string resP = Cls_N_Alumno.ConsultarLogin(obj).Rows[0][0].ToString();
if (resP == "1")
{
txtpassword.Text = "";
txtUsuario.Text = "";
MessageBox.Show("Usuario Correctos", "Aviso del Sistema");
FrmMenu frm = new FrmMenu();
frm.Show();
this.Close();
}
else
{
MessageBox.Show("Error Login", "Aviso del Sistema");
}
}
}