Exemplo n.º 1
0
        public TeamSetting[] GetAllTeamSettings()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamSettingRepository teamSettingRepository = _DataRepositoryFactory.GetDataRepository <ITeamSettingRepository>();

                IEnumerable <TeamSetting> teamSettings = teamSettingRepository.Get().ToArray();

                return teamSettings.ToArray();
            }));
        }
Exemplo n.º 2
0
        public TeamSetting GetTeamSetting(int teamSettingId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamSettingRepository teamSettingRepository = _DataRepositoryFactory.GetDataRepository <ITeamSettingRepository>();

                TeamSetting teamSettingEntity = teamSettingRepository.Get(teamSettingId);
                if (teamSettingEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("TeamSetting with ID of {0} is not in database", teamSettingId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return teamSettingEntity;
            }));
        }