public ActionResult PhotoListWaterfall(int albumID, int startIndex)
 {
     PhotoList model = new PhotoList();
     ((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.UserAlbumDetail detail = new Maticsoft.BLL.SNS.UserAlbumDetail();
     if (detail.GetRecordCount4AlbumImgByAlbumID(albumID, base.UserAlbumDetailType) < 1)
     {
         return new EmptyResult();
     }
     model.PhotoListWaterfall = detail.GetAlbumImgListByPage(albumID, startIndex, endIndex, base.UserAlbumDetailType);
     model.AlbumModel = this.bllAlbums.GetModel(albumID);
     if (((base.currentUser != null) && (model.AlbumModel != null)) && (model.AlbumModel.CreatedUserID == base.currentUser.UserID))
     {
         ((dynamic) base.ViewBag).IsCurrentUser = true;
     }
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
     foreach (PostContent content in model.PhotoListWaterfall)
     {
         if (valueByCache != "true")
         {
             content.StaticUrl = (string) (((((((dynamic) base.ViewBag).BasePath + ((content.Type == 1) ? "Product/" : "Photo/")) + "Detail/") + content.TargetId) + "?AlbumId=") + albumID);
             continue;
         }
         string str2 = "";
         if (content.Type == 1)
         {
             Maticsoft.Model.SNS.Products modelByCache = this.productBll.GetModelByCache(content.TargetId);
             if ((modelByCache == null) || string.IsNullOrWhiteSpace(modelByCache.StaticUrl))
             {
             }
             str2 = (<PhotoListWaterfall>o__SiteContainer27.<>p__Site34 != null) ? modelByCache.StaticUrl : ((string) ((((dynamic) <PhotoListWaterfall>o__SiteContainer27.<>p__Site34.Target(<PhotoListWaterfall>o__SiteContainer27.<>p__Site34, base.ViewBag)) + "Product/Detail/") + content.TargetId));
         }
         else
         {
             Maticsoft.Model.SNS.Photos photos = this.photoBll.GetModelByCache((int) content.TargetId);
             if ((photos == null) || string.IsNullOrWhiteSpace(photos.StaticUrl))
             {
             }
             str2 = (<PhotoListWaterfall>o__SiteContainer27.<>p__Site3a != null) ? photos.StaticUrl : ((string) ((((((dynamic) <PhotoListWaterfall>o__SiteContainer27.<>p__Site3a.Target(<PhotoListWaterfall>o__SiteContainer27.<>p__Site3a, base.ViewBag)) + "Photo/Detail/") + content.TargetId) + "?AlbumId=") + albumID));
         }
         content.StaticUrl = str2;
     }
     return base.View(base.CurrentThemeViewPath + "/Photo/PhotoListWaterfall.cshtml", model);
 }
 public ActionResult Details(int AlbumID, int? pageIndex)
 {
     PhotoList model = new PhotoList {
         AlbumModel = this.bllAlbums.GetModel(AlbumID)
     };
     if ((model.AlbumModel == null) || !this.bllAlbums.UpdatePvCount(AlbumID))
     {
         return base.RedirectToAction("Index");
     }
     model.UserModel = this.blluser.GetUsersExpModelByCache(model.AlbumModel.CreatedUserID);
     if (model.UserModel == null)
     {
         return base.RedirectToAction("Index");
     }
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     IPageSetting pageSetting = PageSetting.GetPageSetting("AblumDetail", ApplicationKeyType.SNS);
     pageSetting.Replace(new string[][] { new string[] { "{cname}", model.AlbumModel.AlbumName }, new string[] { "{ctname}", model.UserModel.NickName }, new string[] { "{cdes}", model.AlbumModel.Description } });
     ((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 num4 = 0;
     Maticsoft.BLL.SNS.UserAlbumDetail detail = new Maticsoft.BLL.SNS.UserAlbumDetail();
     num4 = detail.GetRecordCount4AlbumImgByAlbumID(AlbumID, base.UserAlbumDetailType);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num5 = pageIndex.Value * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > num4) ? num4 : num5;
     model.AlbumsList = this.bllAlbums.GetUserAlbumsByUserId(10, (model.UserModel != null) ? model.UserModel.UserID : 0);
     if (num4 >= 1)
     {
         int? nullable = pageIndex;
         model.PhotoPagedList = detail.GetAlbumImgListByPage(AlbumID, startIndex, endIndex, base.UserAlbumDetailType).ToPagedList<PostContent>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(num4));
         string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
         foreach (PostContent content in model.PhotoPagedList)
         {
             if (valueByCache != "true")
             {
                 content.StaticUrl = (string) (((((((dynamic) base.ViewBag).BasePath + ((content.Type == 1) ? "Product/" : "Photo/")) + "Detail/") + content.TargetId) + "?AlbumId=") + AlbumID);
                 continue;
             }
             string str2 = "";
             if (content.Type == 1)
             {
                 Maticsoft.Model.SNS.Products modelByCache = this.productBll.GetModelByCache(content.TargetId);
                 if ((modelByCache == null) || string.IsNullOrWhiteSpace(modelByCache.StaticUrl))
                 {
                 }
                 str2 = (<Details>o__SiteContainere.<>p__Site1f != null) ? modelByCache.StaticUrl : ((string) ((((dynamic) <Details>o__SiteContainere.<>p__Site1f.Target(<Details>o__SiteContainere.<>p__Site1f, base.ViewBag)) + "Product/Detail/") + content.TargetId));
             }
             else
             {
                 Maticsoft.Model.SNS.Photos photos = this.photoBll.GetModelByCache((int) content.TargetId);
                 if ((photos == null) || string.IsNullOrWhiteSpace(photos.StaticUrl))
                 {
                 }
                 str2 = (<Details>o__SiteContainere.<>p__Site25 != null) ? photos.StaticUrl : ((string) ((((((dynamic) <Details>o__SiteContainere.<>p__Site25.Target(<Details>o__SiteContainere.<>p__Site25, base.ViewBag)) + "Photo/Detail/") + content.TargetId) + "?AlbumId=") + AlbumID));
             }
             content.StaticUrl = str2;
         }
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView("PhotoList", model);
         }
         model.CommentPageSize = this._commentPageSize;
         model.CommentCount = new Maticsoft.BLL.SNS.Comments().GetCommentCount(3, AlbumID);
         if (((base.currentUser != null) && (model.AlbumModel != null)) && (model.AlbumModel.CreatedUserID == base.currentUser.UserID))
         {
             ((dynamic) base.ViewBag).IsCurrentUser = true;
         }
     }
     return base.View(model);
 }
 public ActionResult AjaxAddToAlbum(FormCollection Fm)
 {
     Maticsoft.Model.SNS.UserAlbumDetail model = new Maticsoft.Model.SNS.UserAlbumDetail();
     Maticsoft.BLL.SNS.UserAlbumDetail detail2 = new Maticsoft.BLL.SNS.UserAlbumDetail();
     int targetID = Globals.SafeInt(Fm["TargetId"], 0);
     int type = (Fm["Type"] == "Product") ? 1 : 0;
     int albumID = Globals.SafeInt(Fm["AlbumId"], 0);
     if (albumID > 0)
     {
         string str = Fm["Des"];
         model.TargetID = targetID;
         model.Type = type;
         model.Description = str;
         model.AlbumUserId = base.currentUser.UserID;
         model.AlbumID = albumID;
         if (detail2.Exists(albumID, targetID, type))
         {
             return base.Content("Repeat");
         }
         if (detail2.AddEx(model))
         {
             return base.Content("Ok");
         }
     }
     return base.Content("No");
 }
 public ActionResult AjaxDelAlbumDetail(int TargetId, string Type, int AlbumId)
 {
     Maticsoft.BLL.SNS.UserAlbumDetail detail = new Maticsoft.BLL.SNS.UserAlbumDetail();
     if (detail.DeleteEx(AlbumId, TargetId, (Type == "Product") ? 1 : 0))
     {
         return base.Content("True");
     }
     return base.Content("False");
 }
Exemple #5
0
 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 "";
 }