private void BindCitys(ISysBankType bankType, int pid) { var citys = bankType.SelectAllCitys(pid); this.drpCity.DataTextField = "CityName"; this.drpCity.DataValueField = "CityId"; this.drpCity.DataSource = citys; this.drpCity.DataBind(); if (!string.IsNullOrEmpty(Request.Params["drpCity"])) { this.drpCity.SelectedValue = Request.Params["drpCity"]; } }
/// <summary> /// 城市 /// </summary> private void GetCitys() { int pId; if (!int.TryParse(Request.Params["pId"], out pId)) { AppGlobal.RenderResult(ApiCode.ParamEmpty); return; } try { var result = mSysBankTypeService.SelectAllCitys(pId); var totalCount = 0; AppGlobal.RenderResult <List <CityDTO> >(ApiCode.Success, result, "", 1, totalCount); } catch (Exception ex) { Ytg.Scheduler.Comm.LogManager.Error("GetCitys", ex); AppGlobal.RenderResult(ApiCode.Exception); } }