示例#1
0
        /// <summary>
        /// 用户中心及其导航条
        /// </summary>
        /// <returns></returns>
        public PartialViewResult UserInfo(int uid = -1, string nickname = "")
        {
            YSWL.MALL.BLL.Members.Users           UserBll   = new BLL.Members.Users();
            YSWL.MALL.Model.Members.UsersExpModel UserModel = new Model.Members.UsersExpModel();
            YSWL.MALL.BLL.Ms.Regions RegionBll  = new BLL.Ms.Regions();
            YSWL.MALL.BLL.SNS.Star   starManage = new YSWL.MALL.BLL.SNS.Star();
            int ID;

            if (!string.IsNullOrEmpty(nickname) && ((ID = UserBll.GetUserIdByNickName(nickname)) > 0))
            {
                uid = ID;
            }
            //是否是发表动态页面
            ViewBag.IsPost        = uid == -1;
            ViewBag.IsCurrentUser = false;
            uid = uid > -1 ? uid : currentUser.UserID;
            if (currentUser != null && uid == currentUser.UserID)
            {
                ViewBag.IsCurrentUser = true;
            }


            UserModel = GetUserModel(uid);
            string strAddress = RegionBll.GetRegionNameByRID(Common.Globals.SafeInt(UserModel.Address, 0));

            if (strAddress.Contains("北京北京"))
            {
                strAddress = strAddress.Replace("北京北京", "北京");
            }
            else if (strAddress.Contains("上海上海"))
            {
                strAddress = strAddress.Replace("上海上海", "上海");
            }
            else if (strAddress.Contains("重庆重庆"))
            {
                strAddress = strAddress.Replace("重庆重庆", "重庆");
            }
            else if (strAddress.Contains("天津天津"))
            {
                strAddress = strAddress.Replace("天津天津", "天津");
            }
            UserModel.Address = string.IsNullOrEmpty(UserModel.Address) ? "暂未设置" : strAddress;
            //是否是达人
            ViewBag.IsStar = starManage.IsStar(uid);
            //用户等级

            YSWL.MALL.BLL.SNS.GradeConfig manage = new YSWL.MALL.BLL.SNS.GradeConfig();
            ViewBag.Level = manage.GetUserLevel(UserModel.Points);

            return(PartialView("_UserInfo", UserModel));
        }
示例#2
0
        /// <summary>
        /// 个人中心右侧信息
        /// </summary>
        /// <returns></returns>
        public PartialViewResult SelfRight()
        {
            YSWL.MALL.BLL.Members.UsersExp        userBll   = new BLL.Members.UsersExp();
            YSWL.MALL.Model.Members.UsersExpModel userModel = new Model.Members.UsersExpModel();
            YSWL.MALL.BLL.SNS.Groups          groupBll      = new YSWL.MALL.BLL.SNS.Groups();
            YSWL.MALL.BLL.SNS.UserAlbums      bllAlbums     = new YSWL.MALL.BLL.SNS.UserAlbums();
            YSWL.MALL.ViewModel.SNS.SelfRight model         = new MALL.ViewModel.SNS.SelfRight();
            model.MyGroups = groupBll.GetUserJoinGroup(currentUser.UserID, 9);

            YSWL.MALL.BLL.Ms.Regions RegionBll  = new BLL.Ms.Regions();
            YSWL.MALL.BLL.SNS.Star   starManage = new YSWL.MALL.BLL.SNS.Star();


            model.UserInfo = GetUserModel(currentUser.UserID);
            string strAddress = RegionBll.GetRegionNameByRID(Common.Globals.SafeInt(model.UserInfo.Address, 0));

            if (strAddress.Contains("北京北京"))
            {
                strAddress = strAddress.Replace("北京北京", "北京");
            }
            else if (strAddress.Contains("上海上海"))
            {
                strAddress = strAddress.Replace("上海上海", "上海");
            }
            else if (strAddress.Contains("重庆重庆"))
            {
                strAddress = strAddress.Replace("重庆重庆", "重庆");
            }
            else if (strAddress.Contains("天津天津"))
            {
                strAddress = strAddress.Replace("天津天津", "天津");
            }
            model.UserInfo.Address = string.IsNullOrEmpty(model.UserInfo.Address) ? "暂未设置" : strAddress;
            YSWL.MALL.BLL.SNS.AlbumType AlbumTypeBLL = new YSWL.MALL.BLL.SNS.AlbumType();

            model.MyAlbum = bllAlbums.GetListByUserId(currentUser.UserID, UserAlbumDetailType);

            return(PartialView("_SelfRight", model));
        }