示例#1
0
        public BrainstormingTeam CreateBrainstormingTeam(BrainstormingTeam brainstormingTeam)
        {
            try
            {
                _logger.Info("Creating brainstorming team..");

                var res = _clientService.PostCall(_teamMapper.Map <BrainstormingTeamDto>(brainstormingTeam), $"{_teamConfig.TeamEndpoint}/{_teamConfig.CreateEndpoint}");

                if (res.IsSuccessStatusCode)
                {
                    _logger.Info($"Created brainstorming team. Content: {res.Content}");
                    var parsedResponseMessage = res.Content.ReadAsAsync <RestResponseMessage>().Result;
                    brainstormingTeam.Id = parsedResponseMessage.Text;
                    return(brainstormingTeam);
                }
                else
                {
                    _logger.Error($"Couldn't parse the response id of the team {brainstormingTeam.Name}. API returned: '{res.ReasonPhrase}'");
                }
            }
            catch (RestEndpointException ex)
            {
                _logger.Error($"Failed to create brainstorming finding: {ex.Message}", ex);
            }
            catch (Exception ex)
            {
                _logger.Error($"Failed to create brainstorming finding: {ex.Message}", ex);
            }
            return(brainstormingTeam);
        }
示例#2
0
        public BrainstormingTeam AddTeam(BrainstormingTeam newTeam)
        {
            var team = _teamDalService.CreateBrainstormingTeam(newTeam);

            if (string.IsNullOrEmpty(team.Id))
            {
                _logger.Error("Team id from backend was null.");
            }
            return(team);
        }
示例#3
0
        private void AddTeam()
        {
            if (!CheckInput())
            {
                _logger.Error($"Invalid input to create team");
                return;
            }
            var newTeam = new BrainstormingTeam()
            {
                Name             = TeamName,
                NrOfParticipants = _teamSize,
                Purpose          = Purpose,
                Moderator        = new Moderator(_context.CurrentParticipant)
            };
            var newTeamWithId = _teamService.AddTeam(newTeam);

            if (string.IsNullOrEmpty(newTeamWithId.Id))
            {
                _logger.Error("There was an error creating the new brainstorming team.. No Id returned");
            }
            _context.CurrentBrainstormingTeam = newTeamWithId;
            _navigationService.NavigateToInviteTeam();
        }
示例#4
0
 private void LeaveTeam(BrainstormingTeam team)
 {
     _logger.Info("Leaving team...");
 }