Beispiel #1
0
        public void Notify(AddInterventoCommand command)
        {
            var sintesi = _getSintesiRichiestaByCodice.GetSintesi(command.Chiamata.Codice);

            _sender.SendNotification(command);

            var messaggio  = $"E' stato richiesto un intervento in {sintesi.Localita.Indirizzo}. Codice Intervento: {sintesi.Codice}";
            var infoMatrix = new MessageMatrix()
            {
                Messaggio = messaggio,
                CodSede   = sintesi.CodSOCompetente.Split('.')[0]
            };

            _callMatrix.SendMessage(infoMatrix);
        }
Beispiel #2
0
        public void Notify(ConfermaPartenzeCommand command)
        {
            _sender.SendNotification(command);

            foreach (var partenza in command.ConfermaPartenze.Partenze)
            {
                var messaggio  = $"La squadra {partenza.Squadre[0].Nome} è partita alle ore {DateTime.Now.Hour}:{DateTime.Now.Minute} dalla sede {partenza.Mezzo.Distaccamento.Descrizione} con il mezzo targato {partenza.Mezzo.Codice} per dirigersi a {command.ConfermaPartenze.richiesta.Localita.Indirizzo}. Codice Intervento: {command.ConfermaPartenze.richiesta.CodRichiesta}";
                var infoMatrix = new MessageMatrix()
                {
                    Messaggio = messaggio,
                    CodSede   = command.ConfermaPartenze.CodiceSede.Split('.')[0]
                };
                _callMatrix.SendMessage(infoMatrix);
            }
        }
Beispiel #3
0
        public void SendMessage(MessageMatrix info)
        {
            var CodSedePerMatrix = info.CodSede;

            var GetRoomId = GetChatRoomID(CodSedePerMatrix).Result;

            if (GetRoomId.Error == null)
            {
                var GenerateBOT = PostBotInChatRoom(GetRoomId.room_id).Result;
                if (GenerateBOT.Equals("Bot inviato con successo"))
                {
                    var call = PutMessage(GetRoomId.room_id, info.Messaggio).Result;

                    Log.Information($"MATRIX - " + call);
                    Log.Information($"MATRIX - FINE CHIAMATA PUT ");
                }
            }
        }