Exemplo n.º 1
0
        private List <Locker> ObtenerLocker(String query)
        {
            List <Locker> lista = new List <Locker>();

            datos.leerTabla2(query);
            while (datos.pLector.Read())
            {
                Locker l = new Locker();
                if (!datos.pLector.IsDBNull(0))
                {
                    l.Codigo = datos.pLector.GetInt32(0);
                }
                if (!datos.pLector.IsDBNull(1))
                {
                    l.Nombre = datos.pLector.GetString(1);
                }
                if (!datos.pLector.IsDBNull(2))
                {
                    l.Obra.Codigo = datos.pLector.GetInt32(2);
                }
                if (!datos.pLector.IsDBNull(3))
                {
                    l.Obra.Nombre = datos.pLector.GetString(3);
                }
                if (!datos.pLector.IsDBNull(4))
                {
                    l.Dimension = datos.pLector.GetString(4);
                }
                if (!datos.pLector.IsDBNull(5))
                {
                    l.FechaIngreso = datos.pLector.GetString(5);
                }
                if (!datos.pLector.IsDBNull(6))
                {
                    l.FechaEgreso = datos.pLector.GetString(6);
                }
                lista.Add(l);
            }
            datos.desconectar();
            return(lista);
        }
Exemplo n.º 2
0
        public void OcuparLocker(Locker locker)
        {
            String query = "UPDATE Lockers SET id_obra = " + locker.Obra.Codigo + " WHERE id_locker= " + locker.Codigo;

            datos.actualizarDB(query);
        }