Ejemplo n.º 1
0
 private void Ingresar()
 {
     try
     {
         if (!Validar())
         {
             return;
         }
         clsLogin objLog = new clsLogin(strNombreApp);
         objLog.Usuario = this.txtUsuario.Text.Trim();
         objLog.Clave   = this.txtClave.Text.Trim();
         if (!objLog.Logueo())
         {
             objLog = null;
             return;
         }
         if (objLog.Respuesta == 0)
         {
             if (!objLog.ConsultarROl())
             {
                 objLog = null;
                 return;
             }
             strRolUsuario = objLog.Rol;
             if (strRolUsuario == "A")
             {
                 Response.Redirect("frmBienvenida.aspx");
             }
             else
             {
                 Response.Redirect("frmBienvenidaU.aspx");
             }
         }
         else
         {
             this.lblMensaje.Text   = "Sus credenciales de acceso no son válidas. Verifíque nuevamente";
             this.pnlAlerta.Visible = true;
         }
         objLog = null;
     }
     catch (Exception ex)
     {
         this.lblMensaje.Text   = ex.Message;
         this.pnlAlerta.Visible = true;
         return;
     }
 }