Exemple #1
0
        public Prestamo Obtener(string isbn)
        {
            Prestamo        prestamo        = null;
            PrestamoEntidad prestamoEntidad = ObtenerPrestamoEntidadPorIsbn(isbn);

            if (prestamoEntidad != null)
            {
                prestamo = new Prestamo(
                    prestamoEntidad.FechaSolicitud,
                    LibroBuilder.ConvertirADominio(prestamoEntidad.LibroEntidad),
                    prestamoEntidad.FechaEntregaMaxima, prestamoEntidad.NombreUsuario
                    );
            }
            return(prestamo);
        }
Exemple #2
0
 public void Agregar(Libro libro)
 {
     bibliotecaContexto.Libros.Add(LibroBuilder.ConvertirAEntidad(libro));
     bibliotecaContexto.SaveChanges();
 }
Exemple #3
0
        public Libro ObtenerPorIsbn(string isbn)
        {
            LibroEntidad libroEntidad = ObtenerLibroEntidadPorIsbn(isbn);

            return(LibroBuilder.ConvertirADominio(libroEntidad));
        }
        public Libro ObtenerLibroPrestadoPorIsbn(string isbn)
        {
            PrestamoEntidad prestamoEntidad = ObtenerPrestamoEntidadPorIsbn(isbn);

            return(LibroBuilder.ConvertirADominio(prestamoEntidad != null ? prestamoEntidad.LibroEntidad : null));
        }
Exemple #5
0
        public Prestamo Obtener(string isbn)
        {
            PrestamoEntidad prestamoEntidad = ObtenerPrestamoEntidadPorIsbn(isbn);

            return(new Prestamo(prestamoEntidad.FechaSolicitud, LibroBuilder.ConvertirADominio(prestamoEntidad.LibroEntidad), prestamoEntidad.NombreUsuario));
        }