Beispiel #1
0
 public Rental(Reader reader, BookItem bookItem, DateTime rentalDateStart, DateTime rentalDateEnd)
 {
     this.Reader          = reader;
     this.BookItem        = bookItem;
     this.RentalDateStart = rentalDateStart;
     this.RentalDateEnd   = rentalDateEnd;
 }
Beispiel #2
0
 public Rental(Reader reader, BookItem bookItem)
 {
     this.Reader          = reader;
     this.BookItem        = bookItem;
     this.RentalDateStart = DateTime.Now;
     this.Guid            = Guid.NewGuid();
 }
Beispiel #3
0
        public void UpdateBookItem(Guid guid, BookItem bookItem)
        {
            int index = context.bookPurchaseData.FindIndex(bi => bi.Guid == guid);

            if (index > -1)
            {
                context.bookPurchaseData[index] = bookItem;
            }
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public void AddBookItem(BookItem bookItem)
 {
     context.bookPurchaseData.Add(bookItem);
 }
Beispiel #6
0
 public void DeleteBookItem(BookItem bookItem)
 {
     context.bookPurchaseData.Remove(bookItem);
 }