Beispiel #1
0
 public void CommitPendingLoans(IMember borrower)
 {
     if (borrower == null ) {
         throw new ArgumentException(
             String.Format("LoanMapDAO : commitPendingLoans : borrower cannot be null."));
     }
     if (!pendDict.ContainsKey(borrower)) {
         throw new ApplicationException("LoanDAO : commitPendingLoans : no pending list for member found");
     }
     List<ILoan> pendingList = pendDict[borrower];
     foreach (ILoan loan in pendingList) {
         borrower.AddLoan(loan);
         IBook book = loan.Book;
         book.Borrow(loan);
         loan.Commit();
         int id = loan.ID;
         loanDict.Add(id, loan);
     }
     pendDict.Remove(borrower);
 }