public async Task <IHttpActionResult> ModificaStatoEmendamento(ModificaStatoModel model) { try { return(Ok(await _logicEm.ModificaStatoEmendamento(model))); } catch (Exception e) { Log.Error("ModificaStatoEmendamento", e); return(ErrorHandler(e)); } }
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)); } }
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)); } }
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; } }