public void PopulateSpecialsist() { cmbDoctorName.DisplayMember = "DisplayName"; //cmbDoctorName.ValueMember = "PersonId"; DataBase db = new SpecialistData(); List <Specialist> list = db.GetList().ConvertAll(x => x as Specialist); BindingSource bs = new BindingSource(); List <Specialist> otherSpecialists = GetOtherDoctors(list, _student.ProfessionalServiceProviders.ConvertAll(x => x as Specialist)); bs.DataSource = otherSpecialists; cmbDoctorName.DataSource = bs; cmbDoctorName.SelectedIndex = -1; cmbDoctorName.Refresh(); }
public void PopulateSpecialists() { // cmbSpecialistId.SelectedIndexChanged -= cmbSpecialistId_SelectedIndexChanged; string sql = "SELECT * FROM vw_ProfessionalServiceProviders WHERE ProfessionalServiceProviderTypeId = " + _appointmentBase.ProfessionalServiceProviderTypeId;// cmbAppointmentType.SelectedValue; SpecialistData sd = new SpecialistData(); List <Specialist> specialists = sd.GetList(sql).ConvertAll(x => x as Specialist); cmbSpecialistId.DataSource = null; cmbSpecialistId.DataSource = specialists; cmbSpecialistId.ValueMember = "PersonId"; cmbSpecialistId.DisplayMember = "FullName"; cmbSpecialistId.Refresh(); //cmbSpecialistId.SelectedIndex = -1; //cmbSpecialistId.SelectedIndexChanged += cmbSpecialistId_SelectedIndexChanged; }
public void LoadFullList() { ep.SetError(dgProfessionalServices, ""); try { DataBase db = new SpecialistData(); _allProfessionals = db.GetList().ConvertAll(x => x as Specialist); _filteredList = _allProfessionals; _groupList = _allProfessionals; } catch (Exception ex) { ep.SetError(dgProfessionalServices, ex.Message); } }