public ActionResult Albums(int pageIndex = 1) { ((dynamic) base.ViewBag).Title = "专辑搜索"; string inputString = string.IsNullOrWhiteSpace(base.Request.Params["keyword"]) ? "" : base.Server.UrlDecode(base.Request.Params["keyword"]); string orderby = string.IsNullOrWhiteSpace(base.Request.Params["type"]) ? "hot" : base.Request.Params["type"]; inputString = InjectionFilter.Filter(inputString); this.LogKeyWord(inputString); int pageSize = this._baseAlbumPageSize + this._waterfallAlbumSize; ((dynamic) base.ViewBag).BasePageSize = this._baseAlbumPageSize; ((dynamic) base.ViewBag).sequence = orderby; int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0; int endIndex = (pageIndex > 1) ? ((startIndex + this._baseAlbumPageSize) - 1) : this._baseAlbumPageSize; int countByKeyWard = 0; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); countByKeyWard = albums.GetCountByKeyWard(inputString); ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex; int num5 = pageIndex * pageSize; ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > countByKeyWard) ? countByKeyWard : num5; if (countByKeyWard < 1) { return base.View("Album"); } PagedList<AlbumIndex> model = albums.GetListByKeyWord(inputString, orderby, startIndex, endIndex, base.UserAlbumDetailType).ToPagedList<AlbumIndex>(pageIndex, pageSize, new int?(countByKeyWard)); if (base.Request.IsAjaxRequest()) { return this.PartialView("AlbumList", model); } return base.View("Album", model); }
public ActionResult AjaxAddAlbum(FormCollection Fm) { if (base.currentUser == null) { return base.Content("NoLogin"); } if (base.CurrentUser.UserType == "AA") { return base.Content("AA"); } string str = Fm["AlbumName"]; int typeId = Globals.SafeInt(Fm["Type"], 0); Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); Maticsoft.Model.SNS.UserAlbums model = new Maticsoft.Model.SNS.UserAlbums { AlbumName = str, CreatedDate = DateTime.Now, CreatedNickName = base.currentUser.NickName, CreatedUserID = base.currentUser.UserID }; if ((model.AlbumID = albums.AddEx(model, typeId)) > 0) { Maticsoft.BLL.SNS.UserAlbumsType type = new Maticsoft.BLL.SNS.UserAlbumsType(); Maticsoft.Model.SNS.UserAlbumsType type2 = new Maticsoft.Model.SNS.UserAlbumsType { AlbumsID = model.AlbumID, AlbumsUserID = new int?(model.CreatedUserID), TypeID = typeId }; if (type.Add(type2)) { return base.Content(model.AlbumID.ToString()); } } return base.Content("No"); }
public ActionResult Register(RegisterModel model) { ((dynamic) base.ViewBag).Title = "注册"; if (Maticsoft.BLL.SysManage.ConfigSystem.GetBoolValueByCache("System_Close_Register")) { return base.RedirectToAction("TurnOff", "Error"); } if (base.ModelState.IsValid) { int num = new User { UserName = model.Email, NickName = model.NickName, Password = AccountsPrincipal.EncryptPassword(model.Password), Email = model.Email, Activity = true, UserType = "UU", Style = 1, User_dateCreate = DateTime.Now, User_cLang = "zh-CN" }.Create(); if (num != -100) { UsersExp exp = new UsersExp { UserID = num, BirthdayVisible = 0, BirthdayIndexVisible = false, Gravatar = string.Format("/{0}/User/Gravatar/{1}", MvcApplication.UploadFolder, num), ConstellationVisible = 0, ConstellationIndexVisible = false, NativePlaceVisible = 0, NativePlaceIndexVisible = false, RegionId = 0, AddressVisible = 0, AddressIndexVisible = false, BodilyFormVisible = 0, BodilyFormIndexVisible = false, BloodTypeVisible = 0, BloodTypeIndexVisible = false, MarriagedVisible = 0, MarriagedIndexVisible = false, PersonalStatusVisible = 0, PersonalStatusIndexVisible = false, LastAccessIP = "", LastAccessTime = new DateTime?(DateTime.Now), LastLoginTime = DateTime.Now, LastPostTime = new DateTime?(DateTime.Now) }; if (!exp.AddUsersExp(exp)) { this.userManage.Delete(num); this.userExpManage.DeleteUsersExp(num); base.ModelState.AddModelError("Message", "注册失败!"); return base.View(model); } FormsAuthentication.SetAuthCookie(model.Email, false); new Maticsoft.BLL.Members.PointsDetail().AddPoints("Register", num, "注册成功", ""); Maticsoft.Model.SNS.UserAlbums albums = new Maticsoft.Model.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserAlbums albums2 = new Maticsoft.BLL.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserShip ship = new Maticsoft.BLL.SNS.UserShip(); albums.AlbumName = "默认专辑"; albums.CreatedDate = DateTime.Now; albums.CreatedNickName = model.NickName; albums.CreatedUserID = num; albums2.AddEx(albums, 1); string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("DefaultGravatar"); valueByCache = string.IsNullOrEmpty(valueByCache) ? "/Upload/User/Gravatar/Default.jpg" : valueByCache; string str2 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("TargetGravatarFile"); str2 = string.IsNullOrEmpty(str2) ? "/Upload/User/Gravatar/" : str2; string str3 = base.ControllerContext.HttpContext.Server.MapPath("/"); if (File.Exists(str3 + valueByCache)) { File.Copy(str3 + valueByCache, string.Concat(new object[] { str3, str2, num, ".jpg" }), true); } ship.GiveUserFellow(num); return this.Redirect("/UserCenter/Personal"); } base.ModelState.AddModelError("Message", ErrorCodeToString(MembershipCreateStatus.DuplicateUserName)); } return base.View(model); }
public ActionResult AlbumEdit(FormCollection fm) { ((dynamic) base.ViewBag).Title = "编辑专辑"; Maticsoft.Model.SNS.UserAlbums model = new Maticsoft.Model.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserAlbums albums2 = new Maticsoft.BLL.SNS.UserAlbums(); model.AlbumName = fm["AlbumName"]; model.Description = fm["Description"]; model.AlbumID = Globals.SafeInt(fm["AlbumID"], 0); if (!albums2.UpdateEx(model)) { return base.RedirectToAction("AlbumEdit", new { AlbumId = model.AlbumID }); } int num = Globals.SafeInt(fm["TypeId"], 0); Maticsoft.BLL.SNS.UserAlbumsType type = new Maticsoft.BLL.SNS.UserAlbumsType(); Maticsoft.Model.SNS.UserAlbumsType modelByUserId = type.GetModelByUserId(model.AlbumID, base.currentUser.UserID); if (modelByUserId == null) { modelByUserId = new Maticsoft.Model.SNS.UserAlbumsType { TypeID = num, AlbumsID = model.AlbumID, AlbumsUserID = new int?(base.currentUser.UserID) }; type.AddEx(modelByUserId); } else { modelByUserId.TypeID = num; type.UpdateType(modelByUserId); } return base.RedirectToAction("Albums"); }
public ActionResult AlbumEdit(int AlbumId) { ((dynamic) base.ViewBag).Title = "编辑专辑"; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserAlbumsType type = new Maticsoft.BLL.SNS.UserAlbumsType(); Maticsoft.BLL.SNS.AlbumType type2 = new Maticsoft.BLL.SNS.AlbumType(); Maticsoft.Model.SNS.UserAlbums model = albums.GetModel(AlbumId); List<Maticsoft.Model.SNS.AlbumType> modelList = type2.GetModelList("Status=1"); List<SelectListItem> list2 = new List<SelectListItem>(); SelectListItem item2 = new SelectListItem { Value = "0", Text = "请选择" }; list2.Add(item2); if ((modelList != null) && (modelList.Count > 0)) { foreach (Maticsoft.Model.SNS.AlbumType type3 in modelList) { SelectListItem item = new SelectListItem { Value = type3.ID.ToString(), Text = type3.TypeName }; list2.Add(item); } ((dynamic) base.ViewBag).TypeList = list2; } if (model == null) { return new EmptyResult(); } Maticsoft.Model.SNS.UserAlbumsType modelByUserId = type.GetModelByUserId(model.AlbumID, base.currentUser.UserID); model.TypeId = 0; if (modelByUserId != null) { model.TypeId = modelByUserId.TypeID; } return base.View(model); }
public ActionResult AjaxGetUploadPhotoResult() { List<Maticsoft.Model.SNS.UserAlbums> userAblumsByUserID = new Maticsoft.BLL.SNS.UserAlbums().GetUserAblumsByUserID(base.currentUser.UserID); PhotoAlbum model = new PhotoAlbum(); List<Maticsoft.Model.SNS.Categories> allList = Maticsoft.BLL.SNS.Categories.GetAllList(1); model.UserAlbums = userAblumsByUserID; model.PhotoCateList = (from c in allList where c.Depth == 1 select c).ToList<Maticsoft.Model.SNS.Categories>(); ((dynamic) base.ViewBag).ImageUrl = base.Request["image"]; ((dynamic) base.ViewBag).ImageData = base.Request["data"]; return this.PartialView(base.CurrentThemeViewPath + "/Partial/_UploadPhotoResultLayOut.cshtml", model); }
public ActionResult AjaxGetMyMyAblum() { List<Maticsoft.Model.SNS.UserAlbums> userAblumsByUserID = new Maticsoft.BLL.SNS.UserAlbums().GetUserAblumsByUserID(base.currentUser.UserID); return base.Content(base.jss.Serialize(userAblumsByUserID)); }
public PartialViewResult AlbumPart(int Top = 4) { List<AlbumIndex> model = new Maticsoft.BLL.SNS.UserAlbums().GetListForIndex(0, Top, 1, base.UserAlbumDetailType); return this.PartialView("AlbumPart", model); }
public ActionResult TypeIndex(int AlbumType, int? pageIndex) { Maticsoft.Model.SNS.AlbumType model = new Maticsoft.BLL.SNS.AlbumType().GetModel(AlbumType); if (model == null) { return base.RedirectToAction("Index"); } ((dynamic) base.ViewBag).TypeName = model.TypeName; int pageSize = this._basePageSize + this._waterfallSize; ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; IPageSetting pageSetting = PageSetting.GetPageSetting("AblumList", ApplicationKeyType.SNS); pageSetting.Replace(new string[][] { new string[] { "{cname}", model.TypeName } }); ((dynamic) base.ViewBag).Title = pageSetting.Title; ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords; ((dynamic) base.ViewBag).Description = pageSetting.Description; pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1); int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0; int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize; int recordCount = 0; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); recordCount = albums.GetRecordCount(AlbumType); ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex; int num5 = pageIndex.Value * pageSize; ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > recordCount) ? recordCount : num5; if (recordCount < 1) { return base.View(); } int? nullable = pageIndex; PagedList<AlbumIndex> list = albums.GetListForPage(AlbumType, "", startIndex, endIndex, base.UserAlbumDetailType).ToPagedList<AlbumIndex>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(recordCount)); if (base.Request.IsAjaxRequest()) { return this.PartialView("AlbumList", list); } return base.View(list); }
public ActionResult WaterfallAlbumListData(string keyword, string type, int startIndex) { keyword = InjectionFilter.Filter(keyword); ((dynamic) base.ViewBag).BasePageSize = this._baseAlbumPageSize; startIndex = (startIndex > 1) ? (startIndex + 1) : 0; int endIndex = (startIndex > 1) ? ((startIndex + this._waterfallDetailCount) - 1) : this._waterfallDetailCount; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); if (albums.GetCountByKeyWard(keyword) < 1) { return new EmptyResult(); } List<AlbumIndex> model = albums.GetListByKeyWord(keyword, type, startIndex, endIndex, base.UserAlbumDetailType); return base.View("AlbumListWaterfall", model); }
public PartialViewResult SelfRight() { new UsersExp(); new UsersExpModel(); Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups(); Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); Maticsoft.ViewModel.SNS.SelfRight model = new Maticsoft.ViewModel.SNS.SelfRight { MyGroups = groups.GetUserJoinGroup(base.currentUser.UserID, 9) }; Maticsoft.BLL.Ms.Regions regions = new Maticsoft.BLL.Ms.Regions(); new Maticsoft.BLL.SNS.Star(); model.UserInfo = this.GetUserModel(base.currentUser.UserID); string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(model.UserInfo.Address, 0)); if (regionNameByRID.Contains("北京北京")) { regionNameByRID = regionNameByRID.Replace("北京北京", "北京"); } else if (regionNameByRID.Contains("上海上海")) { regionNameByRID = regionNameByRID.Replace("上海上海", "上海"); } else if (regionNameByRID.Contains("重庆重庆")) { regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆"); } else if (regionNameByRID.Contains("天津天津")) { regionNameByRID = regionNameByRID.Replace("天津天津", "天津"); } model.UserInfo.Address = string.IsNullOrEmpty(model.UserInfo.Address) ? "暂未设置" : regionNameByRID; new Maticsoft.BLL.SNS.AlbumType(); model.MyAlbum = albums.GetListByUserId(base.currentUser.UserID, base.UserAlbumDetailType); return this.PartialView("_SelfRight", model); }
private ActionResult CallbackUserInfo(MediaType mediaType, AccessGrant accessGrant, string userIdOAuth, string nickNameOAuth, string emailOAuth) { if (base.CurrentUser != null) { Maticsoft.BLL.Members.UserBind bind = new Maticsoft.BLL.Members.UserBind(); Maticsoft.Model.Members.UserBind bind2 = new Maticsoft.Model.Members.UserBind { MediaID = (int) mediaType, MediaNickName = nickNameOAuth, MediaUserID = userIdOAuth.ToString(), TokenAccess = accessGrant.AccessToken, UserId = (base.CurrentUser.UserType == "AA") ? -1 : base.CurrentUser.UserID, TokenAccess = accessGrant.AccessToken, TokenExpireTime = accessGrant.ExpireTime, Comment = true, iHome = true, GroupTopic = true }; if (!bind.AddEx(bind2)) { return this.Redirect("/"); } if (base.currentUser.UserType == "AA") { return this.Redirect("/Admin/Accounts/UserBind.aspx"); } return this.RedirectToUserBind(); } string userName = string.Format("{0}_{1}", mediaType.ToString(), userIdOAuth); string password = userName + this.SinaSercet; Maticsoft.BLL.Members.Users users = new Maticsoft.BLL.Members.Users(); User user = new User(); if (user.HasUserByUserName(userName)) { User user2 = new User(userName); FormsAuthentication.SetAuthCookie(userName, false); base.Session[Globals.SESSIONKEY_USER] = user2; base.Session["Style"] = user2.Style; new Maticsoft.BLL.Members.PointsDetail().AddPoints("Login", user2.UserID, "登录操作", ""); if (base.Session["returnPage"] != null) { string url = base.Session["returnPage"].ToString(); base.Session["returnPage"] = null; return this.Redirect(url); } return this.RedirectToHome(); } User user3 = new User(); string nickName = nickNameOAuth; while (user3.HasUserByNickName(nickName)) { nickName = nickNameOAuth + "_" + Globals.GenRandomCodeFor6(); } user.UserName = userName; user.Email = emailOAuth; user.Password = AccountsPrincipal.EncryptPassword(password); user.Activity = true; user.UserType = "UU"; user.NickName = nickName; user.Style = 1; user.User_dateCreate = DateTime.Now; user.User_cLang = "zh-CN"; int num = user.Create(); if (num <= 0) { return this.Redirect("/"); } UsersExp model = new UsersExp { UserID = num, Email = emailOAuth, Gravatar = string.Format("/{0}/User/Gravatar/{1}", Maticsoft.Components.MvcApplication.UploadFolder, num), BirthdayVisible = 0, BirthdayIndexVisible = false, ConstellationVisible = 0, ConstellationIndexVisible = false, NativePlaceVisible = 0, NativePlaceIndexVisible = false, RegionId = 0, AddressVisible = 0, AddressIndexVisible = false, BodilyFormVisible = 0, BodilyFormIndexVisible = false, BloodTypeVisible = 0, BloodTypeIndexVisible = false, MarriagedVisible = 0, MarriagedIndexVisible = false, PersonalStatusVisible = 0, PersonalStatusIndexVisible = false, LastAccessIP = "", LastAccessTime = new DateTime?(DateTime.Now), LastLoginTime = DateTime.Now, LastPostTime = new DateTime?(DateTime.Now) }; if (!model.AddUsersExp(model)) { users.Delete(num); new UsersExp().DeleteUsersExp(num); return this.Redirect("/"); } User user4 = new User(userName); FormsAuthentication.SetAuthCookie(userName, false); base.Session[Globals.SESSIONKEY_USER] = user4; base.Session["Style"] = user4.Style; if (Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNS_Register_IsBind") == "1") { Maticsoft.BLL.Members.UserBind bind3 = new Maticsoft.BLL.Members.UserBind(); Maticsoft.Model.Members.UserBind bind4 = new Maticsoft.Model.Members.UserBind { MediaID = (int) mediaType, MediaNickName = nickNameOAuth, MediaUserID = userIdOAuth, TokenAccess = accessGrant.AccessToken, TokenExpireTime = accessGrant.ExpireTime, UserId = num, TokenAccess = accessGrant.AccessToken, TokenExpireTime = accessGrant.ExpireTime, Comment = true, iHome = true, GroupTopic = true }; if (!bind3.AddEx(bind4)) { return this.Redirect("/"); } } string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("DefaultGravatar"); valueByCache = string.IsNullOrEmpty(valueByCache) ? "/Upload/User/Gravatar/Default.jpg" : valueByCache; string str7 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("TargetGravatarFile"); str7 = string.IsNullOrEmpty(str7) ? "/Upload/User/Gravatar/" : str7; string str8 = base.ControllerContext.HttpContext.Server.MapPath("/"); if (File.Exists(str8 + valueByCache)) { File.Copy(str8 + valueByCache, string.Concat(new object[] { str8, str7, user4.UserID, ".jpg" }), true); } new Maticsoft.BLL.Members.PointsDetail().AddPoints("Register", num, "注册成功", ""); Maticsoft.Model.SNS.UserAlbums albums = new Maticsoft.Model.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserAlbums albums2 = new Maticsoft.BLL.SNS.UserAlbums(); Maticsoft.BLL.SNS.UserShip ship = new Maticsoft.BLL.SNS.UserShip(); albums.AlbumName = "默认专辑"; albums.CreatedDate = DateTime.Now; albums.CreatedNickName = user4.NickName; albums.CreatedUserID = user4.UserID; albums2.AddEx(albums, 1); ship.GiveUserFellow(user4.UserID); return this.RedirectToHome(); }
protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e) { int iD = (int) this.gridView.DataKeys[e.RowIndex].Value; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); List<string> list = this.PhotoPhysicalInfo(iD); List<string> list2 = this.ProductsPhysicalInfo(iD); if (albums.DeleteAblumAction(iD)) { LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "删除专辑(id=" + iD + ")成功", this); if ((list != null) && (list.Count > 0)) { this.DeletePhysicalFile(list); } if ((list2 != null) && (list2.Count > 0)) { this.DeletePhysicalFile(list2); } MessageBox.ShowSuccessTip(this, Site.TooltipDelOK); this.gridView.OnBind(); } else { LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "删除专辑(id=" + iD + ")失败", this); MessageBox.ShowFailTip(this, Site.TooltipDelError); } }
public ActionResult Albums(int? uid, string IsFav) { if (!this.LoadUserInfo(!uid.HasValue ? 0 : uid.Value)) { if (Maticsoft.Components.MvcApplication.MainAreaRoute == AreaRoute.SNS) { return this.Redirect("/Account/Login"); } return this.Redirect("/SNS/Account/Login"); } Maticsoft.BLL.SNS.AlbumType type = new Maticsoft.BLL.SNS.AlbumType(); Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); List<AlbumIndex> model = new List<AlbumIndex>(); if (!string.IsNullOrEmpty(IsFav)) { model = albums.GetUserFavAlbum(this.UserID, -1); ((dynamic) base.ViewBag).IsFav = true; } else { model = albums.GetListByUserId(this.UserID, base.UserAlbumDetailType); } ((dynamic) base.ViewBag).AlbumTypeList = type.GetModelListByCache(Maticsoft.Model.SNS.EnumHelper.Status.Enabled); ((dynamic) base.ViewBag).IsCurrentUser = this.IsCurrentUser; ((dynamic) base.ViewBag).NickName = this.NickName; IPageSetting pageSetting = PageSetting.GetPageSetting("Base", ApplicationKeyType.SNS); ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords; ((dynamic) base.ViewBag).Description = pageSetting.Description; if (<Albums>o__SiteContainer48.<>p__Site4f == null) {
public PartialViewResult AlbumPart(int AlbumType) { List<AlbumIndex> model = new Maticsoft.BLL.SNS.UserAlbums().GetListForIndex(AlbumType, 8, 2, base.UserAlbumDetailType); return base.PartialView(model); }
public ActionResult Create(FormCollection collection) { ((dynamic) base.ViewBag).Title = "创建新专辑"; try { if (!base.HttpContext.User.Identity.IsAuthenticated) { return base.RedirectToAction("Login", "Account"); } if (base.currentUser.UserType == "AA") { return base.View(); } Maticsoft.Model.SNS.UserAlbums model = new Maticsoft.Model.SNS.UserAlbums { AlbumName = collection["AlbumName"], Description = collection["Description"], CreatedNickName = base.CurrentUser.NickName, CreatedUserID = base.CurrentUser.UserID }; int typeId = Globals.SafeInt(collection["TypeRadio"], 0); int num2 = new Maticsoft.BLL.SNS.UserAlbums().AddEx(model, typeId); if (num2 > 0) { Maticsoft.BLL.SNS.UserAlbumsType type = new Maticsoft.BLL.SNS.UserAlbumsType(); Maticsoft.Model.SNS.UserAlbumsType type2 = new Maticsoft.Model.SNS.UserAlbumsType { AlbumsID = num2, AlbumsUserID = new int?(model.CreatedUserID), TypeID = typeId }; type.Add(type2); } return base.RedirectToAction("Albums", "Profile"); } catch { return base.View(); } }
public ActionResult AjaxDelAlbum(int AlbumId) { Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); if (albums.DeleteEx(AlbumId, base.currentUser.UserID)) { return base.Content("True"); } return base.Content("False"); }
public ActionResult WaterfallAlbumListData(int AlbumType, int startIndex) { ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; startIndex = (startIndex > 1) ? (startIndex + 1) : 0; int endIndex = (startIndex > 1) ? ((startIndex + this._waterfallDetailCount) - 1) : this._waterfallDetailCount; Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); if (albums.GetRecordCount(AlbumType) < 1) { return new EmptyResult(); } List<AlbumIndex> model = albums.GetListForPage(AlbumType, "", startIndex, endIndex, base.UserAlbumDetailType); return base.View("AlbumListWaterfall", model); }
public static string GetPhotoUrl(Maticsoft.Model.SNS.Photos PhotosInfo) { if (!string.IsNullOrWhiteSpace(PhotosInfo.StaticUrl)) { return PhotosInfo.StaticUrl; } Maticsoft.BLL.SNS.UserAlbumDetail detail = new Maticsoft.BLL.SNS.UserAlbumDetail(); Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums(); string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("PhotoStaticRoot"); valueByCache = (valueByCache.LastIndexOf("/") > -1) ? valueByCache : (valueByCache + "/"); List<Maticsoft.Model.SNS.UserAlbumDetail> modelList = detail.GetModelList("Type=0 and TargetID=" + PhotosInfo.PhotoID); if ((modelList != null) && (modelList.Count > 0)) { Maticsoft.Model.SNS.UserAlbums modelByCache = albums.GetModelByCache(modelList.FirstOrDefault<Maticsoft.Model.SNS.UserAlbumDetail>().AlbumID); if (modelByCache != null) { return string.Concat(new object[] { valueByCache, PinyinHelper.GetPinyin(modelByCache.AlbumName), "/", PhotosInfo.PhotoID, ".html" }).Replace("--", "-").ToLower(); } } return ""; }