示例#1
0
        public virtual void Category(long categoryId)
        {
            view("Index");

            // 从第二页开始,是ajax获取,所以不需要多余的layout内容
            if (CurrentRequest.getCurrentPage() > 1)
            {
                HideLayout(typeof(wojilu.Web.Controller.LayoutController));
                HideLayout(typeof(wojilu.Web.Controller.Photo.LayoutController));
                HideLayout(typeof(wojilu.Web.Controller.Photo.Wf.LayoutController));
            }

            // 1) 超过最大滚页数,则不再自动翻页
            int maxPage = 10;

            if (CurrentRequest.getCurrentPage() > maxPage)
            {
                echoText(".");
                return;
            }

            DataPage <PhotoPost> list = sysPostService.GetShowByCategory(categoryId, 20);

            // 2) 或者超过实际页数,也不再自动翻页
            if (CurrentRequest.getCurrentPage() > list.PageCount && list.PageCount > 0)
            {
                echoText(".");
                return;
            }

            PhotoBinder.BindPhotoList(this, list, ctx.viewer.Id);
        }
示例#2
0
        public virtual void Index()
        {
            ctx.Page.Title       = PhotoAppSetting.Instance.MetaTitle;
            ctx.Page.Keywords    = PhotoAppSetting.Instance.MetaKeywords;
            ctx.Page.Description = PhotoAppSetting.Instance.MetaDescription;

            // 从第二页开始,是ajax获取,所以不需要多余的layout内容
            if (CurrentRequest.getCurrentPage() > 1)
            {
                HideLayout(typeof(wojilu.Web.Controller.LayoutController));
                HideLayout(typeof(wojilu.Web.Controller.Photo.LayoutController));
                HideLayout(typeof(wojilu.Web.Controller.Photo.Wf.LayoutController));
            }

            // 1) 超过最大滚页数,则不再自动翻页
            int maxPage = 10;

            if (CurrentRequest.getCurrentPage() > maxPage)
            {
                echoText(".");
                return;
            }

            DataPage <PhotoPost> list = sysPostService.GetShowRecent(20);

            // 2) 或者超过实际页数,也不再自动翻页
            if (CurrentRequest.getCurrentPage() > list.PageCount && list.PageCount > 0)
            {
                echoText(".");
                return;
            }

            PhotoBinder.BindPhotoList(this, list, ctx.viewer.Id);
        }
示例#3
0
        public void Category(int id)
        {
            setWaterfallView();

            String userUrl = ctx.route.getItem("user");
            User   u       = userService.GetByUrl(userUrl);

            if (u == null)
            {
                echoRedirect("用户不存在");
                return;
            }

            PhotoAlbum album = categoryService.GetById(id);

            set("albumName", album.Name);
            set("showAlbumCss", "display:block");
            set("albumDataCount", album.DataCount);


            DataPage <PhotoPost> list = postService.GetShowByUser(u.Id, id, 12);

            // 2) 或者超过实际页数,也不再自动翻页
            if (CurrentRequest.getCurrentPage() > list.PageCount && list.PageCount > 0)
            {
                echoText(".");
                return;
            }

            PhotoBinder.BindPhotoList(this, list, u.Id);
        }
示例#4
0
        public void Like()
        {
            setWaterfallView();

            String userUrl = ctx.route.getItem("user");
            User   u       = userService.GetByUrl(userUrl);

            if (u == null)
            {
                echoRedirect("用户不存在");
                return;
            }

            DataPage <PhotoPost> list = likeService.GetByUser(u.Id, 12);

            // 2) 或者超过实际页数,也不再自动翻页
            if (CurrentRequest.getCurrentPage() > list.PageCount && list.PageCount > 0)
            {
                echoText(".");
                return;
            }

            PhotoBinder.BindPhotoList(this, list, ctx.viewer.Id);
        }