Пример #1
0
        public void DeleteSelectedDatasets()
        {
            foreach (ListViewItem lvi in listViewEventLog.SelectedItems)
            {
                EventLogItem eventLogItem = lvi.Tag as EventLogItem;

                string file = eventLogItem.DatasetPath;
                if (File.Exists(file))
                {
                    try
                    {
                        File.Delete(file);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }
Пример #2
0
        public string GetDeleteSelectedQuery()
        {
            string sQuery = "DELETE FROM DICOMServerEventLog";
            bool   bFirst = true;

            foreach (ListViewItem lvi in listViewEventLog.SelectedItems)
            {
                EventLogItem eventLogItem = lvi.Tag as EventLogItem;

                int eventId = eventLogItem.EventId;
                if (bFirst)
                {
                    sQuery = sQuery + string.Format(" WHERE EventId = '{0}' ", eventId);
                    bFirst = false;
                }
                else
                {
                    sQuery = sQuery + string.Format(" OR EventId = '{0}' ", eventId);
                }
            }

            return(sQuery);
        }