public ActionResult Edit(long id) { var data = CommunityService.GetById(id); var userId = AdminHelper.AdminUserId(HttpContext); var cityId = AdminUserService.GetById(userId.Value).CityId; if (cityId == null) { return(View("Error", (object)"总部不能编辑地区")); } CommunityEditModel model = new CommunityEditModel() { Community = data, Regions = RegionService.GetAll() }; return(View(model)); }