protected void btnLogin_Click(object sender, EventArgs e)
    {
        string usuario    = txtUsuario.Text;
        string contraseña = txtContraseña.Text;

        if (usuario.Length > 0 && contraseña.Length > 0)
        {
            string sql = "exec sp_login 1, '" + usuario + "', '" + contraseña + "'";
            obj.conexion("TussanBD", "administrador", "123", "NAMELESSBLISS");

            if (obj.login(sql) == 1)
            {
                Response.Redirect("resumen.aspx");
            }
            else
            {
                Response.Redirect("default.aspx");
            }
        }
    }
Example #2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string usuario    = txtUsuario.Text;
            string contraseña = txtContraseña.Text;

            if (usuario.Length > 0 && contraseña.Length > 0)
            {
                string sql = "exec sp_login 1, '" + usuario + "', '" + contraseña + "'";
                obj.conexion(objConexion);

                if (obj.login(sql) == 1)
                {
                    cEmpleado.closeConexion();
                    empleado        = cEmpleado.obtenerEmpleadoPorCredenciales(objConexion, usuario, contraseña);
                    Global.empleado = empleado;
                    redireccionarSegunCargo();
                }
                else
                {
                    Response.Redirect("default.aspx");
                }
            }
        }