Example #1
0
        //*********************

        public bool verificar(string correo, string contraseƱa)
        {
            if (conectar() == true)
            {
                string     sql   = "SELECT COUNT(*) FROM usuarios WHERE correo='" + correo + "' AND contrasena = '" + Utilerias.Encriptar(contraseƱa) + "' ";
                SqlCommand com   = new SqlCommand(sql, this.cnn);
                int        count = Convert.ToInt32(com.ExecuteScalar());
                if (count <= 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
        public int olvidoContrasena(string contragen, string correo)
        {
            string sql = "UPDATE usuarios SET contrasena = '" + Utilerias.Encriptar(contragen) + "' WHERE correo = '" + correo + "'  ";

            return(ejecutar(sql));
        }
Example #3
0
 public DataTable usuario3(string id, string contrasena)
 {
     if (conectar() == true)
     {
         SqlCommand     cmd      = new SqlCommand("SELECT id_usuario,correo,contrasena FROM usuarios WHERE id_usuario ='" + id + "' AND  contrasena ='" + Utilerias.Encriptar(contrasena) + "'", this.cnn);
         SqlDataAdapter adt      = new SqlDataAdapter(cmd);
         DataTable      usuarios = new DataTable();
         adt.Fill(usuarios);
         return(usuarios);
     }
     return(null);
 }