Exemple #1
0
        public void Inserisci(NuovaRichiestaSoccorsoAereo richiesta)
        {
            var APImanager = new HttpRequestManager <ErroreRichiestaSoccorsoAereo>(_client, _memoryCache, _writeLog, _httpContext, _configuration);

            APImanager.Configure();

            var jsonString = JsonConvert.SerializeObject(richiesta);
            var content    = new StringContent(jsonString);

            var result = APImanager.PutAsync(new Uri(Costanti.AFM + "rescueRequest"), content, "*****@*****.**", "DNGFNC98R17D662Q").Result;
        }
Exemple #2
0
        public void Handle(InserisciRichiestaSoccorsoAereoCommand command)
        {
            var richiesta = _getRichiestaById.GetByCodiceRichiesta(command.CodiceRichiesta);

            new RichiestaSoccorsoAereo(richiesta, DateTime.Now, command.IdOperatore);

            var richiestaSoccorsoAereo = new NuovaRichiestaSoccorsoAereo()
            {
                Lat                = (decimal)richiesta.Localita.Coordinate.Latitudine,
                Lng                = (decimal)richiesta.Localita.Coordinate.Longitudine,
                RequestKey         = richiesta.Codice,
                Description        = command.Motivazione,
                Datetime           = DateTime.Now,
                OnSiteContact      = "",
                OperatorFiscalCode = command.RichiestaSoccorsoAereo.OperatorFiscalCode,
                OperatorName       = command.RichiestaSoccorsoAereo.OperatorName,
                OperatorSurname    = command.RichiestaSoccorsoAereo.OperatorSurname,
                RequestTypeCode    = command.RichiestaSoccorsoAereo.RequestTypeCode,
                RescueCategories   = command.RichiestaSoccorsoAereo.RescueCategories,
                Remarks            = ""
            };

            _aggiorna.Aggiorna(richiestaSoccorsoAereo);
        }