public void LoadChemistryByTagItems() { string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()"; try { ChemistryByTagItems.Clear(); var lib = new Database.Library(); List <ChemistryTagDTO> dto = lib.GetChemistryByTags(); foreach (var obj in dto) { var tag = new ChemistryByTag(); tag.ID = obj.Id; tag.GalleryID = obj.GalleryId; tag.tagID = obj.TagId; ChemistryByTagItems.Add(tag); } } catch (Exception ex) { new ReportError(Globals.Chem4WordV3.Telemetry, Globals.Chem4WordV3.WordTopLeft, module, ex).ShowDialog(); } }
public void LoadChemistryByTagItems() { string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()"; try { ChemistryByTagItems.Clear(); SQLiteDataReader allTags = LibraryModel.GetChemistryByTags(); while (allTags.Read()) { var tag = new ChemistryByTag(); tag.ID = (long)allTags["ID"]; tag.GalleryID = (long)allTags["GalleryID"]; tag.tagID = (long)allTags["TagID"]; ChemistryByTagItems.Add(tag); } allTags.Close(); allTags.Dispose(); } catch (Exception ex) { new ReportError(Globals.Chem4WordV3.Telemetry, Globals.Chem4WordV3.WordTopLeft, module, ex).ShowDialog(); } }