예제 #1
0
 public AddEditVehicle(TypeOfCar car2Edit, ManageVehicleListing manageVehicleListing = null)
 {
     InitializeComponent();
     lbFormTitle.Text = "Edit a Car";
     PopulateFields(car2Edit);
     _manageVehicleListing = manageVehicleListing;
     isEditMode            = true;
 }
예제 #2
0
 //private readonly int _formWidth = 355;
 //private readonly int _formHt = 663;
 public AddEditVehicle(ManageVehicleListing manageVehicleListing = null)
 {
     InitializeComponent();
     lbFormTitle.Text = "Add a Car";
     isEditMode       = false;
     //this.Width = _formWidth;
     //this.Height = _formHt;
     _manageVehicleListing = manageVehicleListing;
     CarRentalEntities _db = new CarRentalEntities();
 }
예제 #3
0
        private void vehicleListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var  openForms = Application.OpenForms.Cast <Form>();
            bool isOpen    = openForms.Any(q => q.Name == "ManageVehicleListing");

            if (!isOpen)
            {
                var cars = new ManageVehicleListing();
                cars.MdiParent = this;
                cars.Show();
            }
        }