Beispiel #1
0
        public TeamUser GetTeamUserByLoginID(string loginID)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamUserRepository teamUserRepository = _DataRepositoryFactory.GetDataRepository <ITeamUserRepository>();

                TeamUser teamUsers = teamUserRepository.Get().Where(c => c.LoginID == loginID).FirstOrDefault();

                return teamUsers;
            }));
        }
Beispiel #2
0
        public TeamUser[] GetAllTeamUsers()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamUserRepository teamUserRepository = _DataRepositoryFactory.GetDataRepository <ITeamUserRepository>();

                IEnumerable <TeamUser> teamUsers = teamUserRepository.Get().ToArray();

                return teamUsers.ToArray();
            }));
        }
Beispiel #3
0
        public TeamUser GetTeamUser(int teamUserId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ITeamUserRepository teamUserRepository = _DataRepositoryFactory.GetDataRepository <ITeamUserRepository>();

                TeamUser teamUserEntity = teamUserRepository.Get(teamUserId);
                if (teamUserEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("TeamUser with ID of {0} is not in database", teamUserId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return teamUserEntity;
            }));
        }