public void LoadData() { if (CurrentPage > TotalPage) { CurrentPage = 0; } if (CurrentPageAlbum > TotalPageAlbum) { CurrentPageAlbum = 0; } List <PhotoInfo> temp = new List <PhotoInfo>(); int length = (CurrentPage + 1) * RPP; if (length > PhotoInfos.Count) { length = PhotoInfos.Count; } for (int i = CurrentPage * RPP; i < length; i++) { temp.Add(PhotoInfos[i]); } List <DirInfo> temp1 = new List <DirInfo>(); int l = (CurrentPageAlbum + 1) * RPPAlbum; if (l > DirInfos.Count) { l = DirInfos.Count; } for (int i = CurrentPageAlbum * RPPAlbum; i < l; i++) { temp1.Add(DirInfos[i]); } //ilist = ilist.Take(CurrentPage * RPP + RPP > TotalRecord ? TotalRecord % RPP : RPP); if (temp1.Count == 0) { Conten.Visible = false; } else { Conten.Visible = true; } Pictype.DataSource = temp1; Pictype.DataBind(); Pic.DataSource = temp; Pic.DataBind(); }
public void LoadData() { if (CurrentPage > TotalPage) { CurrentPage = 0; } if (CurrentPageAlbum > TotalPageAlbum) { CurrentPageAlbum = 0; } List <PhotoInfo> temp = new List <PhotoInfo>(); for (int i = 0; i < PhotoInfos.Count; i++) { temp.Add(PhotoInfos[i]); } List <DirInfo> temp1 = new List <DirInfo>(); int l = (CurrentPageAlbum + 1) * RPPAlbum; if (l > DirInfos.Count) { l = DirInfos.Count; } for (int i = CurrentPageAlbum * RPPAlbum; i < l; i++) { temp1.Add(DirInfos[i]); } if (temp1.Count == 0) { Conten.Visible = false; } else { Conten.Visible = true; } Pictype.DataSource = temp1; Pictype.DataBind(); Pic.DataSource = temp; Pic.DataBind(); }