示例#1
0
        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();
        }
示例#3
0
        private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ManageVehicleListing mvl = new ManageVehicleListing();

            mvl.MdiParent   = this;
            mvl.WindowState = FormWindowState.Maximized;
            mvl.Show();
        }
示例#4
0
 public AddEditVehicle(ManageVehicleListing manageVehicleListing = null)
 {
     InitializeComponent();
     lblTitle.Text         = "Add New Vehicle";
     isEditMode            = false;
     _manageVehicleListing = manageVehicleListing;
     _db = new CarRentalEntities();
 }
示例#5
0
 private void manageVehicleListingToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!Utils.FormIsOpen("ManageVehicleListing"))
     {
         var vehicleListing = new ManageVehicleListing();
         vehicleListing.MdiParent = this;
         vehicleListing.Show();
     }
 }
示例#6
0
        public AddEditVehicle(TypesOfCar carToEdit, ManageVehicleListing manageVehicleListing = null)
        {
            InitializeComponent();
            lblTitle.Text = "Edit Vehicle";
            PopulateFields(carToEdit);
            _manageVehicleListing = manageVehicleListing;

            _db        = new CarRentalEntities();
            isEditMode = true;
        }
示例#7
0
        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);
     }
 }