Example #1
0
        private void XDetails_Click(object sender, RoutedEventArgs e)
        {
            int          id     = ((Outage)XOutages.SelectedItem).Id;
            OutageWindow window = new OutageWindow(oms, WindowMode.Details, id);

            window.ShowDialog();
        }
Example #2
0
        private void XCreate_Click(object sender, RoutedEventArgs e)
        {
            OutageWindow window = new OutageWindow(oms, WindowMode.Create, 0);

            window.ShowDialog();
            XSearch_Click(new object(), new RoutedEventArgs());
        }
Example #3
0
        private void XUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (((Outage)XOutages.SelectedItem).State == OutageState.Closed)
            {
                MessageBox.Show($"Error: Outage is closed and cannot be further updated.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            int          id     = ((Outage)XOutages.SelectedItem).Id;
            OutageWindow window = new OutageWindow(oms, WindowMode.Update, id);

            window.ShowDialog();
            XSearch_Click(new object(), new RoutedEventArgs());
        }