示例#1
0
        public ActionResult Albums(int?uid, string IsFav)
        {
            if (!LoadUserInfo(uid == null ? 0 : uid.Value))
            {
                if (MvcApplication.MainAreaRoute == AreaRoute.SNS)
                {
                    //SNS 主域
                    return(Redirect(ViewBag.BasePath + "Account/Login"));
                }
                return(Redirect("/SNS/Account/Login"));
            }
            YSWL.MALL.BLL.SNS.AlbumType          AlbumTypeBLL = new YSWL.MALL.BLL.SNS.AlbumType();
            YSWL.MALL.BLL.SNS.UserAlbums         bllAlbums    = new YSWL.MALL.BLL.SNS.UserAlbums();
            List <MALL.ViewModel.SNS.AlbumIndex> models       = new List <MALL.ViewModel.SNS.AlbumIndex>();

            if (!string.IsNullOrEmpty(IsFav))
            {
                models        = bllAlbums.GetUserFavAlbum(this.UserID);
                ViewBag.IsFav = true;
            }
            else
            {
                models = bllAlbums.GetListByUserId(this.UserID, UserAlbumDetailType);
            }
            #region 临时方案,
            ViewBag.AlbumTypeList = AlbumTypeBLL.GetModelListByCache(Model.SNS.EnumHelper.Status.Enabled);
            #endregion
            ViewBag.IsCurrentUser = this.IsCurrentUser;
            ViewBag.NickName      = this.NickName;
            #region SEO 优化设置
            IPageSetting pageSetting = PageSetting.GetPageSetting("Base", ApplicationKeyType.SNS);
            ViewBag.Keywords    = pageSetting.Keywords;
            ViewBag.Description = pageSetting.Description;
            if (ViewBag.IsCurrentUser == true)
            {
                ViewBag.Title = "我的专辑 - " + pageSetting.Title;
            }
            else
            {
                ViewBag.Title = this.NickName + "的专辑 - " + pageSetting.Title;
            }
            #endregion
            return(View(CurrentThemeViewPath + "/UserProfile/Albums.cshtml", models));
        }
示例#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));
        }