public async Task <ActionResult> SalvaRelatoriAtto(AttoRelatoriModel model) { try { var apiGateway = new ApiGateway(_Token); await apiGateway.Atti.SalvaRelatori(model); return(Json("", JsonRequestBehavior.AllowGet)); } catch (Exception e) { Console.WriteLine(e); return(Json(new ErrorResponse(e.Message), JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> SalvaRelatoriAtto(AttoRelatoriModel model) { try { await ApiGateway.SalvaRelatoriAtto(model); return(Json("", JsonRequestBehavior.AllowGet)); } catch (Exception e) { Console.WriteLine(e); return(Json(new ErrorResponse { message = e.Message }, JsonRequestBehavior.AllowGet)); } }
public async Task SalvaRelatori(AttoRelatoriModel model) { try { var requestUrl = $"{apiUrl}/atti/relatori"; var body = JsonConvert.SerializeObject(model); await Post(requestUrl, body, _token); } catch (UnauthorizedAccessException ex) { Log.Error("SalvaRelatoriAtto", ex); throw ex; } catch (Exception ex) { Log.Error("SalvaRelatoriAtto", ex); throw ex; } }
public async Task <IHttpActionResult> SalvaRelatoriAtto(AttoRelatoriModel model) { try { var attoInDb = await _logic.GetAtto(model.Id); if (attoInDb == null) { return(NotFound()); } await _logic.SalvaRelatori(model.Id, model.Persone); return(Ok()); } catch (Exception e) { Log.Error("SalvaRelatoriAtto", e); return(ErrorHandler(e)); } }