public Rental(Reader reader, BookItem bookItem, DateTime rentalDateStart, DateTime rentalDateEnd) { this.Reader = reader; this.BookItem = bookItem; this.RentalDateStart = rentalDateStart; this.RentalDateEnd = rentalDateEnd; }
public Rental(Reader reader, BookItem bookItem) { this.Reader = reader; this.BookItem = bookItem; this.RentalDateStart = DateTime.Now; this.Guid = Guid.NewGuid(); }
public void UpdateBookItem(Guid guid, BookItem bookItem) { int index = context.bookPurchaseData.FindIndex(bi => bi.Guid == guid); if (index > -1) { context.bookPurchaseData[index] = bookItem; } }
public void Fill(DataContext context) { Author author = new Author("George", "Orwell"); Book book = new Book("1984", new List <Author> { author }, "1984-11-123", "Opis książki"); BookItem bookItem = new BookItem(book, DateTime.Today); Reader reader = new Reader("Jan", "Kowal"); Rental rental = new Rental(reader, bookItem); context.bookPurchaseData.Add(bookItem); context.booksData.Add(book.IsbnNumber, book); context.personalInfoData.Add(reader); context.personalInfoData.Add(author); context.rentalData.Add(rental); }
public void AddBookItem(BookItem bookItem) { context.bookPurchaseData.Add(bookItem); }
public void DeleteBookItem(BookItem bookItem) { context.bookPurchaseData.Remove(bookItem); }