Пример #1
0
        public Apoderado BuscarApoderado(string nombre)
        {
            Apoderado apod = null;

            try
            {
                OracleConnection connection = Conexion.Conexion.GetConnection();

                connection.Open();
                OracleCommand comando = new OracleCommand("select  email,celular,s_apellido,p_apellido,nombre,rut from Apoderado Where nombre||' '||p_apellido||' '||s_apellido||''||rut=:NOMBRE ", connection);

                comando.Parameters.Add(":NOMBRE", nombre);

                OracleDataReader lector = comando.ExecuteReader();

                while (lector.Read())
                {
                    apod = new Apoderado(lector.GetString(0), lector.GetInt32(1), lector.GetString(2), lector.GetString(3), lector.GetString(4), lector.GetString(5));
                }

                return(apod);
            }
            catch
            {
                return(apod);
            }
        }
Пример #2
0
        public Apoderado inicioSesion(string email, string password)
        {
            Apoderado apod = null;

            try
            {
                OracleConnection connection = Conexion.Conexion.GetConnection();

                connection.Open();
                OracleCommand comando = new OracleCommand("select nombre||' '||p_apellido||' '||s_apellido as nombre, rut, dv_rut from Apoderado Where email=:EMAIL and CONTRASENA=:CONTRASENA", connection);

                comando.Parameters.Add(":EMAIL", email);
                comando.Parameters.Add(":CONTRASENA", password);

                OracleDataReader lector = comando.ExecuteReader();

                while (lector.Read())
                {
                    apod = new Apoderado(lector.GetString(0), lector.GetString(1), lector.GetString(2));
                }

                return(apod);
            }
            catch
            {
                return(apod);
            }
        }