Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }