public static Framework.Data.Waypoint Waypoint(Framework.Interfaces.ICore core, LiveV6.AdditionalWaypoint wp) { Framework.Data.Waypoint result = null; if (wp != null) { Framework.Data.Waypoint tmp = DataAccess.GetWaypoint(core.Waypoints, wp.Code); result = new Framework.Data.Waypoint(); if (tmp != null) { result.UpdateFrom(tmp); } result.Code = wp.Code; result.DataFromDate = DateTime.Now; result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, wp.WptTypeID); result.Comment = wp.Comment; result.Description = wp.Description; result.GeocacheCode = wp.GeocacheCode; result.ID = wp.Code; result.Lat = wp.Latitude; result.Lon = wp.Longitude; result.Name = wp.Name; result.Time = wp.UTCEnteredDate; result.Url = wp.Url; result.UrlName = wp.UrlName; } return(result); }
public static bool UpdateWaypointData(Framework.Data.Waypoint wp, Framework.Data.Waypoint newData) { bool result = false; if (wp.Code == newData.Code) { wp.UpdateFrom(newData); result = true; } return(result); }
public static Framework.Data.Waypoint Waypoint(Framework.Interfaces.ICore core, OKAPIService.Waypoint wp) { Framework.Data.Waypoint result = null; if (wp != null) { Framework.Data.Waypoint tmp = DataAccess.GetWaypoint(core.Waypoints, wp.name); result = new Framework.Data.Waypoint(); if (tmp != null) { result.UpdateFrom(tmp); } result.Code = wp.name; result.DataFromDate = DateTime.Now; //for now map: parking, path, stage, physical-stage, virtual-stage, final, poi, other if (wp.sym == "parking") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 217); } else if (wp.sym == "path") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } else if (wp.sym == "stage" || wp.sym == "physical-stage" || wp.sym == "virtual-stage") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 219); } else if (wp.sym == "final") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 220); } else if (wp.sym == "poi") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } else { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } result.Comment = wp.description; result.Description = wp.description; result.GeocacheCode = wp.cache_code; result.ID = wp.name; result.Lat = Utils.Conversion.StringToDouble(wp.location.Substring(0, wp.location.IndexOf('|'))); result.Lon = Utils.Conversion.StringToDouble(wp.location.Substring(wp.location.IndexOf('|') + 1)); result.Name = wp.type_name; result.Time = DateTime.Now; result.Url = ""; result.UrlName = wp.type_name; } return(result); }
public static Framework.Data.Waypoint Waypoint(Framework.Interfaces.ICore core, OKAPIService.Waypoint wp) { Framework.Data.Waypoint result = null; if (wp != null) { Framework.Data.Waypoint tmp = DataAccess.GetWaypoint(core.Waypoints, wp.name); result = new Framework.Data.Waypoint(); if (tmp != null) { result.UpdateFrom(tmp); } result.Code = wp.name; result.DataFromDate = DateTime.Now; //for now map: parking, path, stage, physical-stage, virtual-stage, final, poi, other if (wp.sym == "parking") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 217); } else if (wp.sym == "path") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } else if (wp.sym == "stage" || wp.sym == "physical-stage" || wp.sym == "virtual-stage") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 219); } else if (wp.sym == "final") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 220); } else if (wp.sym == "poi") { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } else { result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, 452); } result.Comment = wp.description; result.Description = wp.description; result.GeocacheCode = wp.cache_code; result.ID = wp.name; result.Lat = Utils.Conversion.StringToDouble(wp.location.Substring(0, wp.location.IndexOf('|'))); result.Lon = Utils.Conversion.StringToDouble(wp.location.Substring(wp.location.IndexOf('|') + 1)); result.Name = wp.type_name; result.Time = DateTime.Now; result.Url = ""; result.UrlName = wp.type_name; } return result; }
public static Framework.Data.Waypoint Waypoint(Framework.Interfaces.ICore core, LiveV6.AdditionalWaypoint wp) { Framework.Data.Waypoint result = null; if (wp != null) { Framework.Data.Waypoint tmp = DataAccess.GetWaypoint(core.Waypoints, wp.Code); result = new Framework.Data.Waypoint(); if (tmp != null) { result.UpdateFrom(tmp); } result.Code = wp.Code; result.DataFromDate = DateTime.Now; result.WPType = DataAccess.GetWaypointType(core.WaypointTypes, wp.WptTypeID); result.Comment = wp.Comment; result.Description = wp.Description; result.GeocacheCode = wp.GeocacheCode; result.ID = wp.Code; result.Lat = wp.Latitude; result.Lon = wp.Longitude; result.Name = wp.Name; result.Time = wp.UTCEnteredDate; result.Url = wp.Url; result.UrlName = wp.UrlName; } return result; }