示例#1
0
 private void LookupOther(string state, string city, bool autoDefault = false)
 {
     if (ShippingProvider != null)
     {
         var lookupResults = ShippingProvider.GetStreetsForCity(ProductsBase.CountryCode, state, city);
         if (lookupResults != null && lookupResults.Count > 0)
         {
             foreach (var district in lookupResults)
             {
                 string[] item = district.Split('-');
                 ddlDistrict.Items.Add(new ListItem(item[1], item[0]));
             }
             ddlDistrict.Items.Insert(0, new ListItem(GetLocalResourceObject("Select") as string, string.Empty));
             ddlDistrict.SelectedIndex = (autoDefault && (ddlDistrict.Items.Count > 0)) ? 1 : 0;
         }
         else
         {
             ddlCity.Focus();
         }
     }
 }