private void AddCalamity(object sender, RoutedEventArgs e)
        {
            Device d = (Device)this.dg_DevicesList.SelectedItem;

            AddCalamityView acv = new AddCalamityView(this, d.Name);

            if (acv.ShowDialog() == true)
            {
                DatabaseController.AddCalamity(d.DeviceId, acv.NewCalamity);
                UpdateDeviceListView();
                UpdateCalamityListView();
                UpdateLogbookView();
                liveChartsController.UpdateDistinctYears();
            }
        }
        private void EditCalamity(object sender, RoutedEventArgs e)
        {
            Calamity d = (Calamity)this.dg_CalamityList.SelectedItem;

            AddCalamityView acv = new AddCalamityView(this, d);

            if (acv.ShowDialog() == true)
            {
                DatabaseController.EditCalamity(acv.NewCalamity);
                UpdateDeviceListView();
                UpdateCalamityListView();
                UpdateLogbookView();
                liveChartsController.UpdateDistinctYears();
            }
        }