Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public ActionResult Index(string orderby, int? pageIndex)
 {
     int? nullable;
     PhotoList model = new PhotoList();
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     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;
     int intValueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetIntValueByCache("SNS_ShareGood_Category");
     if (intValueByCache == -1)
     {
         intValueByCache = 0xa7;
     }
     recordCount = this.bllPhotos.GetRecordCount("Status=1 and  CategoryId=" + intValueByCache);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num6 = pageIndex.Value * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num6 > recordCount) ? recordCount : num6;
     IPageSetting pageSetting = PageSetting.GetPageSetting("PhotoList", ApplicationKeyType.SNS);
     ((dynamic) base.ViewBag).Title = pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     if (recordCount < 1)
     {
         return base.View(model);
     }
     string str3 = orderby;
     if (str3 != null)
     {
         if (!(str3 == "hot"))
         {
             if (str3 == "popular")
             {
                 orderby = "FavouriteCount desc";
                 goto Label_0379;
             }
         }
         else
         {
             orderby = "CommentCount desc";
             goto Label_0379;
         }
     }
     orderby = "";
 Label_0379:
     nullable = pageIndex;
     model.PhotoPagedList = this.bllPhotos.GetCachePhotoListByPage(intValueByCache, orderby, startIndex, endIndex).ToPagedList<PostContent>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(recordCount));
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView("ShareGoodsList", model);
     }
     model.ZuiInList = this.bllPhotos.GetZuiInListByCache(intValueByCache, 3);
     model.PhotoCategory = this.bllCategory.GetPhotoMenuCategoryList();
     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);
             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 = (<Index>o__SiteContainer0.<>p__Sitef != null) ? modelByCache.StaticUrl : ((string) ((((dynamic) <Index>o__SiteContainer0.<>p__Sitef.Target(<Index>o__SiteContainer0.<>p__Sitef, base.ViewBag)) + "Product/Detail/") + content.TargetId));
         }
         else
         {
             Maticsoft.Model.SNS.Photos photos = this.bllPhotos.GetModelByCache((int) content.TargetId);
             if ((photos == null) || string.IsNullOrWhiteSpace(photos.StaticUrl))
             {
             }
             str2 = (<Index>o__SiteContainer0.<>p__Site13 != null) ? photos.StaticUrl : ((string) ((((dynamic) <Index>o__SiteContainer0.<>p__Site13.Target(<Index>o__SiteContainer0.<>p__Site13, base.ViewBag)) + "Photo/Detail/") + content.TargetId));
         }
         content.StaticUrl = str2;
     }
     foreach (ZuiInPhoto photo in model.ZuiInList)
     {
         if (valueByCache != "true")
         {
             photo.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + photo.PhotoId);
             continue;
         }
         Maticsoft.Model.SNS.Photos photos2 = this.bllPhotos.GetModelByCache(photo.PhotoId);
         if ((photos2 == null) || string.IsNullOrWhiteSpace(photos2.StaticUrl))
         {
         }
         photo.StaticUrl = (<Index>o__SiteContainer0.<>p__Site1b != null) ? photos2.StaticUrl : ((string) ((((dynamic) <Index>o__SiteContainer0.<>p__Site1b.Target(<Index>o__SiteContainer0.<>p__Site1b, base.ViewBag)) + "Photo/Detail/") + photo.PhotoId));
     }
     return base.View(model);
 }
Exemplo n.º 4
0
 public ActionResult ShareGoodsWaterfall(string orderby, 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;
     int intValueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetIntValueByCache("SNS_ShareGood_Category");
     if (intValueByCache == -1)
     {
         intValueByCache = 0xa7;
     }
     if (this.bllPhotos.GetRecordCount("Status=1 and  CategoryId=" + intValueByCache) < 1)
     {
         return new EmptyResult();
     }
     string str3 = orderby;
     if (str3 != null)
     {
         if (!(str3 == "hot"))
         {
             if (str3 == "popular")
             {
                 orderby = "FavouriteCount desc";
                 goto Label_010A;
             }
         }
         else
         {
             orderby = "CommentCount desc";
             goto Label_010A;
         }
     }
     orderby = "";
 Label_010A:
     model.PhotoListWaterfall = this.bllPhotos.GetCachePhotoListByPage(intValueByCache, orderby, startIndex, endIndex);
     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);
             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 = (<ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site26 != null) ? modelByCache.StaticUrl : ((string) ((((dynamic) <ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site26.Target(<ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site26, base.ViewBag)) + "Product/Detail/") + content.TargetId));
         }
         else
         {
             Maticsoft.Model.SNS.Photos photos = this.bllPhotos.GetModelByCache((int) content.TargetId);
             if ((photos == null) || string.IsNullOrWhiteSpace(photos.StaticUrl))
             {
             }
             str2 = (<ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site2a != null) ? photos.StaticUrl : ((string) ((((dynamic) <ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site2a.Target(<ShareGoodsWaterfall>o__SiteContainer1c.<>p__Site2a, base.ViewBag)) + "Photo/Detail/") + content.TargetId));
         }
         content.StaticUrl = str2;
     }
     return base.View(base.CurrentThemeViewPath + "Photo/PhotoListWaterfall.cshtml", model);
 }
Exemplo n.º 5
0
 public ActionResult WaterfallPhotoListData(string keyword, string type, int startIndex)
 {
     keyword = InjectionFilter.Filter(keyword);
     Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
     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;
     if (photos.GetSearchCountByQ(keyword) < 1)
     {
         return new EmptyResult();
     }
     model.PhotoListWaterfall = photos.GetListByKeyWord(keyword, type, startIndex, endIndex, "");
     string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
     if ((model.PhotoListWaterfall != null) && (model.PhotoListWaterfall.Count > 0))
     {
         foreach (PostContent content in model.PhotoListWaterfall)
         {
             if (valueByCache != "true")
             {
                 content.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId);
                 continue;
             }
             content.StaticUrl = string.IsNullOrWhiteSpace(content.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId)) : content.StaticUrl;
         }
     }
     return base.View(base.CurrentThemeViewPath + "/Photo/PhotoListWaterfall.cshtml", model);
 }
Exemplo n.º 6
0
 public ActionResult Photo(int? pageIndex)
 {
     ((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);
     PhotoList model = new PhotoList();
     Maticsoft.BLL.SNS.Photos photos = new Maticsoft.BLL.SNS.Photos();
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     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 searchCountByQ = 0;
     searchCountByQ = photos.GetSearchCountByQ(inputString);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num5 = pageIndex.Value * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > searchCountByQ) ? searchCountByQ : num5;
     if (searchCountByQ >= 1)
     {
         ((dynamic) base.ViewBag).sequence = orderby;
         int? nullable = pageIndex;
         model.PhotoPagedList = photos.GetListByKeyWord(inputString, orderby, startIndex, endIndex, "").ToPagedList<PostContent>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(searchCountByQ));
         string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic");
         if ((model.PhotoPagedList != null) && (model.PhotoPagedList.Count > 0))
         {
             foreach (PostContent content in model.PhotoPagedList)
             {
                 if (valueByCache != "true")
                 {
                     content.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId);
                     continue;
                 }
                 content.StaticUrl = string.IsNullOrWhiteSpace(content.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Photo/Detail/") + content.TargetId)) : content.StaticUrl;
             }
         }
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView("PhotoList", model);
         }
     }
     return base.View(model);
 }