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)); }
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)); }