Beispiel #1
0
        private static void SaveDataTable()
        {
            try
            {
                using (var db = new OtakEntities())
                {
                    db.GpsDataGenerated.RemoveRange(db.GpsDataGenerated);

                    db.SaveChanges();

                    GpsDataGenerated gpsDataGenerated = null;

                    for (int i = 0; i < LatLngDetailList.Count; i++)
                    {
                        gpsDataGenerated           = new GpsDataGenerated();
                        gpsDataGenerated.Latitude  = LatLngDetailList[i].Lat;
                        gpsDataGenerated.Longitude = LatLngDetailList[i].Lng;
                        gpsDataGenerated.Id        = i + 1;
                        db.GpsDataGenerated.Add(gpsDataGenerated);
                        db.SaveChanges();
                    }
                    Console.WriteLine("Db Save Changes Suuccessfully...");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #2
0
        public static PointLatLon GetPointLatLon(GpsDataGenerated gpsData)
        {
            PointLatLon pointLatLon = new PointLatLon();

            pointLatLon.Latitude  = gpsData.Latitude;
            pointLatLon.Longitude = gpsData.Longitude;
            return(pointLatLon);
        }