/// <summary>
        /// Will make quick location record in location table, from a given xy position
        /// </summary>
        /// <param name="inLocation"></param>
        /// <returns>Location ID</returns>
        public string QuickLocation(FieldLocation inLocation)
        {
            //Set location
            if (inLocation != null)
            {
                //SetCurrentLocationInUI(inLocation);
                Location.LocationElevMethod        = inLocation.LocationElevMethod;
                Location.LocationEntryType         = inLocation.LocationEntryType;
                Location.LocationErrorMeasure      = inLocation.LocationErrorMeasure;
                Location.LocationErrorMeasureType  = inLocation.LocationErrorMeasureType;
                Location.LocationElevationAccuracy = inLocation.LocationElevationAccuracy;
                Location.LocationPDOP  = inLocation.LocationPDOP;
                Location.LocationLat   = inLocation.LocationLat;
                Location.LocationLong  = inLocation.LocationLong;
                Location.LocationElev  = inLocation.LocationElev;
                Location.LocationDatum = Dictionaries.DatabaseLiterals.KeywordEPSGDefault;
            }
            else
            {
                //Init location
                Location.LocationLat  = _latitude;
                Location.LocationLong = _longitude;
                Location.LocationElev = _elevation;
            }

            Location.LocationID    = _locationid = idCalculator.CalculateLocationID();                                       //Calculate new value
            Location.LocationAlias = _locationAlias = idCalculator.CalculateLocationAlias(_alias);                           //Calculate new value
            Location.MetaID        = localSetting.GetSettingValue(Dictionaries.DatabaseLiterals.FieldUserInfoID).ToString(); //Foreign key


            accessData.SaveFromSQLTableObject(Location, false);

            return(Location.LocationID);
        }
Exemplo n.º 2
0
        public LocationViewModel(FieldNotes inReport)
        {
            //On init for new stations calculate values so UI shows stuff.
            _locationID    = idCalculator.CalculateLocationID();
            _locationAlias = idCalculator.CalculateLocationAlias();

            FillDatum();
        }