/// <summary> /// Updates a payment in the system /// </summary> /// <param name="financialInstitution">Financial Institution</param> /// <param name="paymentToUpdate">Payment to update.</param> public void UpdatePayment(string financialInstitution, Payment paymentToUpdate) { try { IPaymentDAO paymentDAO = _daoFactory.GetPaymentDAO (); paymentDAO.MakePersistent (paymentToUpdate); } /* If the exception was thrown here, just pass it up */ catch (ZiblerBusinessComponentsException ex) { throw; } /* Catch any Data Layer or other exception and throw an unkown exception */ catch (Exception ex) { ZiblerBusinessComponentsUnknownException exc = new ZiblerBusinessComponentsUnknownException (ex); /* Throw the new exception */ throw exc; } }
public virtual void RemovePayment(Payment payment) { Payments.Remove (payment); }
/// <summary> /// Creates the new payment. /// </summary> /// <param name="financialInstitution">Financial Institution</param> /// <param name="loanId">The loan id.</param> /// <param name="loanVersion">The loan version.</param> /// <param name="payment">The payment.</param> public void CreateNewPayment(string financialInstitution, int loanId, int loanVersion, Payment payment) { try { //Get the two objects Loan loan = GetLoan (loanId, loanVersion); /* Make sure the loan exists */ if (loan == null) throw new ZiblerBusinessComponentsException (Resources.RecordNotFound); /* Get the confirmation number. Note that this nmber is not guaranteed to be unique. * Repetitions will happen after about 2,000,000 numbers. */ payment.ConfirmationNumber = NumberUtilities.GetDigitAlphaNumericKey (9); /* Add the payment to the loan */ loan.AddPayment (payment); } /* If the exception was thrown here, just pass it up */ catch (ZiblerBusinessComponentsException ex) { throw; } /* Catch any Data Layer or other exception and throw an unkown exception */ catch (Exception ex) { ZiblerBusinessComponentsUnknownException exc = new ZiblerBusinessComponentsUnknownException (ex); /* Throw the new exception */ throw exc; } }
public virtual void AddPayment(Payment payment) { payment.Loan = this; Payments.Add (payment); }