Ejemplo n.º 1
0
        public async Task SendNotification(ChiamataInCorsoMarkerCommand chiamata)
        {
            var Competenze = _getCompetenze.GetCompetenzeByCoordinateIntervento(chiamata.AddChiamataInCorso.Localita.Coordinate);

            var SediDaNotificare = _getGerarchiaToSend.Get(Competenze[0]);

            SediDaNotificare.Add(chiamata.AddChiamataInCorso.CodiceSedeOperatore);

            foreach (var sede in SediDaNotificare)
            {
                await _notificationHubContext.Clients.Group(sede).SendAsync("NotifyChiamataInCorsoMarkerAdd", chiamata);
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Add([FromBody] ChiamateInCorso chiamata)
        {
            var command = new ChiamataInCorsoMarkerCommand()
            {
                AddChiamataInCorso = chiamata
            };

            try
            {
                this._Addhandler.Handle(command);
                return(Ok());
            }
            catch
            {
                return(BadRequest());
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Add([FromBody] ChiamateInCorso chiamata)
        {
            var command = new ChiamataInCorsoMarkerCommand()
            {
                AddChiamataInCorso = chiamata
            };

            try
            {
                this._Addhandler.Handle(command);
                return(Ok());
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains(Costanti.UtenteNonAutorizzato))
                {
                    return(StatusCode(403, Costanti.UtenteNonAutorizzato));
                }
                return(BadRequest());
            }
        }
 public async Task SendNotification(ChiamataInCorsoMarkerCommand chiamata)
 {
     await _notificationHubContext.Clients.Group(chiamata.AddChiamataInCorso.codiceSedeOperatore).SendAsync("NotifyChiamataInCorsoMarkerAdd", chiamata);
 }
Ejemplo n.º 5
0
 public async Task SendNotification(ChiamataInCorsoMarkerCommand chiamata)
 {
     await _notificationHubContext.Clients.Client(chiamata.HubConId).SendAsync("NotifyDoppioneChiamataInCorso", Costanti.RichiestaEsistente);
 }