/// <summary> /// Creates a new compliance checklist into the system for the given financial institution /// </summary> /// <param name="financialInstitutionName">Financial Institution</param> /// <param name="username">Username</param> /// <param name="complianceChecklist">New Compliance checklist</param> public void CreateNewComplianceChecklist(string financialInstitutionName, string username, ComplianceChecklist complianceChecklist) { try { IFinancialInstitutionDAO financialInstitutionDAO = _daoFactory.GetFinancialInstitutionDAO (); //TODO: This may cause performance issues if they have a lot of compliance checklist items // the Add operation retrieves all the items from the database. //Get the financial institution, and add the new compliance checklist FinancialInstitution financialInstitution = financialInstitutionDAO.GetFinancialInstitutionByName ( financialInstitutionName); financialInstitution.AddComplianceChecklist (complianceChecklist); } /* 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; } }
/// <summary> /// Removes a Compliance Checklist to the list from Compliance Checklists /// in this Financial Institution /// </summary> /// <param name="complianceChecklist">Compliance Checklist to be removed</param> public virtual void RemoveComplianceChecklist(ComplianceChecklist complianceChecklist) { ComplianceChecklists.Remove (complianceChecklist); }
/// <summary> /// Adds a new Compliance Checklist to the list of Compliance Checklists /// in this Financial Institution /// </summary> /// <param name="complianceChecklist">Compliance Checklist to be added</param> public virtual void AddComplianceChecklist(ComplianceChecklist complianceChecklist) { complianceChecklist.FinancialInstitution = this; ComplianceChecklists.Add (complianceChecklist); }
/// <summary> /// Updates a compliance checklist into the system /// </summary> /// <param name="complianceChecklistToUpdate">Compliance checklist to update</param> /// <exception cref="ZiblerBusinessComponentsException" /> public void UpdateComplianceChecklist(ComplianceChecklist complianceChecklistToUpdate) { try { IComplianceChecklistDAO complianceChecklistDAO = _daoFactory.GetComplianceChecklistDAO (); //There is no checks, simply update in the database. complianceChecklistDAO.MakePersistent (complianceChecklistToUpdate); } /* 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; } }