public void Add(LocationMessage locationMessage)
        {
            try
            {
                Location location = new Location();
                location.CoordinateTypeID = locationMessage.CoordinateType.GetHashCode();
                location.DeviceID = locationMessage.DeviceID;
                location.Direction = locationMessage.Direction;
                location.EngineTemperature = locationMessage.EngineTemperature;
                location.GpsSpeed = locationMessage.GpsSpeed;
                location.GpsTime = locationMessage.GpsTime;
                location.GpsLatitude = locationMessage.Latitude;
                location.GpsLongitude = locationMessage.Longitude;
                location.ObdSpeed = locationMessage.ObdSpeed;
                location.SatelliteNum = locationMessage.SatelliteNum;

                BaiduCoordinate baiduCoord = ConvertCoordinate(new GpsCoordinate { Latitude = locationMessage.Latitude, Longitude = locationMessage.Longitude });
                location.BaiduLatitude = baiduCoord.Latitude;
                location.BaiduLongitude = baiduCoord.Longitude;

                dataContext.Location.InsertOnSubmit(location);
                dataContext.SubmitChanges();

            }
            catch (Exception ex)
            {
                log.Error("Exception", ex);
            }
        }
Esempio n. 2
0
		private void detach_Location(Location entity)
		{
			this.SendPropertyChanging();
			entity.DeviceInfo = null;
		}
Esempio n. 3
0
 partial void DeleteLocation(Location instance);
Esempio n. 4
0
 partial void UpdateLocation(Location instance);
Esempio n. 5
0
		private void detach_Location(Location entity)
		{
			this.SendPropertyChanging();
			entity.CoordinateType = null;
		}
Esempio n. 6
0
 partial void InsertLocation(Location instance);