Beispiel #1
0
 public AddEditVehicle(ManageVehicleListing manageVehicleListing = null)
 {
     InitializeComponent();
     labTitle.Text         = "Add New Vehicle";
     this.Text             = "Add New Vehicle";
     isEditMode            = false;
     _manageVehicleListing = manageVehicleListing;
     _db = new CarRentalEntities1();
 }
Beispiel #2
0
 private void manageVToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!Utils.FormIsOpen("ManageVehicleListing"))
     {
         var vehicleListing = new ManageVehicleListing();
         vehicleListing.MdiParent = this;
         vehicleListing.Show();
     }
 }
Beispiel #3
0
 public AddEditVehicle(TypesOfCars carToEdit, ManageVehicleListing manageVehicleListing = null)
 {
     InitializeComponent();
     labTitle.Text         = "Edit Vehicle";
     this.Text             = "Edit Vehicle";
     _manageVehicleListing = manageVehicleListing;
     if (carToEdit == null)
     {
         MessageBox.Show("Please ensure that you selected a valid record to edit");
         Close();
     }
     else
     {
         isEditMode = true;
         _db        = new CarRentalEntities1();
         PopulateFields(carToEdit);
     }
 }