private void comboBoxShi_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (comboBoxShi.SelectedItem != null)
{
ComboBoxItem shi = (ComboBoxItem)comboBoxShi.SelectedItem;
DataTable table_CityXian = _data.GetCityData(ConfigData.CityType.Xian, shi.Value);
if (table_CityXian != null && table_CityXian.Rows.Count > 0)
{
comboBoxXian.Items.Clear();
foreach (DataRow dr in table_CityXian.Rows)
{
comboBoxXian.Items.Add(new ComboBoxItem(dr["Name"].ToString(), dr["Code"].ToString()));
}
}
}
if (bool_IsStarting)
{
for (int i = 0; i < comboBoxXian.Items.Count; i++)
{
ComboBoxItem item = comboBoxXian.Items[i] as ComboBoxItem;
if (item.Value.Equals(str_XIAN))
{
comboBoxXian.SelectedIndex = i;
break;
}
}
}
else
{
BtnApply.Enabled = true;
comboBoxXian.SelectedIndex = 0;
}
}
catch (Exception ex)
{
log.WriteLog(ex.ToString());
}
}