Exemplo n.º 1
0
        public ActionResult ViewUser()
        {
            WeChatUserViewModel model = new WeChatUserViewModel { WeChatUserEntity = CurrentWeChatUser, UserEntity = CurrentUser };
            try
            {
                if (!CurrentWeChatUser.IsUserLoggedIn)
                {
                    return Redirect("/wechat/account/login");
                }

                CityService cityService = new CityService();
                model.Provinces = cityService.GetProvinces(true);
                if (!string.IsNullOrEmpty(model.UserEntity.LocationId))
                {
                    model.Cities = cityService.GetCitiesByProvinceId(model.UserEntity.Province, true); //市
                    model.Areas = cityService.GetAreasByCityId(model.UserEntity.City, true); //区
                }
            }
            catch (Exception e)
            {
                LogService.Log("用户中心-viewuser", e.ToString());
            }
            return View(model);
        }
Exemplo n.º 2
0
 public ActionResult ViewUser()
 {
     RequireLogin();
     UserViewModel model = new UserViewModel { UserEntity = UserInfo };
     try
     {
         CityService cityService = new CityService();
         model.Provinces = cityService.GetProvinces(true);
         if (!string.IsNullOrEmpty(model.UserEntity.LocationId))
         {
             model.Cities = cityService.GetCitiesByProvinceId(model.UserEntity.Province, true); //市
             model.Areas = cityService.GetAreasByCityId(model.UserEntity.City, true); //区
         }
     }
     catch (Exception e)
     {
         LogService.Log("用户中心-index", e.ToString());
     }
     return View(model);
 }