public FrmActivityLog(ClsVehicle prVehicle)
 {
     InitializeComponent();
     cboActivitySelection.DataSource    = ClsActivity.ActivityType;
     cboListSorter.DataSource           = _SortStrings;
     cboActivitySelection.SelectedIndex = 0;
     _Vehicle = prVehicle;
 }
        private void editVehicle()
        {
            ClsVehicle lcVehicle = (ClsVehicle)lstLicencePlates.SelectedItem;

            if (lcVehicle != null && lcVehicle.ViewEdit())
            {
                updateDisplay();
            }
        }
        private void btnAddVehicle_Click(object sender, EventArgs e)
        {
            ClsVehicle lcVehicle = new ClsVehicle();

            if (lcVehicle != null && lcVehicle.ViewEdit())
            {
                ClsVehicleBusiness.VehicleList.Add(lcVehicle.RegistrationNo, lcVehicle);
                updateDisplay();
            }
        }
        private void btnDeleteVehicle_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Are you sure you want to remove this vehicle?", "Remove Vehicle", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                ClsVehicle lcVehicle = (ClsVehicle)lstLicencePlates.SelectedItem;
                ClsVehicleBusiness.VehicleList.Remove(lcVehicle.RegistrationNo);
                updateDisplay();
            }
            else
            {
                return;
            }
        }
Exemple #5
0
 public bool ShowDialog(ClsVehicle prVehicle)
 {
     _Vehicle = prVehicle;
     updateDisplay();
     return(ShowDialog() == DialogResult.OK);
 }