private void textBoxTotalSeries_DoubleClick(object sender, EventArgs e) { IStorageDataAccessAgent db = GetDataAccessAgent(); if (db != null) { _seriesCount = db.FindSeriesCount(_mpc); textBoxTotalSeries.Text = _seriesCount.ToString(); } }
private void Initialize() { if (treeViewSqlServerInformation != null && treeViewSqlServerInformation.Nodes != null) { treeViewSqlServerInformation.Nodes.Clear(); } _ciStorage = null; // Sql Server Information foreach (KeyValuePair <string, string> kvp in this.SqlDatabaseList) { ConnectionInformation ci = GetInfo(kvp.Key, kvp.Value); UpdateDatabaseDetails(ci); if (ci.FriendlyName == StorageDatabaseName) { _ciStorage = ci; } } // Patient, study, series, image count if (_ciStorage != null) { IStorageDataAccessAgent db = GetDataAccessAgent(); textBoxTotalPatients.Text = "0"; textBoxTotalStudies.Text = "0"; textBoxTotalSeries.Text = "0"; textBoxTotalImages.Text = "0"; double dTotalMBytes = 0; try { _patientCount = db.FindPatientsCount(_mpc); _studiesCount = db.FindStudiesCount(_mpc); _seriesCount = db.FindSeriesCount(_mpc); _imageCount = db.FindCompositeInstancesCount(_mpc); // RecalculateTotalDataStored(); } catch (Exception ex) { MessageBox.Show(ex.Message); } textBoxTotalPatients.Text = _patientCount.ToString(); textBoxTotalStudies.Text = _studiesCount.ToString(); textBoxTotalSeries.Text = _seriesCount.ToString(); textBoxTotalImages.Text = _imageCount.ToString(); textBoxTotalDataStored.Text = string.Format("{0:F1} MB", dTotalMBytes); } }
private void ValidateLicense(CancelStoreEventArgs e) { if (_License == null) { e.Cancel = true; e.CancelMessage = "No valid license provided."; } else { if (_AccessAgent != null) { string instance = string.Empty; int count; MatchingParameterCollection mpc = new MatchingParameterCollection() { { new MatchingParameterList() } }; if (_FeatureStudyCount != null) { instance = e.DataSet.GetValue <string>(DicomTag.StudyInstanceUID, string.Empty); if (!_AccessAgent.IsStudyExists(instance)) { count = _AccessAgent.FindStudiesCount(mpc); if (_FeatureStudyCount.Counter > 0 && (count + 1) > _FeatureStudyCount.Counter) { e.Cancel = true; e.CancelMessage = string.Format("Max study limit reached, Study ({0}) not stored. The license is restricted to storing {1} {2}.", instance, count, count == 1 ? "study" : "studies"); return; } } } if (_FeatureSeriesCount != null) { instance = e.DataSet.GetValue <string>(DicomTag.SeriesInstanceUID, string.Empty); if (!_AccessAgent.IsSeriesExists(instance)) { count = _AccessAgent.FindSeriesCount(mpc); if (_FeatureSeriesCount.Counter > 0 && (count + 1) > _FeatureSeriesCount.Counter) { e.Cancel = true; e.CancelMessage = string.Format("Max series limit reached, Series ({0}) not stored. The license is restricted to storing {1} series.", instance, count); return; } } } } } }