private void Exitbutton_Click(object sender, EventArgs e) { foreach (CarModel car in DbController.GetCars()) { DbController.SetStatus(car.id, "Free"); } this.Close(); }
private void BlockButton_Click(object sender, EventArgs e) { SelectedCar = CarGridView.CurrentCell.RowIndex + 1; SelectedCarId = Convert.ToInt16(CarGridView.Rows[CarGridView.CurrentCell.RowIndex].Cells["CarId"].Value); DbController.SetStatus(SelectedCarId, "Blocked"); CarGridView.Rows.Clear(); i = 0; foreach (CarModel car in DbController.GetCars()) { if ((DateTime.Compare(Date1, car.date) > 0 || CarCheckBox.Checked) && car.status == "Free") { CarGridView.Rows.Add(car.id, car.brand, car.model, car.power, car.seats, car.maxv, car.price, car.gearbox, car.fuel, car.colour); } } }