Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }