Пример #1
0
        private Historial Mapear(OracleDataReader dataReader)
        {
            if (!dataReader.HasRows)
            {
                return(null);
            }
            Historial horas = new Historial()
            {
                Usuario     = dataReader.GetString(0),
                Fecha       = dataReader.GetString(1),
                Descripcion = dataReader.GetString(2),
            };

            return(horas);
        }
Пример #2
0
        public List <Historial> Consultar()
        {
            OracleDataReader dataReader;

            using (var command = _connetion.CreateCommand())
            {
                command.CommandText = "SELECT usuario, fecha, accion FROM control ORDER BY fecha desc";
                dataReader          = command.ExecuteReader();
                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        Historial historial = Mapear(dataReader);
                        historiales.Add(historial);
                    }
                }
            }
            return(historiales);
        }