Пример #1
0
 public void City()
 {
     try
     {
         int a = 0;
         if (cmbQY.Text != string.Empty)
         {
             if (cmbQY.Text != "中国")
             {
                 a = Convert.ToInt32(cmbQY.SelectedValue);
             }
         }
         List <Model_Region> regionlist = new List <Model_Region>();
         ResultModelOfArrayOfModel_Regiond4FqxSXX cit = cs.GetCity(a, true);
         if (cit.Code != 0)
         {
             MessageBox.Show(cit.Message);
         }
         else
         {
             foreach (Model_Region item in cit.Data)
             {
                 Model_Region region = new Model_Region();
                 region.Idk__BackingField   = item.Idk__BackingField;
                 region.Namek__BackingField = item.Namek__BackingField;
                 regionlist.Add(region);
             }
         }
         cmbCity.DisplayMember = "Namek__BackingField";
         cmbCity.ValueMember   = "Idk__BackingField";
         cmbCity.DataSource    = regionlist;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }