public ActionResult Index(LoginUser userInfo) { var province = WebUserHelp.GetNowProvinceId(); var city = WebUserHelp.GetNowCityId(); //省份 List <FxtApi_SYSProvince> provinceList = _unitOfWork.CityService.GetProvinceCityListBy(userInfo.UserName, userInfo.SignName, userInfo.AppList); if (provinceList.Where(m => m.CityList.Any(c => c.CityId == city)).Count() < 1) { WebUserHelp.SetNowProvinceAndCity(0, 0); } ViewBag.UserName = userInfo.TrueName; ViewBag.ProvinceList = provinceList; ViewBag.NowProvinceId = WebUserHelp.GetNowProvinceId(); ViewBag.NowCityId = city; ViewBag.MenuList = GetMenuDtoList(userInfo.UserName, userInfo.NowCityId, userInfo.FxtCompanyId, userInfo); return(View()); }
public ActionResult SubmitChangeCity_Api(int provinceId, int cityId) { string json = ""; if (provinceId < 1 || cityId < 1) { Response.Write(json.MvcResponseJson(result: 0, message: "请选择城市")); Response.End(); return(null); } WebUserHelp.SetNowProvinceAndCity(provinceId, cityId); Response.Write(json.MvcResponseJson(result: 1, message: "")); Response.End(); return(null); }
public ActionResult SubmitChangeCity_Api(int provinceId, int cityId) { AjaxResult result = new AjaxResult(""); if (provinceId < 1 || cityId < 1) { result.Result = false; result.Message = "请选择城市"; return(AjaxJson(result)); } WebUserHelp.SetNowProvinceAndCity(provinceId, cityId); return(AjaxJson(result)); }