Пример #1
0
        public void CommitLoan(ILoan loan)
        {
            if (loan == null)
                throw new ArgumentException("Error: loan can\'t be null.");

            loan.Commit(_loans.Count);
            _loans.Add(loan);
        }
Пример #2
0
        public void CommitLoan(ILoan loan)
        {
            var newId = this.LoanList.Count == 0 ? 1 : this.LoanList.Max(l => l.ID) + 1;

            loan.Commit(newId);

            this.LoanList.Add(loan);
        }
Пример #3
0
        public void CommitLoan(ILoan loan)
        {
            var newId = this.LoanList.Count == 0 ? 1 : this.LoanList.Max(l => l.ID) + 1;

            loan.Commit(newId);

            this.LoanList.Add(loan);
        }
Пример #4
0
 public void CommitLoan(ILoan loan)
 {
     if (loan == null)
     {
         throw new ArgumentException(
             String.Format("LoanDAO : commitLoans : loan cannot be null."));
     }
     IMember borrower = loan.Borrower;
     borrower.AddLoan(loan);
     IBook book = loan.Book;
     book.Borrow(loan);
     loan.Commit();
     int id = loan.ID;
     loanDict.Add(id, loan);
 }