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 List <Core.Data.LogImage> ImportLogImages(Core.Storage.Database db, LiveV6.ImageData[] imgs, string LogId) { List <Core.Data.LogImage> result = new List <Core.Data.LogImage>(); if (imgs != null) { foreach (var lg in imgs) { Core.Data.LogImage g = ImportLogImage(db, lg, LogId); if (g != null) { result.Add(g); } } } return(result); }