public virtual void RemoveCollateral(Collateral collateral) { Collaterals.Remove (collateral); }
/// <summary> /// Adds a new Collateral to the Loan Request /// </summary> /// <param name="loanRequest">loanRequest</param> /// <param name="collateral">collateral</param> public void CreateNewLoanRequestCollateral(LoanRequest loanRequest, Collateral collateral) { try { //If the loan request is not editable, then don't give them the option //to delete any data from it. if (loanRequest.LoanRequestStatus != LoanRequestStatus.Condicionada && loanRequest.LoanRequestStatus != LoanRequestStatus.Capturada && loanRequest.LoanRequestStatus != LoanRequestStatus.ExpedienteIntegrado) { throw new ZiblerBusinessComponentsException ( Resources.LoanRequestOperationsMsgCannotAddCollateral); } //Add the collateral if no exceptions were thrown loanRequest.AddCollateral (collateral); } /* 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 AddCollateral(Collateral collateral) { collateral.LoanRequest = this; Collaterals.Add (collateral); }