/// <summary> /// Populate the data grid with information about engine with given engine Id /// </summary> private void PopulateDataGridViewGetEngineById() { dataGridView.Rows.Clear(); EngineBusiness engineBusiness = new EngineBusiness(); int.TryParse(txtGet.Text, out int engineId); var enginesList = engineBusiness.GetEngineById(engineId); DataPopulatorSingle(enginesList); }
/// <summary> /// Update the input text boxes with information for a selected engine /// </summary> /// <param name="Id">The ID of a selected engine</param> private void UpdateTextBoxes(int Id) { EngineBusiness engineBusiness = new EngineBusiness(); Engine engine = engineBusiness.GetEngineById(Id); txtDisplacement.Text = engine.Displacement.ToString(); txtEconomy.Text = engine.EconomyPerHundredKm.ToString(); txtFuelType.Text = FuelENGToBG(engine.FuelType); txtName.Text = engine.Name; txtPower.Text = engine.Power.ToString(); }