private void FormEditing_Load(object sender, EventArgs e) { this.customers = Customer.GetAllCustomer(this.connection); this.vehicles = Vehicle.GetAllVehicles(this.connection); this.locations = LocationCar.GetAllLocation(this.connection); this.groupBoxHeader.Paint += PaintBorderlessGroupBox; switch (this.preselect) { case 0: this.tabControlBaseData.SelectedTab = tabPageCustomer; break; case 1: this.tabControlBaseData.SelectedTab = tabPageCustomer; FillListViewCustomer(); ClearCustomer(); break; case 2: this.tabControlBaseData.SelectedTab = tabPageVehicle; break; case 3: this.tabControlBaseData.SelectedTab = tabPageLocation; break; } this.pictureBoxVehicleImage.AllowDrop = true; }
private void MenuItemLocationDelete_Click(object sender, EventArgs e) { if (this.locationclick != null) { this.locationclick.Delete(); this.locations = LocationCar.GetAllLocation(this.connection); FillListViewLocation(); this.locationclick = null; } }
private void FormRent_Load(object sender, EventArgs e) { this.groupBoxHeader.Paint += PaintBorderlessGroupBox; this.customers = Customer.GetAllCustomer(this.connection); this.vehicles = Vehicle.GetAvailableVehicles(this.connection, this.dateTimePickerBegin.Value); this.locations = LocationCar.GetAllLocation(this.connection); ClearVehicle(); ClearCustomer(); this.comboBoxVehicleLocation.DataSource = this.locations; this.comboBoxVehicleLocation.DisplayMember = "Name"; this.comboBoxVehicleLocation.ValueMember = "LocationId"; if (this.editRent) { this.vehicle = Vehicle.GetSpecificVehicles(this.connection, (int)this.rent.CarId); this.customer = Customer.GetSpecificCustomer(this.connection, (int)this.rent.CustomerId); this.vehicles.Add(vehicle); FillCustomer(); FillVehicle(); if (this.rent.Begin.HasValue) { this.dateTimePickerBegin.Value = this.rent.Begin.Value; } if (this.rent.End.HasValue) { this.dateTimePickerEnd.Value = this.rent.End.Value; this.dateTimePickerEnd.Checked = true; } this.listViewCustomer.Enabled = false; if (this.rent.Begin.Value < DateTime.Now) { this.listViewVehicle.Enabled = false; } } FillListViewCustomer(); FillListViewVehicle(); }