private void nameComboBox_SelectedIndexChanged(object sender, EventArgs e) { List <Incident> incidentsList; technicianBindingSource.Clear(); if (nameComboBox.SelectedIndex > -1) { int intTechID = technicianList[nameComboBox.SelectedIndex].TechID; Technician technician = TechnicianDB.GetTechnician(intTechID); technicianBindingSource.Add(technician); incidentsList = IncidentDB.GetOpenTechnicianIncidents(intTechID); incidentDataGridView.DataSource = incidentsList; } }
/// <summary> /// Retrieves specific tech based on its ID passed in /// </summary> /// <param name="techID">Used to find the correct technician</param> /// <returns>Returns technician based on its techID</returns> public Technician GetTechnician(int techID) { Technician technician = TechnicianDB.GetTechnician(techID); return(technician); }