예제 #1
0
 public void SaveLocation(LocationData data)
 {
     throw new NotImplementedException();
 }
예제 #2
0
 public void SaveLocation(LocationData data)
 {
     s_log.Info($"Saving Location Data: {data}");
     m_session.Save(data);
     m_session.Flush();
 }
        public void ReportLocation(string identifier, string dateTimeStringFormat, string latitudeString, string longitudeString, string accuracyString)
        {
            DateTime dateTime;
            double latitude;
            double longitude;
            double accuracy;
            bool isValidParse;

            isValidParse = (DateTime.TryParseExact(dateTimeStringFormat,
                           DATE_TIME_FORMAT,
                           System.Globalization.CultureInfo.InvariantCulture,
                           System.Globalization.DateTimeStyles.None,
                           out dateTime));
            if (!isValidParse)
                return;

            isValidParse = Double.TryParse(latitudeString, out latitude);
            if (!isValidParse)
                return;

            isValidParse = Double.TryParse(longitudeString, out longitude);
            if (!isValidParse)
                return;

            isValidParse = Double.TryParse(accuracyString, out accuracy);
            if (!isValidParse)
                return;

            LocationData data = new LocationData() { Identifier = identifier,  Time = dateTime,
                                                    Latitude = latitude,  Longitude = longitude, Accuracy = accuracy };
            m_dbService.SaveLocation(data);
        }