本文整理汇总了C#中DataPage类的典型用法代码示例。如果您正苦于以下问题:C# DataPage类的具体用法?C# DataPage怎么用?C# DataPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataPage类属于命名空间,在下文中一共展示了DataPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindShow
private void bindShow( ContentPost post, DataPage<ContentImg> imgPage )
{
ctx.SetItem( "ContentPost", post );
set( "post.Title", post.Title );
set( "post.Content", post.Content );
set( "post.CreateTime", post.Created );
set( "post.ReplyCount", post.Replies );
set( "post.Hits", post.Hits );
set( "post.Source", post.SourceLink );
if (post.Creator != null) {
set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
set( "post.Submitter", "нч" );
}
IBlock block = getBlock( "list" );
foreach (ContentImg img in imgPage.Results) {
block.Set( "img.Url", img.GetImgUrl() );
block.Set( "img.Description", img.Description );
block.Next();
}
String postLink = alink.ToAppData( post );
String pageBar = ObjectPage.GetPageBarByLink( postLink, imgPage.PageCount, imgPage.Current );
set( "page", pageBar );
}
示例2: bindAdminList
private void bindAdminList( ContentSection section, DataPage<ContentPost> posts )
{
set( "section.Title", section.Title );
IBlock block = getBlock( "list" );
String icon = string.Format( "<img src=\"{0}\"/> ", strUtil.Join( sys.Path.Img, "img.gif" ) );
foreach (ContentPost post in posts.Results) {
String imgIcon = post.HasImg() ? icon : "";
block.Set( "post.ImgIcon", imgIcon );
block.Set( "post.Title", strUtil.SubString( post.Title, 50 ) );
block.Set( "post.TitleCss", post.Style );
block.Set( "post.TitleFull", post.Title );
block.Set( "post.OrderId", post.OrderId );
block.Set( "post.Url", post.SourceLink );
block.Set( "post.Link", strUtil.CutString( post.SourceLink, 100 ) );
block.Set( "post.PubDate", post.Created );
String attachments = post.Attachments > 0 ? "<img src='" + strUtil.Join( sys.Path.Img, "attachment.gif" ) + "'/>" : "";
block.Set( "post.Attachments", attachments );
if (post.HasImg())
block.Set( "post.EditUrl", to( new PostController().EditImg, post.Id ) );
else
block.Set( "post.EditUrl", to( new PostController().Edit, post.Id ) );
block.Set( "post.DeleteUrl", to( Delete, post.Id ) );
block.Next();
}
set( "page", posts.PageBar );
}
示例3: bindUserList
private void bindUserList( DataPage<User> list ) {
IBlock block = getBlock( "list" );
List<User> users = list.Results;
List<UserConnect> connects = getUserConnects( users );
foreach (User u in users) {
block.Set( "user.Name", u.Name );
block.Set( "user.RoleName", u.Role.Name );
block.Set( "user.RealName", strUtil.SubString( u.RealName, 8 ) );
String realNameInfo = strUtil.HasText( u.RealName ) ? "(" + strUtil.SubString( u.RealName, 8 ) + ")" : "";
block.Set( "user.RealNameInfo", realNameInfo );
String isEmailConfirm = getEmailConfirmStatus( u, connects );
block.Set( "user.IsEmailConfirm", isEmailConfirm );
String email = getUserEmail( u, connects );
block.Set( "user.Email", email );
block.Set( "user.CreateTime", u.Created.GetDateTimeFormats( 'g' )[0] );
block.Set( "user.LastLoginTime", u.LastLoginTime );
block.Set( "user.Id", u.Id );
block.Set( "user.EditUrl", to( Edit, u.Id ) );
block.Set( "user.Url", toUser( u ) );
block.Set( "statusIcon", getStatusIcon( u ) );
block.Set( "user.Ip", u.LastLoginIp );
block.Set( "user.PicStatus", u.IsPicError == 1 ? "x" : "" );
block.Next();
}
set( "page", list.PageBar );
}
示例4: GetPage
public virtual DataPage<Group> GetPage( int groupId, int pageSize )
{
DataPage<GroupFriends> list = db.findPage<GroupFriends>( "Group.Id=" + groupId, pageSize );
DataPage<Group> page = new DataPage<Group>( list );
page.Results = populate( list.Results );
return page;
}
示例5: bindList
private void bindList( ContentSection section, DataPage<ContentPost> list, List<ContentPoll> polls )
{
User user = (User)ctx.viewer.obj;
set( "section.Name", section.Title );
IBlock block = getBlock( "list" );
for (int i = 0; i < polls.Count; i++) {
ContentPoll poll = polls[i];
ContentPost post = list.Results[i];
block.Set( "post.Created", poll.Created );
ctx.SetItem( "poll", poll );
Boolean hasVote = poll.CheckHasVote( user.Id );
String html = hasVote ? loadHtml( sectionPollResult ) : loadHtml( sectionPoll );
block.Set( "post.Html", html );
//block.Set( "post.ShowLink", to( Show, post.Id ) );
block.Set( "post.ShowLink", alink.ToAppData( post ) );
String replies = post.Replies > 0 ? lang("comment") + " :" + post.Replies : "";
block.Set( "post.Replies", replies );
block.Next();
}
set( "page", list.PageBar );
}
示例6: ProcessRequest
public override void ProcessRequest(HttpContext context)
{
HttpRequest request = context.Request;
HttpResponse response = context.Response;
string filePath = context.Server.MapPath(request.FilePath);
if (System.IO.File.Exists(filePath))
{
var page = new DataPage();
var lastModified = System.IO.File.GetLastWriteTimeUtc(filePath);
//
// Set Cache
//
response.Cache.SetLastModified(lastModified);
if (request.Headers["If-Modified-Since"] != lastModified.ToRFC1123())
{
page.Controls.Add(page.LoadControl(request.FilePath));
//
// Set internal variables that verify whether the page contains a form
//
page.GetType().GetMethod("OnFormRender", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(page, null);
context.Server.Execute(page, response.Output, true);
}
else if (!page.IsPostBack)
response.StatusCode = (int)HttpStatusCode.NotModified;
}
}
示例7: bindMbList
private void bindMbList( DataPage<MicroblogComment> list )
{
set( "OperationUrl", to( Admin ) );
set( "homeLink", to( Index ) );
set( "searchAction", to( Search ) );
set( "searchKey", getSearchKey() );
String searchType = ctx.Get( "t" );
String sel = "selected=\"selected\"";
if (searchType == "author") {
set( "authorSelectStatus", sel );
set( "contentSelectStatus", "" );
}
else if (searchType == "content") {
set( "authorSelectStatus", "" );
set( "contentSelectStatus", sel );
}
list.Results.ForEach( x => {
x.data["CreatorLink"] = alink.ToUserMicroblog( x.User );
x.data.show = alink.ToAppData( x.Root );
} );
bindList( "list", "x", list.Results );
set( "page", list.PageBar );
}
示例8: bindPosts
private void bindPosts( DataPage<BlogPost> results, BlogSetting s ) {
IBlock listBlock = getBlock( "bloglist" );
foreach (BlogPost post in results.Results) {
bindPostOne( listBlock, post, s );
listBlock.Next();
}
}
示例9: bindPosts
private void bindPosts( DataPage<BlogPost> list ) {
IList posts = list.Results;
set( "page", list.PageBar );
IBlock block = getBlock( "list" );
foreach (BlogPost post in posts) {
String sysCategoryName = getSysCategoryName( post );
block.Set( "post.SysCategoryName", sysCategoryName );
block.Set( "post.Id", post.Id );
block.Set( "post.Title", post.Title );
block.Set( "post.Url", alink.ToAppData( post ) );
block.Set( "post.Hits", post.Hits );
block.Set( "post.ReplyCount", post.Replies );
block.Set( "post.CreateTime", post.Created.GetDateTimeFormats( 'g' )[0] );
String author = post.Creator == null ? "" : post.Creator.Name;
block.Set( "post.UserName", author );
block.Set( "post.UserLink", toUser( post.CreatorUrl ) );
String status = getStatus( post );
block.Set( "post.Status", status );
block.Set( "post.DeleteLink", to( Delete, post.Id ) );
//block.Set( "post.UnDeleteLink", to( UnDelete, post.Id ) );
block.Next();
}
}
示例10: bindReplyList
private void bindReplyList( DataPage<ForumPost> results, int currentPostId )
{
IBlock block = getBlock( "replypost" );
List<ForumPost> replyList = results.Results;
foreach (ForumPost post in replyList) {
if (post.Creator == null) continue;
block.Set( "p.MemberUrl", Link.ToMember( post.Creator ) );
block.Set( "p.MemberName", post.Creator.Name );
block.Set( "p.Title", post.Title );
block.Set( "p.Length", post.Content.Length );
block.Set( "p.CreateTime", post.Created );
block.Set( "p.Hits", post.Hits );
String plink = post.ParentId == 0 ? Link.To( new TopicController().Show, post.TopicId ) : alink.ToAppData( post );
block.Set( "p.Url", plink );
String pclass = post.Id == currentPostId ? "red strong" : "";
block.Set( "p.Class", pclass );
block.Next();
}
String page = results.PageCount > 1 ? results.PageBar : "";
set( "replyPage", page );
}
示例11: bindPostList
private void bindPostList( DataPage<BlogPost> list ) {
IBlock block = getBlock( "bloglist" );
foreach (BlogPost p in list.Results) {
bindPostOne( block, p );
block.Next();
}
set( "pager", list.PageBar );
}
示例12: GetByUser
public DataPage<Microblog> GetByUser( int userId, int pageSize )
{
DataPage<MicroblogAt> list = MicroblogAt.findPage( "UserId=" + userId, pageSize );
DataPage<Microblog> blogList = new DataPage<Microblog>();
blogList.CopyStats( list );
blogList.Results = getResults( list.Results );
return blogList;
}
示例13: GetPage
public virtual DataPage<User> GetPage( int targetId, int pageSize )
{
DataPage<SpaceVisitor> visitorList = db.findPage<SpaceVisitor>( "TargetId=" + targetId + " and VisitorId>0", pageSize );
List<User> users = populateUser( visitorList.Results );
DataPage<User> userPage = new DataPage<User>( visitorList );
userPage.Results = users;
return userPage;
}
示例14: GetPageByTag
public DataPage<User> GetPageByTag( int tagId )
{
DataPage<UserTagShip> list = UserTagShip.findPage( "TagId=" + tagId );
DataPage<User> results = new DataPage<User>();
results.CopyStats( list );
results.Results = populateUsers( list.Results );
return results;
}
示例15: getPostPage
private DataPage<PhotoPost> getPostPage( DataPage<PhotoLike> list ) {
DataPage<PhotoPost> results = new DataPage<PhotoPost>( list );
List<PhotoPost> xlist = new List<PhotoPost>();
foreach (PhotoLike x in list.Results) {
xlist.Add( x.Post );
}
results.Results = xlist;
return results;
}