コード例 #1
0
 public async Task <IHttpActionResult> ModificaStatoEmendamento(ModificaStatoModel model)
 {
     try
     {
         return(Ok(await _logicEm.ModificaStatoEmendamento(model)));
     }
     catch (Exception e)
     {
         Log.Error("ModificaStatoEmendamento", e);
         return(ErrorHandler(e));
     }
 }
コード例 #2
0
        public async Task <ActionResult> ModificaStatoEmendamento(ModificaStatoModel model)
        {
            try
            {
                var apiGateway = new ApiGateway(_Token);
                await apiGateway.Emendamento.CambioStato(model);

                return(Json(Request.UrlReferrer.ToString(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(Json(new ErrorResponse(e.Message), JsonRequestBehavior.AllowGet));
            }
        }
コード例 #3
0
        public async Task <IHttpActionResult> ModificaStatoEmendamento(ModificaStatoModel model)
        {
            try
            {
                var session = await GetSession();

                var persona = await _logicPersone.GetPersona(session._currentUId);

                persona.CurrentRole = session._currentRole;
                return(Ok(await _logicEm.ModificaStatoEmendamento(model, persona)));
            }
            catch (Exception e)
            {
                Log.Error("ModificaStatoEmendamento", e);
                return(ErrorHandler(e));
            }
        }
コード例 #4
0
        public async Task CambioStato(ModificaStatoModel model)
        {
            try
            {
                var requestUrl = $"{apiUrl}/emendamenti/modifica-stato";
                var body       = JsonConvert.SerializeObject(model);

                await Put(requestUrl, body, _token);
            }
            catch (UnauthorizedAccessException ex)
            {
                Log.Error("CambioStato", ex);
                throw ex;
            }
            catch (Exception ex)
            {
                Log.Error("CambioStato", ex);
                throw ex;
            }
        }