/// <summary> /// Load scan summaries from database from dataset specified by <see cref="GroupId" />, /// given an existing data-access-object to use. /// </summary> /// <param name="dao">The existing data-access-object to use to access the database.</param> public void LoadFromDatabase(ScanSummaryDAOHibernate dao) { this.scanSummaryDao = dao; var data = dao.FindByDatasetId(this.GroupId); foreach (var summary in data) { this.summary.ScanMetaData.Add(summary.Scan, summary); this.MinScan = Math.Min(this.MinScan, summary.Scan); this.MaxScan = Math.Max(this.MaxScan, summary.Scan); } this.TotalScans = this.MaxScan - this.MinScan; this.IsBackedByFile = false; }
/// <summary> /// Initializes a new instance of the <see cref="ScanSummaryProvider"/> class. /// For initializing a ScanSummaryProvider from a database data access object. /// </summary> /// <param name="groupId">The identifier for the dataset that this provider is a part of.</param> /// <param name="scanSummaryDao"></param> public ScanSummaryProvider(int groupId, ScanSummaryDAOHibernate scanSummaryDao) : this(groupId) { this.scanSummaryDao = scanSummaryDao; this.IsBackedByFile = false; }
/// <summary> /// Load scan summaries from database from dataset specified by <see cref="GroupId" />. /// </summary> public void LoadFromDatabase() { var dao = new ScanSummaryDAOHibernate(); this.LoadFromDatabase(dao); }