private void btnSearch_Click(object sender, RoutedEventArgs e) { try { CapgeminiDetails c = new CapgeminiDetails(); c = (CapgeminiDetails)lsSearch.SelectedValue; cbEmployeeId.ItemsSource = bll.GetAllEmployee(); cbEmployeeId.DisplayMemberPath = "EmployeeID"; cbEmployeeId.Text = (bll.SelectEmployee(c.EmployeeId)).EmployeeID.ToString(); txtEmail.Text = c.Email; cbLevel.ItemsSource = bll.GetAllLevel(); cbLevel.DisplayMemberPath = "LevelDescription"; cbLevel.Text = (bll.SelectLevel(c.LevelId)).LevelDescription; dpDateHired.Text = c.DateHired.ToString(); cbSpeciality.ItemsSource = bll.GetAllSpeciality(); cbSpeciality.DisplayMemberPath = "SpecialityName"; cbSpeciality.Text = (bll.SelectSpeciality(c.SpecialityId)).SpecialityName; cbStatus.ItemsSource = bll.GetAllStatus(); cbStatus.DisplayMemberPath = "StatusDescription"; cbStatus.Text = (bll.SelectStatus(c.StatusId)).StatusDescription; dgRecords.ItemsSource = bll.GetAll(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }