/// <summary> /// 获取省会城市 /// </summary> /// <param name="countryId"></param> /// <returns></returns> public List <V_ProvinceCity> GetProvinceCity(string countryId) { var ents = from ent in dal.GetObjects <T_SYS_PROVINCECITY>().Include("T_SYS_PROVINCECITY2") //where ent.COUNTRYID == countryId select ent; List <V_ProvinceCity> listprovince = new List <V_ProvinceCity>(); if (ents != null) { if (ents.Count() > 0) { ents.ToList().ForEach(item => { V_ProvinceCity ent = new V_ProvinceCity(); ent.PROVINCEID = item.PROVINCEID; ent.COUNTRYID = item.COUNTRYID; ent.AREANAME = item.AREANAME; ent.FATHERID = item.T_SYS_PROVINCECITY2 == null ? "":item.T_SYS_PROVINCECITY2.PROVINCEID; ent.AREAVALUE = item.AREAVALUE; ent.ISCITY = item.ISCITY; ent.ISPROVINCE = item.ISPROVINCE; ent.ISCOUNTRYTOWN = item.ISCOUNTRYTOWN; listprovince.Add(ent); }); } } return(listprovince.Count() > 0 ? listprovince : null); }
private void CheckBoxIsChecked(V_ProvinceCity ent, CheckBox cbx) { if (Citys != null) { if (Citys.Length > 0) { if (Array.IndexOf(Citys, ent.AREAVALUE.ToString()) > -1) { cbx.IsChecked = true; } else { cbx.IsChecked = false; } } } }
private void RadionIsChecked(V_ProvinceCity ent, RadioButton rd) { if (Citys != null) { if (Citys.Length > 0) { if (Array.IndexOf(Citys, ent.AREAVALUE.ToString()) > -1) { rd.IsChecked = true; } else { rd.IsChecked = false; } } } }