Пример #1
0
    void gridManage_OnGetDataSource(object sender, EventArgs e)
    {
        if (DiscussionId <= 0)
        {
            return;
        }

        DiscussionService.TransitDiscussion   d       = GetDiscussion();
        DiscussionService.ServiceQueryOptions options = new DiscussionService.ServiceQueryOptions();
        options.PageNumber = gridManage.CurrentPageIndex;
        options.PageSize   = gridManage.PageSize;

        DiscussionViewTypes type = GetDiscussionViewType();

        switch (type)
        {
        case DiscussionViewTypes.FlatWithNewestOnTop:
        case DiscussionViewTypes.FlatFullWithNewestOnTop:
            gridManage.DataSource = SessionManager.GetCollection <DiscussionService.TransitDiscussionPost, DiscussionService.ServiceQueryOptions, int>(
                DiscussionId, options, SessionManager.DiscussionService.GetLatestDiscussionPostsById);
            break;

        case DiscussionViewTypes.ThreadedWithNewestOnTop:
        case DiscussionViewTypes.ThreadedFullWithNewestOnTop:
        default:
            gridManage.DataSource = SessionManager.GetCollection <DiscussionService.TransitDiscussionPost, DiscussionService.ServiceQueryOptions, int>(
                DiscussionId, options, SessionManager.DiscussionService.GetDiscussionThreadsByDiscussionId);
            break;
        }
    }
Пример #2
0
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     DiscussionService.ServiceQueryOptions options = new DiscussionService.ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize   = gridManage.PageSize;
     if (IsObjectBound)
     {
         gridManage.DataSource = SessionManager.GetCollection <DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions, string, int>(
             Type, ObjectId, options, SessionManager.DiscussionService.GetDiscussionsByObjectId);
     }
     else
     {
         gridManage.DataSource = SessionManager.GetCollection <DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions>(
             options, SessionManager.DiscussionService.GetDiscussions);
     }
 }
Пример #3
0
 void gridManage_OnGetDataSource(object sender, EventArgs e)
 {
     DiscussionService.ServiceQueryOptions options = new DiscussionService.ServiceQueryOptions();
     options.PageNumber = gridManage.CurrentPageIndex;
     options.PageSize = gridManage.PageSize;
     if (IsObjectBound)
     {
         gridManage.DataSource = SessionManager.GetCollection<DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions, string, int>(
             Type, ObjectId, options, SessionManager.DiscussionService.GetDiscussionsByObjectId);
     }
     else
     {
         gridManage.DataSource = SessionManager.GetCollection<DiscussionService.TransitDiscussion, DiscussionService.ServiceQueryOptions>(
             options, SessionManager.DiscussionService.GetDiscussions);
     }
 }
Пример #4
0
    void gridManage_OnGetDataSource(object sender, EventArgs e)
    {
        if (DiscussionId <= 0)
            return;

        DiscussionService.TransitDiscussion d = GetDiscussion();
        DiscussionService.ServiceQueryOptions options = new DiscussionService.ServiceQueryOptions();
        options.PageNumber = gridManage.CurrentPageIndex;
        options.PageSize = gridManage.PageSize;

        DiscussionViewTypes type = GetDiscussionViewType();
        switch (type)
        {
            case DiscussionViewTypes.FlatWithNewestOnTop:
            case DiscussionViewTypes.FlatFullWithNewestOnTop:
                gridManage.DataSource = SessionManager.GetCollection<DiscussionService.TransitDiscussionPost, DiscussionService.ServiceQueryOptions, int>(
                    DiscussionId, options, SessionManager.DiscussionService.GetLatestDiscussionPostsById);
                break;
            case DiscussionViewTypes.ThreadedWithNewestOnTop:
            case DiscussionViewTypes.ThreadedFullWithNewestOnTop:
            default:
                gridManage.DataSource = SessionManager.GetCollection<DiscussionService.TransitDiscussionPost, DiscussionService.ServiceQueryOptions, int>(
                    DiscussionId, options, SessionManager.DiscussionService.GetDiscussionThreadsByDiscussionId);
                break;
        }
    }