Ejemplo n.º 1
0
 public static ActiveAndHistoryBorrows GetActiveAndHistoryBorrows(string PersonId)
 {
     return(new ActiveAndHistoryBorrows()
     {
         Active = BorrowService.GetActiveBorrowedBooks(PersonId),
         History = BorrowService.GetHistoryBorrowedBooks(PersonId)
     });
 }
Ejemplo n.º 2
0
        private static BorrowerWithBorrows mapBorrowerWithBorrows(borrower b)
        {
            BorrowerWithBorrows borrowerwithborrows = new BorrowerWithBorrows();

            borrowerwithborrows.BorrowerWithUser = new BorrowerWithUser();

            borrowerwithborrows.BorrowerWithUser.Borrower = b;
            borrowerwithborrows.Borrows               = new ActiveAndHistoryBorrows();
            borrowerwithborrows.Borrows.Active        = BorrowService.GetActiveBorrowedBooks(b.PersonId);
            borrowerwithborrows.Borrows.History       = BorrowService.GetHistoryBorrowedBooks(b.PersonId);
            borrowerwithborrows.Categories            = CategoryService.GetCategories();
            borrowerwithborrows.BorrowerWithUser.User = UserRepository.GetUserByPersonId(b.PersonId);

            if (borrowerwithborrows.BorrowerWithUser.User == null)
            {
                borrowerwithborrows.BorrowerWithUser.User = new user();
            }

            borrowerwithborrows.Roles = RoleRepository.GetRoles();
            return(borrowerwithborrows);
        }