/// <summary> /// 绑定数据 /// </summary> public override void DataBind() { this.Items.Clear(); this.Items.Add(new ListItem(this.NullToDisplay, string.Empty)); DataTable dtCountry = BaseCountryHelper.GetBaseCountry(); if (dtCountry != null && dtCountry.Rows.Count > 0) { for (int i = 0; i < dtCountry.Rows.Count; i++) { string itemValue = dtCountry.Rows[i]["HSCode"].ToString(); ListItem item = new ListItem(Globals.HtmlDecode(dtCountry.Rows[i]["CName"].ToString()), itemValue); this.Items.Add(item); } } }
/// <summary> /// 获取海关编码数据 /// </summary> /// <param name="context"></param> public void GetCountry(System.Web.HttpContext context) { string code = context.Request["query"].ToString(); this.message = Newtonsoft.Json.JsonConvert.SerializeObject(BaseCountryHelper.GetBaseCountryByName(code)); }