//填充国别信息
        private void BindListControl()
        {
            CountrycodeCollection countrycodes = CountrycodeAdapter.Instance.LoadAllFromCache();

            foreach (var country in countrycodes)
            {
                ListItem item = new ListItem(country.CnName, country.Code);
                item.Attributes.Add("title", country.Code);
                _stateDropdownList.Items.Add(item);
            }
        }
Example #2
0
        public IList <DropdownLitsItem> GetPropertiesList()
        {
            List <DropdownLitsItem> result = new List <DropdownLitsItem>();

            CountrycodeCollection countries = CountrycodeAdapter.Instance.LoadAllFromCache();

            foreach (Countrycode country in countries)
            {
                DropdownLitsItem item = new DropdownLitsItem()
                {
                    Code = string.Format("{0}", country.Code), CnName = string.Format("{0}", country.CnName)
                };
                result.Add(item);
            }

            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetNoStore();
            RegisterPropertyEditor();

            if (this.IsCallback == false)
            {
                CountrycodeCollection collection = CountrycodeAdapter.Instance.LoadAllFromCache();

                List <EnumItemPropertyDescription> result = new List <EnumItemPropertyDescription>();

                foreach (Countrycode item in collection)
                {
                    result.Add(new EnumItemPropertyDescription(item.Code, item.CnName));
                }

                this.hiddenSource.Value = JSONSerializerExecute.Serialize(result);
            }
        }