public async Task <IActionResult> GetAvaliadores(EEventIdentifier evento)
        {
            var value = await _mediator.Send(new ListAvaliadoresByEventoQuery()
            {
                Event = evento
            });

            return(await ResponseOkAsync(value));
        }
        public async Task <IActionResult> GetArticlesBySituacao(EEventIdentifier evento, [FromQuery] int page)
        {
            var value = await _mediator.Send(new ListArticlesPaginatedByEventQuery()
            {
                Event = evento,
                Page  = page
            });

            return(await ResponseOkAsync(value));
        }
        public async Task <IActionResult> ReportArticlesNote(
            [FromRoute] EEventIdentifier eevent,
            [FromRoute] string modality,
            [FromQuery] EApresentationType?apresentationType)
        {
            var value = await _mediator.Send(new ReportArticlesNoteQuery()
            {
                Modality = modality,
                Event    = eevent,
                Type     = apresentationType
            });

            return(await ResponseOkAsync(value));
        }
        public async Task <IActionResult> ArticlesEvaluate(
            [FromRoute] string evaluatorId,
            [FromRoute] QueryToEvaluateType type,
            [FromRoute] EEventIdentifier eevent)
        {
            var value = await _mediator.Send(new ListArticlesToEvaluateQuery()
            {
                EvaluatorId = evaluatorId,
                Type        = type,
                EEvent      = eevent
            });

            return(await ResponseOkAsync(value));
        }
        public async Task <IActionResult> SortArticles(EEventIdentifier eventId)
        {
            var value = await _mediator.Send(new SortArticleEvaluatorsCommand(eventId));

            if (!value)
            {
                return(await ResponseNotificationsAsync());
            }

            var newList = await _mediator.Send(new ListArticlesPaginatedByEventQuery
            {
                Event = eventId
            });

            return(await ResponseOkAsync(newList));
        }
예제 #6
0
        public async Task <IActionResult> ImportEvaluators(
            IFormFile file,
            EEventIdentifier evvent)
        {
            List <ArticleEvaluatorsImport> items;

            using (StreamReader r = new StreamReader(file.OpenReadStream()))
            {
                string json = r.ReadToEnd();
                items = JsonConvert.DeserializeObject <List <ArticleEvaluatorsImport> >(json);
            }

            var res = await _mediator.Send(new ImportArticlesEvaluatorsCommand()
            {
                Articles = items,
                Event    = evvent
            });

            return(res ? await ResponseOkAsync() : await ResponseNotificationsAsync());
        }
 public SortArticleEvaluatorsCommand(EEventIdentifier @event)
 {
     Event = @event;
 }