public TeamClassification UpdateTeamClassification(TeamClassification teamClassification) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ITeamClassificationRepository teamClassificationRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationRepository>(); TeamClassification updatedEntity = null; if (teamClassification.TeamClassificationId == 0) { updatedEntity = teamClassificationRepository.Add(teamClassification); } else { updatedEntity = teamClassificationRepository.Update(teamClassification); } return updatedEntity; })); }
public void DeleteTeamClassification(int teamClassificationId) { ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ITeamClassificationRepository teamClassificationRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationRepository>(); teamClassificationRepository.Remove(teamClassificationId); }); }
public TeamClassification[] GetAllTeamClassifications() { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ITeamClassificationRepository teamClassificationRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationRepository>(); IEnumerable <TeamClassification> teamClassification = teamClassificationRepository.Get().ToArray(); return teamClassification.ToArray(); })); }
public TeamClassification GetTeamClassification(int teamClassificationId) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ITeamClassificationRepository teamClassificationRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationRepository>(); TeamClassification teamClassificationEntity = teamClassificationRepository.Get(teamClassificationId); if (teamClassificationEntity == null) { NotFoundException ex = new NotFoundException(string.Format("TeamClassification with ID of {0} is not in database", teamClassificationId)); throw new FaultException <NotFoundException>(ex, ex.Message); } return teamClassificationEntity; })); }