public IActionResult InfoFonogramma([FromBody] Fonogramma fonogramma) { try { fonogramma.IdOperatore = Request.Headers["IdUtente"]; var command = new FonogrammaCommand() { Fonogramma = fonogramma }; _addFonogramma.Handle(command); return(Ok()); } catch (System.Exception ex) { if (ex.Message.Contains(Costanti.UtenteNonAutorizzato)) { return(StatusCode(403, new { message = Costanti.UtenteNonAutorizzato })); } if (ex.Message.Contains(Costanti.RuoloUtentePresente)) { return(StatusCode(403, new { message = Costanti.RuoloUtentePresente })); } return(BadRequest(new { message = ex.Message })); } }
public async Task SendNotification(FonogrammaCommand command) { var richiesta = _getRichiestaById.GetById(command.Fonogramma.IdRichiesta); var sintesi = _getSintesiRichiestaAssistenzaByCodice.GetSintesi(richiesta.Codice); command.Chiamata = sintesi; await _notificationHubContext.Clients.All.SendAsync("ModifyAndNotifySuccess", command); }