Beispiel #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (DateTime.TryParseExact(ReunioesAtasPost.HorarioInicio, "h:mm tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out var horarioInformadoInicio) &&
                DateTime.TryParseExact(ReunioesAtasPost.HorarioFim, "h:mm tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out var horarioInformadoFim))
            {
                ReunioesAtasPost.Inicio  = ReunioesAtasPost.Data.Value.Date + horarioInformadoInicio.TimeOfDay;
                ReunioesAtasPost.Termino = ReunioesAtasPost.Data.Value.Date + horarioInformadoFim.TimeOfDay;
            }
            else
            {
                ReunioesAtasPost.Inicio  = ReunioesAtasPost.Data.Value.Date;
                ReunioesAtasPost.Termino = ReunioesAtasPost.Data.Value.Date;
            }

            var result = await reunioesClient.AtasPostAsync(ReuniaoId, ReunioesAtasPost);

            FeedbackSuccess = $"A ata de reunião <b>{result.Codigo}</b> foi gerada com êxito.";

            return(new JsonResult(
                       new
            {
                returnUrl = Url.Page("/Reunioes/Detalhar", new { id = ReuniaoId })
            }));
        }