public Task <long> AvaluateParecer(AvaluateParecerCommand command)
        {
            var requestUrl = CreateRequestUri(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                            $"{ResourceParecer}/AvaluateParecer"));

            return(Post(requestUrl, command));
        }
        public async Task <IActionResult> Evaluate(IFormCollection collection)
        {
            try
            {
                var flagStatus = Convert.ToInt32(collection["rdoAvaliacao"].ToString());


                var command = new AvaluateParecerCommand
                {
                    CodParecer         = int.Parse(collection["CodParecer"].ToString()),
                    DscMotivoDevolucao = collection["DscMotivoParecer"].ToString(),
                    FlgStatusParecer   = flagStatus,
                    DscParecerStatus   = ((EnumStatusParecer)flagStatus).GetDescription() + ", " + DateTime.Now.ToString("dd/MM/yyyy") + ", " + DateTime.Now.ToString("hh:mm"),
                    AlteradoPor        = User.Identity.Name
                };

                var idParecer = await ApiClientFactory.Instance.AvaluateParecer(command);

                return(RedirectToAction(nameof(Evaluate), new { crud = (int)EnumCrud.Created }));
            }
            catch (Exception ex)
            {
                return(RedirectToAction(nameof(Evaluate), new { notify = (int)EnumNotify.Error, message = ex.Message }));
            }
        }
Beispiel #3
0
        public async Task <ActionResult <long> > AvaluateParecer(AvaluateParecerCommand command)
        {
            try
            {
                var result = await Mediator.Send(command);

                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }