Beispiel #1
0
        public static void Save(LocationMessageAlert locationMessageAlert)
        {
            var db = new GPSTrackerEntities1();

            db.LocationMessageAlerts.AddObject(locationMessageAlert);
            db.SaveChanges();
        }
Beispiel #2
0
        public void DataMigration()
        {
            var maxId           = LocationMessageAlertsManager.GetMaxLocationMessageId();
            var locationMessage = LocationMessageManager.GetByMaxLocMessageId(Convert.ToInt32(maxId));

            foreach (var msg in locationMessage)
            {
                var alert = new LocationMessageAlert();

                alert.LocationMessageId = msg.Id;
                alert.TrackerId         = msg.TrackerId;
                alert.Lat  = msg.LatSeconds;
                alert.Lang = msg.LngSeconds;
                alert.Alt  = msg.Altitude;
                alert.LocationMessageId = msg.Id;
                alert.IsProcessed       = false;

                LocationMessageAlertsManager.Save(alert);
            }
        }