public AddEditVehicle(TypeOfCar carToEdit, ManageVehicleListing manageVehicleListing = null) { InitializeComponent(); title_lbl.Text = "Edit New Vehicle"; this.Text = "Edit New Vehicle"; _manageVehicleListing = manageVehicleListing; if (carToEdit == null) { MessageBox.Show("Please to ensure that you selected a valid record to edit"); } else { isEditMode = true; carRentalEntities = new CarRentalEntities(); populateFields(carToEdit); } /* InitializeComponent(); * title_lbl.Text = "Edit Vehicle"; * isEditMode = true; * carRentalEntities = new CarRentalEntities(); * PopulateFields(carToEdit);*/ }
private void btnCancel_Click(object sender, EventArgs e) { var vehicleListing = new ManageVehicleListing(); vehicleListing.MdiParent = this.MdiParent; vehicleListing.Show(); this.Close(); }
private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e) { ManageVehicleListing mvl = new ManageVehicleListing(); mvl.MdiParent = this; mvl.WindowState = FormWindowState.Maximized; mvl.Show(); }
public AddEditVehicle(ManageVehicleListing manageVehicleListing = null) { InitializeComponent(); lblTitle.Text = "Add New Vehicle"; isEditMode = false; _manageVehicleListing = manageVehicleListing; _db = new CarRentalEntities(); }
private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e) { if (!Utils.FormIsOpen("ManageVehicleListing")) { var vehicleListing = new ManageVehicleListing(); vehicleListing.MdiParent = this; vehicleListing.Show(); } }
public AddEditVehicle(TypesOfCar carToEdit, ManageVehicleListing manageVehicleListing = null) { InitializeComponent(); lblTitle.Text = "Edit Vehicle"; PopulateFields(carToEdit); _manageVehicleListing = manageVehicleListing; _db = new CarRentalEntities(); isEditMode = true; }
private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e) { var OpenForms = Application.OpenForms.Cast <Form>(); var isOpen = OpenForms.Any(q => q.Name == "ManageVehicleListing"); if (!isOpen) { var vehicleListing = new ManageVehicleListing(); vehicleListing.MdiParent = this; vehicleListing.Show(); } }
public AddEditVehicle(TypesOfCar carToEdit, ManageVehicleListing manageVehicleListing = null) { InitializeComponent(); lblTitle.Text = "Edit Vehicle"; this.Text = "Edit Vehicle"; _manageVehicleListing = manageVehicleListing; if (carToEdit == null) { MessageBox.Show("Select a record to Edit."); Close(); } else { isEditMode = true; db = new CarRentalEntities(); PopulateFields(carToEdit); } }
public AddEditVehicle(TypesOfCar carToEdit, ManageVehicleListing manageVehicleListing = null) { InitializeComponent(); lbl_Title.Text = "Edit Vehicle"; this.Text = "Edit Vehicle"; _manageVehicleListing = manageVehicleListing; if (carToEdit == null) { MessageBox.Show("Please ensure that you selected a valid record"); Close(); } else { isEditMode = true; _db = new CarRentalEntities(); PopulateFields(carToEdit); } }