Example #1
0
        public static List <BorrowedBookCopy> MapBorrow(List <borrow> b)
        {
            List <BorrowedBookCopy> borrowedBookCopy = new List <BorrowedBookCopy>();

            foreach (borrow borrow in b)
            {
                copy c = CopyRepository.GetCopyByBarcode(borrow.Barcode);
                borrowedBookCopy.Add(new BorrowedBookCopy()
                {
                    Borrow   = borrow,
                    Authors  = AuthorRepository.GetAuthorsByBookISBN(c.ISBN),
                    Book     = BookRepository.GetBook(c.ISBN),
                    Category = CategoryRepository.GetCategoryById(BorrowerRepository.GetBorrower(borrow.PersonId).CategoryId),
                    Fine     = FineRepository.GetFine(borrow.Barcode, borrow.PersonId)
                });
            }
            return(borrowedBookCopy);
        }
Example #2
0
 public FineLogic()
 {
     repository = new FineRepository(_context);
 }