public PartialViewResult _HtmlSelectBoxDistrict(string CityID, string Selected) { var result = locationService.GetLstDictrictByCityId(CityID).Select(x => new SelectItemBase { Id = x.Id, Name = x.Name }).ToList(); ViewBag.Selected = Selected; return(PartialView(result)); }
public ContentResult GetDistrict(string DistrictID, string cityID) { var result = locationService.GetLstDictrictByCityId(cityID).FirstOrDefault(x => x.Id == DistrictID); string name = result != null ? result.Name : ""; return(Content(name)); }
public ActionResult GetDistrictByCityId(string cityId) { var result = new CustomJsonResult(); try { result.Result = locationService.GetLstDictrictByCityId(cityId).Select(x => new SelectItemBase { Id = x.Id, Name = x.Name }).ToList(); } catch (Exception ex) { result.Message = ex.Message; } return(Json(result)); }