Esempio n. 1
0
 public AddEditVehicle(ManageVehicleListing manageVehicle = null)
 {
     InitializeComponent();
     lbltitle.Text  = "Add New Vehicle";
     this.Text      = "Add New Vehicle";
     isEditMode     = false;
     _manageVehicle = manageVehicle;
     _db            = new carRentalEntities();
 }
Esempio n. 2
0
        private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var OpenForms = Application.OpenForms.Cast <Form>();
            var IsOpen    = OpenForms.Any(q => q.Name == "ManageVehicleListing");

            if (!Utils.FormIsOpen("ManageVehicleListing"))
            {
                var VehicleListing = new ManageVehicleListing();
                VehicleListing.MdiParent = this;
                VehicleListing.Show();
            }
        }
Esempio n. 3
0
        public AddEditVehicle(typesOfCar carToEdit, ManageVehicleListing manageVehicle = null)
        {
            InitializeComponent();
            lbltitle.Text = "Edit Vehicle";
            this.Text     = "Edit Vehicle";

            if (carToEdit == null)
            {
                MessageBox.Show("Please ensure that  u selected a valid record to edit");
                Close();
            }
            else
            {
                isEditMode     = true;
                _manageVehicle = manageVehicle;
                _db            = new carRentalEntities();
                PopulateFields(carToEdit);
            }
        }