void images_OnGetDataSource(object sender, EventArgs e) { TransitPostImageQueryOptions options = GetOptions(); images.DataSource = SessionManager.GetCachedCollection <TransitPostImage>( "GetPostImagesEx", SessionManager.PostTicket, options); }
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(); }
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; }
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(); }
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); }
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(); }
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); }