Esempio n. 1
0
        public TeamClassificationType UpdateTeamClassificationType(TeamClassificationType teamClassificationType)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamClassificationTypeRepository teamClassificationTypeRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationTypeRepository>();

                TeamClassificationType updatedEntity = null;

                if (teamClassificationType.TeamClassificationTypeId == 0)
                {
                    updatedEntity = teamClassificationTypeRepository.Add(teamClassificationType);
                }
                else
                {
                    updatedEntity = teamClassificationTypeRepository.Update(teamClassificationType);
                }

                return updatedEntity;
            }));
        }
Esempio n. 2
0
        public void DeleteTeamClassificationType(int teamClassificationTypeId)
        {
            ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamClassificationTypeRepository teamClassificationTypeRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationTypeRepository>();

                teamClassificationTypeRepository.Remove(teamClassificationTypeId);
            });
        }
Esempio n. 3
0
        public TeamClassificationType[] GetAllTeamClassificationTypes()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamClassificationTypeRepository teamClassificationTypeRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationTypeRepository>();

                IEnumerable <TeamClassificationType> teamClassificationType = teamClassificationTypeRepository.Get().ToArray();

                return teamClassificationType.ToArray();
            }));
        }
Esempio n. 4
0
        public TeamClassificationType GetTeamClassificationType(int teamClassificationTypeId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamClassificationTypeRepository teamClassificationTypeRepository = _DataRepositoryFactory.GetDataRepository <ITeamClassificationTypeRepository>();

                TeamClassificationType teamClassificationTypeEntity = teamClassificationTypeRepository.Get(teamClassificationTypeId);
                if (teamClassificationTypeEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("TeamClassificationType with ID of {0} is not in database", teamClassificationTypeId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return teamClassificationTypeEntity;
            }));
        }