public Prestamo(int id_prestamo, Libro libro, Bibliotecario bibliotecario, Persona personaPrestatario, DateTime fechaPrestamo, DateTime fechaVencimiento, int activo) { this.id_prestamo = id_prestamo; this.libro = libro; this.bibliotecario = bibliotecario; this.personaPrestatario = personaPrestatario; this.fechaPrestamo = fechaPrestamo; this.fechaVencimiento = fechaVencimiento; this.activo = activo; }
public virtual Libro pedirLibro(Bibliotecario bibliotecario, Libro libro) { Prestamo prestamo = null; bool disponible = false; prestamo = bibliotecario.prestarLibro(libro); if (prestamo != null) { prestamo.personaPrestatario = this; prestamo.fechaVencimiento = DateTime.Today.AddDays(7); } return(libro); }
public Prestamo prestarLibro(Libro libro) { Bibliotecario bibliotecario = this; Prestamo prestamo = new Prestamo(); bool disponible = false; disponible = libro.validarDisponibilidad(); if (disponible) { prestamo.libro = libro; prestamo.bibliotecario = bibliotecario; } else { prestamo = null; } return(prestamo); }