Exemple #1
0
    void images_OnGetDataSource(object sender, EventArgs e)
    {
        TransitPostImageQueryOptions options = GetOptions();

        images.DataSource = SessionManager.GetCachedCollection <TransitPostImage>(
            "GetPostImagesEx", SessionManager.PostTicket, options);
    }
Exemple #2
0
    public void GetDataImages(object sender, EventArgs e)
    {
        images.CurrentPageIndex = 0;
        int pid   = GetId("pid");
        int index = GetId("index");

        if (RequestId > 0)
        {
            if (pid > 0)
            {
                TransitPostImageQueryOptions options = new TransitPostImageQueryOptions(pid);
                options.PreferredOnly   = PreferredOnly;
                images.CurrentPageIndex = index;
                images.VirtualItemCount = SessionManager.GetCachedCollectionCount <TransitImage>(
                    "GetPostImagesCountEx", SessionManager.PostTicket, options);
            }
            else
            {
                images.VirtualItemCount = 1;
            }
        }

        images_OnGetDataSource(sender, e);
        images.DataBind();
        panelImages.Update();
    }
Exemple #3
0
    void images_OnGetDataSource(object sender, EventArgs e)
    {
        int pid = GetId("pid");

        List <TransitPostImage> list = null;

        if (pid > 0)
        {
            TransitPostImageQueryOptions options = new TransitPostImageQueryOptions(
                pid, images.PageSize, images.CurrentPageIndex);
            options.PreferredOnly = PreferredOnly;

            string sortexpression = Request.Params["SortExpression"];
            string sortdirection  = Request.Params["SortDirection"];

            if (!string.IsNullOrEmpty(sortexpression))
            {
                options.SortExpression = sortexpression;
            }
            if (!string.IsNullOrEmpty(sortdirection))
            {
                options.SortDirection = (WebServiceQuerySortDirection)Enum.Parse(
                    typeof(WebServiceQuerySortDirection), sortdirection);
            }

            list = SessionManager.GetCachedCollection <TransitPostImage>(
                "GetPostImagesEx", SessionManager.PostTicket, options);
        }
        else
        {
            TransitImage image = SessionManager.GetCachedObject <TransitImage>(
                "GetImageById", SessionManager.PostTicket, RequestId);
            TransitPostImage postimage = new TransitPostImage();
            postimage.Image = image;
            postimage.Post  = null;
            postimage.Id    = RequestId;
            list            = new List <TransitPostImage>();
            list.Add(postimage);
        }

        linkBack.NavigateUrl = ReturnUrl;

        if (list.Count > 0)
        {
            PostImage = list[0];

            /*
             * linkComment.NavigateUrl = string.Format("EditImageComment.aspx?sid={0}&r={1}",
             *  PostImage.Image.Id, Renderer.UrlEncode(UrlPathAndQuery));
             */
        }

        GetEXIFData(sender, e);
        GetDataComments(sender, e);

        images.DataSource = list;
    }
Exemple #4
0
    public void GetData(object sender, EventArgs e)
    {
        images.CurrentPageIndex = 0;
        TransitPostImageQueryOptions options = GetOptions();

        images.VirtualItemCount = SessionManager.GetCachedCollectionCount <TransitPostImage>(
            "GetPostImagesCountEx", SessionManager.PostTicket, options);
        images_OnGetDataSource(sender, e);
        images.DataBind();
    }
Exemple #5
0
    private TransitPostImageQueryOptions GetOptions()
    {
        TransitPostImageQueryOptions options = new TransitPostImageQueryOptions();

        options.PageNumber     = images.CurrentPageIndex;
        options.PageSize       = images.PageSize;
        options.SortExpression = "Counter.Count";
        options.SortDirection  = WebServiceQuerySortDirection.Descending;
        options.Counters       = true;
        return(options);
    }
Exemple #6
0
    void GetImagesData(object sender, EventArgs e)
    {
        TransitPost post = Post;

        TransitPostImageQueryOptions imagesoptions = new TransitPostImageQueryOptions(Post.Id);

        imagesoptions.PreferredOnly = PreferredOnly;
        images.Visible          = (post.ImagesCount > 1);
        images.CurrentPageIndex = 0;
        images.VirtualItemCount = SessionManager.GetCachedCollectionCount <TransitPostImage>(
            "GetPostImagesCountEx", SessionManager.PostTicket, imagesoptions);
        images_OnGetDataSource(sender, e);
        images.DataBind();
    }
Exemple #7
0
    void images_OnGetDataSource(object sender, EventArgs e)
    {
        string sortexpression = Request.Params["SortExpression"];
        string sortdirection  = Request.Params["SortDirection"];

        TransitPostImageQueryOptions options = new TransitPostImageQueryOptions(
            Post.Id, images.PageSize, images.CurrentPageIndex);

        options.SortDirection = string.IsNullOrEmpty(sortdirection)
            ? WebServiceQuerySortDirection.Ascending
            : (WebServiceQuerySortDirection)Enum.Parse(typeof(WebServiceQuerySortDirection), sortdirection);

        options.SortExpression = string.IsNullOrEmpty(sortexpression)
            ? "Image.Image_Id"
            : sortexpression;

        options.PreferredOnly = PreferredOnly;

        images.DataSource = SessionManager.GetCachedCollection <TransitPostImage>(
            "GetPostImagesEx", SessionManager.PostTicket, options);
    }