예제 #1
0
        private void DeleteExperimentsBeforeDateTimePB_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <ExperimentContainer> experiments;
            bool success = m_db.GetAllExperimentsBeforeDateTime(m_vm.datetime1, out experiments);

            MessageBoxResult result = MessageBox.Show("Delete " + experiments.Count.ToString() + " Experiments?", "Delete Experiments", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                success = m_db.DeleteAllExperimentsBefore(m_vm.datetime1);

                if (!success)
                {
                    string errMsg = m_db.GetLastErrorMsg();
                    MessageBox.Show("Failed to Delete Experiments: " + errMsg);
                }
            }
        }