コード例 #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
ファイル: PartialController.cs プロジェクト: dmhai/ColoPay
        /// <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));
        }
コード例 #3
0
        public ActionResult Posts(string type, int?uid, string nickname)
        {
            #region 如果传过来的是用户的nickname,则对应相应的用户id
            YSWL.MALL.BLL.Members.Users UserBll = new BLL.Members.Users();
            int ID;
            if (!string.IsNullOrEmpty(nickname) && ((ID = UserBll.GetUserIdByNickName(nickname)) > 0))
            {
                uid = ID;
            }
            #endregion
            //#region 如果是当前的用户
            //if (currentUser != null && currentUser.UserID == uid)
            //{
            //    return RedirectToAction("Posts", "Profile");
            //}
            //#endregion
            ViewBag.IsCurrentUser = uid.HasValue ? false : (currentUser != null ? true : false);
            #region 进行对用户的id重写复制
            if (!LoadUserInfo(uid == null ? 0 : uid.Value) || !this.Activity)
            {
                if (MvcApplication.MainAreaRoute == AreaRoute.SNS)
                {
                    //SNS 主域
                    return(Redirect("/Error/UserError"));
                }
                return(Redirect("/SNS/Error/UserError"));
            }
            #endregion
            YSWL.MALL.BLL.SNS.AlbumType        AlbumTypeBLL = new YSWL.MALL.BLL.SNS.AlbumType();
            YSWL.MALL.ViewModel.SNS.PostsPage  postPage     = new MALL.ViewModel.SNS.PostsPage();
            YSWL.MALL.BLL.Members.PointsDetail pointBll     = new BLL.Members.PointsDetail();
            postPage.Type = type;
            #region 初始化查询动态的类型
            if (!string.IsNullOrEmpty(type))
            {
                switch (type)
                {
                case "user":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.User;
                    break;

                case "all":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.All;
                    break;

                case "referme":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.ReferMe;
                    break;

                case "eachother":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.EachOther;
                    break;

                case "photo":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.Photo;
                    break;

                case "product":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.Product;
                    break;

                case "video":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.Video;
                    break;

                case "fellow":
                    DefaultPostType = Model.SNS.EnumHelper.PostType.Fellow;
                    break;
                }
            }
            else
            {
                if (this.IsCurrentUser == true)
                {
                    postPage.Type   = "fellow";
                    DefaultPostType = Model.SNS.EnumHelper.PostType.Fellow;
                }
                else
                {
                    postPage.Type   = "user";
                    DefaultPostType = Model.SNS.EnumHelper.PostType.User;
                }
            }
            #endregion
            postPage.PageSize      = _PostPageSize;
            postPage.DataCount     = PostsBll.GetCountByPostType(UserID, DefaultPostType, IncludeProduct);
            postPage.AlbumTypeList = AlbumTypeBLL.GetModelListByCache(Model.SNS.EnumHelper.Status.Enabled);
            postPage.UserID        = UserID;
            postPage.Setting       = YSWL.MALL.BLL.SNS.ConfigSystem.GetPostSetByCache();
            ViewBag.CurrentUserID  = UserID;
            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("Posts", postPage));
        }