示例#1
0
        public static void RemoveCopyByISBN(string ISBN)
        {
            List <copy> Copies = CopyService.GetCopiesByISBN(ISBN);

            foreach (copy c in Copies)
            {
                RemoveCopy(c.Barcode);
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public static bool HasBorrows(string isbn)
 {
     foreach (copy c in CopyRepository.GetCopiesByISBN(isbn))
     {
         if (CopyService.IsBorrowed(c))
         {
             return(false);
         }
     }
     return(true);
 }
示例#4
0
        public static bool RemoveBook(string isbn)
        {
            if (HasBorrows(isbn) || HasAuthors(isbn))
            {
                return(false);
            }

            CopyService.RemoveCopyByISBN(isbn);
            BookAuthorService.RemoveBookAuthorByISBN(isbn);
            BookRepository.RemoveBook(isbn);

            return(true);
        }