예제 #1
0
 public void UpdateBorrowDate(Borrow borrow)
 {
     using var context   = new LibraryContext();
     borrow.DateOfBorrow = DateTime.Now;
     context.SaveChanges();
 }
예제 #2
0
 public void RemoveCustomer(Customer customer)
 {
     using var context = new LibraryContext();
     context.Custumers.Remove(customer);
     context.SaveChanges();
 }
예제 #3
0
 public void RemoveBook(Book book)
 {
     using var context = new LibraryContext();
     context.Books.Remove(book);
     context.SaveChanges();
 }
예제 #4
0
 public void UpdateCondition(Book book, byte newCondition)
 {
     using var context = new LibraryContext();
     book.Condition    = newCondition;
     context.SaveChanges();
 }
예제 #5
0
 public void MoveBook(Book book, int shelfID)
 {
     using var context = new LibraryContext();
     book.ShelfID      = shelfID;
     context.SaveChanges();
 }