/// <summary> /// Populate the data grid with information about worker with given worker Id /// </summary> private void PopulateDataGridViewGetWorkerById() { dataGridView.Rows.Clear(); WorkerBusiness workerBusiness = new WorkerBusiness(); int.TryParse(txtGet.Text, out int workerId); var worker = workerBusiness.GetWorkerById(workerId); DataPopulatorSingle(worker); }
/// <summary> /// Update the input text boxes with information for a selected worker /// </summary> /// <param name="Id">The ID of a selected worker</param> private void UpdateTextBoxes(int Id) { WorkerBusiness workerBusiness = new WorkerBusiness(); Worker worker = workerBusiness.GetWorkerById(Id); txtFirstName.Text = worker.FirstName; txtLastName.Text = worker.LastName; txtPosition.Text = worker.Position; txtSalary.Text = worker.Salary.ToString(); txtDealership.Text = worker.CarDealershipId.ToString(); }