public static Core.Data.LogImage ImportLogImage(Core.Storage.Database db, LiveV6.ImageData img, string LogId) { Core.Data.LogImage result = null; if (img != null) { result = db.LogImageCollection.GetLogImage(img.Url); Core.Data.ILogImageData lgiData; if (result == null) { lgiData = new Core.Data.LogImageData(); lgiData.ID = img.Url; lgiData.LogId = LogId; lgiData.Url = img.Url; } else { lgiData = result; } lgiData.DataFromDate = DateTime.Now; lgiData.Name = img.Name; if (lgiData is Core.Data.LogImageData) { if (Utils.DataAccess.AddLogImage(db, lgiData as Core.Data.LogImageData)) { result = db.LogImageCollection.GetLogImage(img.Url); } } } return(result); }
public static Framework.Data.GeocacheImage GeocacheImage(Framework.Interfaces.ICore core, LiveV6.ImageData img, string GeocacheCode) { Framework.Data.GeocacheImage result = null; if (img != null) { Framework.Data.GeocacheImage tmp = DataAccess.GetGeocacheImage(core.GeocacheImages, img.ImageGuid.ToString()); result = new Framework.Data.GeocacheImage(); if (tmp != null) { result.UpdateFrom(tmp); } result.ID = img.ImageGuid.ToString(); result.DataFromDate = DateTime.Now; result.GeocacheCode = GeocacheCode; result.Name = img.Name; result.Url = img.Url; result.ThumbUrl = img.ThumbUrl; result.MobileUrl = img.MobileUrl; result.Description = img.Description; } return(result); }
public static Framework.Data.LogImage LogImage(Framework.Interfaces.ICore core, LiveV6.ImageData img, string LogId) { Framework.Data.LogImage result = null; if (img != null) { Framework.Data.LogImage tmp = DataAccess.GetLogImage(core.LogImages, img.Url); result = new Framework.Data.LogImage(); if (tmp != null) { result.UpdateFrom(tmp); } result.ID = img.Url; result.DataFromDate = DateTime.Now; result.LogID = LogId; result.Name = img.Name; result.Url = img.Url; } return(result); }
public static Core.Data.GeocacheImage ImportGeocacheImage(Core.Storage.Database db, LiveV6.ImageData img, string GeocacheCode) { Core.Data.GeocacheImage result = null; if (img != null) { result = db.GeocacheImageCollection.GetGeocacheImage(img.ImageGuid.ToString()); Core.Data.IGeocacheImageData wpd; if (result == null) { wpd = new Core.Data.GeocacheImageData(); wpd.ID = img.ImageGuid.ToString(); } else { wpd = result; } wpd.DataFromDate = DateTime.Now; wpd.GeocacheCode = GeocacheCode; wpd.Name = img.Name; wpd.Url = img.Url; wpd.ThumbUrl = img.ThumbUrl; wpd.MobileUrl = img.MobileUrl; wpd.Description = img.Description; if (wpd is Core.Data.GeocacheImageData) { if (Utils.DataAccess.AddGeocacheImage(db, wpd as Core.Data.GeocacheImageData)) { result = db.GeocacheImageCollection.GetGeocacheImage(img.ImageGuid.ToString()); } } } return(result); }