public void Post(AISTrackRequest aisTrackRequest)
        {
            using (AISTrackRepository aisTrackRepo = new AISTrackRepository())
            {
                AISTrack model = aisTrackRequest.Adapt <AISTrack>();
                //aisTrackRepo.Insert<AISTrack>(model);
                //_hubContext.Clients.All.PushAISTrackNew(model);

                Ship shipModel = GetShipDetails(Convert.ToString(aisTrackRequest.TRACK_NUMBER), Convert.ToString(aisTrackRequest.IMO));
                if (shipModel != null && shipModel.ShipId != 0)
                {
                    aisTrackRequest.IsLloydInfoPresent = true;
                    aisTrackRequest.LloydInfo          = shipModel;
                }
                else
                {
                    aisTrackRequest.IsLloydInfoPresent = false;
                }
            }

            //Console.WriteLine(aisTrackRequest.IMO);
            //TrackHub trackHub = new TrackHub();
            //_ = trackHub.Send(aisTrackRequest.MMSI, aisTrackRequest.LAT, aisTrackRequest.LON, aisTrackRequest.SPEED, aisTrackRequest.HEADING, aisTrackRequest.COURSE, aisTrackRequest.STATUS, aisTrackRequest.ROT, aisTrackRequest.FLAG);
            _hubContext.Clients.All.PushAISTrack(aisTrackRequest); //aisTrackRequest.TRACK_TYPE, aisTrackRequest.TRACK_SOURCE);
        }
Beispiel #2
0
 public void Post(AISTrackRequest aisTrackRequest)
 {
     using (AISTrackRepository aisTrackRepo = new AISTrackRepository())
     {
         AISTrack model = aisTrackRequest.Adapt <AISTrack>();
         //aisTrackRepo.Insert<AISTrack>(model);
         //_hubContext.Clients.All.PushAISTrackNew(model);
     }
     //Console.WriteLine(aisTrackRequest.IMO);
     //TrackHub trackHub = new TrackHub();
     //_ = trackHub.Send(aisTrackRequest.MMSI, aisTrackRequest.LAT, aisTrackRequest.LON, aisTrackRequest.SPEED, aisTrackRequest.HEADING, aisTrackRequest.COURSE, aisTrackRequest.STATUS, aisTrackRequest.ROT, aisTrackRequest.FLAG);
     _hubContext.Clients.All.PushAISTrack(aisTrackRequest); //aisTrackRequest.TRACK_TYPE, aisTrackRequest.TRACK_SOURCE);
 }
 public void Put(int mmsi, AISTrackRequest aisTrackRequest)
 {
     try
     {
         using (AISTrackRepository aisTrackRepo = new AISTrackRepository())
         {
             AISTrack model = aisTrackRequest.Adapt <AISTrack>();
             //aisTrackRepo.Insert<AISTrack>(model);
             _hubContext.Clients.All.PushAISTrackUpdate(aisTrackRequest);
         }
     }
     catch (Exception ex)
     {
     }
 }