public static void RemoveCopyByISBN(string ISBN) { List <copy> Copies = CopyService.GetCopiesByISBN(ISBN); foreach (copy c in Copies) { RemoveCopy(c.Barcode); } }
public static bool StoreBook(book b, int copies, string library) { BookRepository.StoreBook(b); for (int i = 0; i < copies; i++) { CopyService.CreateCopy(b.ISBN, library); } return(true); }
public static bool HasBorrows(string isbn) { foreach (copy c in CopyRepository.GetCopiesByISBN(isbn)) { if (CopyService.IsBorrowed(c)) { return(false); } } return(true); }
public static bool RemoveBook(string isbn) { if (HasBorrows(isbn) || HasAuthors(isbn)) { return(false); } CopyService.RemoveCopyByISBN(isbn); BookAuthorService.RemoveBookAuthorByISBN(isbn); BookRepository.RemoveBook(isbn); return(true); }