DesktopHelper.UI.ConfigForm.SetDefaultCity C# (CSharp) Method

SetDefaultCity() private method

private SetDefaultCity ( string code ) : void
code string
return void
        private void SetDefaultCity(string code)
        {
            try
            {
                DataTable table_CityInfo = _data.GetCityInfoByCode(code);
                if (table_CityInfo != null && table_CityInfo.Rows.Count == 1)
                {
                    string sheng = table_CityInfo.Rows[0]["ShengParent"].ToString();
                    str_SHI = table_CityInfo.Rows[0]["ShiParent"].ToString();
                    str_XIAN = table_CityInfo.Rows[0]["Code"].ToString();
                    for (int i = 0; i < comboBoxSheng.Items.Count; i++)
                    {
                        ComboBoxItem item = comboBoxSheng.Items[i] as ComboBoxItem;
                        if (item.Value.Equals(sheng))
                        {
                            comboBoxSheng.SelectedIndex = i;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString());
            }
        }