Esempio n. 1
0
        // GET: Admin/Estates/Create
        public IActionResult Create()
        {
            var cities = _estateService.GetCityForManageEstate();

            ViewData["Cities"] = new SelectList(cities, "Value", "Text");
            var subCities = _estateService.GetSubCityForManageEstate(int.Parse(cities.First().Value));

            ViewData["SubCities"] = new SelectList(subCities, "Value", "Text");


            var types = _estateService.GetEstateTypeForManageEstate();

            ViewData["Types"] = new SelectList(types, "Value", "Text");
            var subTypes = _estateService.GetSubEstateTypeForManageEstate(int.Parse(types.First().Value));

            ViewData["SubTypes"] = new SelectList(subTypes, "Value", "Text");

            ViewData["Status"] = new SelectList(_context.EstateStatuses, "StatusId", "Title");

            return(View());
        }
Esempio n. 2
0
        public IActionResult GetSubCity(int id)
        {
            List <SelectListItem> list = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "انتخاب کنید", Value = ""
                }
            };

            list.AddRange(_estateService.GetSubCityForManageEstate(id));
            return(Json(new SelectList(list, "Value", "Text")));
        }