Exemple #1
0
 private void cbxEspecialidades_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         cbxProfesionales.SelectedIndex = -1;
         cbxProfesionales.Items.Clear();
         if (cbxEspecialidades.SelectedIndex != -1)
         {
             Dictionary <int, String> profesionales = new Dictionary <int, string>();
             tn.idProfesional = ((KeyValuePair <int, String>)cbxEspecialidades.SelectedItem).Key;
             profesionales    = tn.getProfesionales();
             foreach (KeyValuePair <int, string> pair in profesionales)
             {
                 cbxProfesionales.Items.Add(pair);
             }
             cbxProfesionales.DisplayMember = "Value";
         }
     }catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.ToString());
     }
 }