private void EditSelectedItem()
        {
            MaintenancePerformance selectedItem = maintenanceComplianceListView.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }
            string caption = aircraft.RegistrationNumber + ". Maintenance Status. " + selectedItem.CheckTypeExtended + " check";
            MaintenancePerformanceForm form = new MaintenancePerformanceForm(caption);

            form.ReadOnly = readOnly;
            form.UpdateDisplayedData(selectedItem);
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (form.SaveDisplayedData(selectedItem))
                {
                    selectedItem.Save(false);
                    DisplayItems();
                }
                else
                {
                    CASMessage.Show(MessageType.InvalidValue, new object[] { "Check" });
                }
            }
        }
        private void AddNewItem()
        {
            MaintenancePerformanceForm form = new MaintenancePerformanceForm(aircraft.RegistrationNumber + ". Maintenance Status. New check");

            form.ReadOnly = readOnly;
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                MaintenancePerformance newItem = new MaintenancePerformance();
                if (form.SaveDisplayedData(newItem))
                {
                    aircraft.AddMaintenancePerformance(newItem);
                    DisplayItems();
                }
                else
                {
                    CASMessage.Show(MessageType.InvalidValue, new object[] { "Check" });
                }
            }
        }