Exemple #1
0
        public async Task <IActionResult> OpenProposal(string proposalId)
        {
            try
            {
                var proposal = await _telefonicaApi.GetProposalById(proposalId);

                _telefonicaApi.SetCurrentProposal(proposal);

                if (proposal.Estado == "Finalizada")
                {
                    return(await OpenProposalFinished(proposal));
                }
                else if (proposal.Estado == "Pendiente")
                {
                    return(await OpenProposalToEdit(proposal));
                }
                return(View());
            }
            catch (Exception ex)
            {
                var extraData = new { step = "ex", from = "UI" };
                var log       = new Log()
                {
                    Reference = "OpenProposal",
                    Messsage  = ex.Message,
                    ExtraData = extraData
                };

                await _telefonicaApi.InsertLog(log);

                ViewBag.ErrorMessage = "Error al abrir propuesta";
                return(View());
            }
        }