Ejemplo n.º 1
0
 private void EditMaintnenanceItemButton_Click(object sender, RoutedEventArgs e)
 {
     if (SelectedCompleteItem != null)
     {
         EditSelectedCompleteItem();
     }
     else if (SelectedMaintenanceItem != null)
     {
         EditMaintenanceItemDlg editMaintenanceItemDlg = new EditMaintenanceItemDlg(SelectedMaintenanceItem)
         {
             Owner = this,
             WindowStartupLocation = WindowStartupLocation.CenterOwner,
         };
         if ((bool)editMaintenanceItemDlg.ShowDialog())
         {
             DrawMaintenanceItems();
         }
     }
 }
Ejemplo n.º 2
0
        private void AddMaintenanceItemButton_Click(object sender, RoutedEventArgs e)
        {
            MaintenanceItem maintenanceItem = new MaintenanceItem()
            {
                Name = "New Maintenance Item",
                MaintenanceIntervalType   = MaintenanceIntervalType.DateAndMileage,
                MonthsMaintenanceInterval = 12,
                MilesMaintenanceInterval  = 12000,
                Actions = string.Empty
            };
            EditMaintenanceItemDlg editMaintenanceItemDlg = new EditMaintenanceItemDlg(maintenanceItem)
            {
                Owner = this,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
            };

            if ((bool)editMaintenanceItemDlg.ShowDialog())
            {
                MaintenanceItems.Add(maintenanceItem);
                SelectedMaintenanceItem = maintenanceItem;
                DrawMaintenanceItems();
            }
        }