public async Task GenerateSeating(Guid contestId, Auditorium[] auditoriums)
        {
            var participants = await contestManager.GetParticipants(contestId);

            var readOnlyList = seatingGenerator.Generate(participants, auditoriums);

            foreach (var participant in readOnlyList)
            {
                await participantsRepo.UpdateAsync(participant);
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult> GetParticipants(Guid id, bool onlyNotVerified)
        {
            var participants = await contestManager.GetParticipants(id);

            if (onlyNotVerified)
            {
                return(Json(participants.Where(p => !p.Verified).ToArray()));
            }

            var contest = await contestsRepo.GetByIdAsync(id);

            return(Json(participants.Where(p => !contest.Options.HasFlag(ContestOptions.FilterVerified) || p.Verified).ToArray()));
        }
        public async Task <ActionResult> CreateResultsTable(
            Guid id,
            [FromBody] Dictionary <Class, string> tasksDescriptions)
        {
            await contestAdminManager.AddResultsDescription(id, tasksDescriptions);

            var contest = await contestsRepo.GetByIdAsync(id);

            var tableId = await sheetsApiClient.CreateTable(contest.Title);

            contest.ResultsTableLink = tableId;
            await contestsRepo.UpdateAsync(contest);

            var participants = await contestManager.GetParticipants(id);

            await sheetsApiClient.FillParticipantsData(tableId, participants, contest.TasksDescription);

            return(Json(tableId));
        }