/// <summary> /// Populate the data grid with information about car with given car Id /// </summary> private void PopulateDataGridViewGetCarById() { dataGridView.Rows.Clear(); HideSpecificInfo(); CarBusiness carBusiness = new CarBusiness(); int.TryParse(txtGet.Text, out int carId); var cars = carBusiness.GetCarById(carId); DataPopulatorSingle(cars); }
/// <summary> /// Update the input text boxes with information for a selected car /// </summary> /// <param name="Id">The ID of a selected car</param> private void UpdateTextBoxes(int Id) { CarBusiness carBusiness = new CarBusiness(); Car car = carBusiness.GetCarById(Id); txtColor.Text = car.Color; txtDealership.Text = car.CarDealershipId.ToString(); txtEngine.Text = car.EngineId.ToString(); txtGears.Text = car.TransmissionGears.ToString(); txtManufacturer.Text = car.Manufacturer; txtModel.Text = car.Model; txtOwner.Text = car.OwnerId.ToString(); txtPrice.Text = car.Price.ToString(); txtTransmission.Text = car.TransmissionType; }