📄 commentcontroller.cs
字号:
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace SubSonic.Generated
{
/// <summary>
/// Controller class for Comments
/// </summary>
public partial class CommentController
{
[DataObjectMethod(DataObjectMethodType.Select, true)]
public CommentCollection FetchAllByPaging(int? articleId, int startRowIndex, int maximumRows)
{
if (!articleId.HasValue)
{
return new CommentCollection();
}
else
{
int currentPageIndex = (int)(startRowIndex / maximumRows)+1;
int pageSize = maximumRows;
Query qry = new Query(Comment.Schema);
qry.WHERE(Comment.Columns.FkArticleId, articleId);
qry.PageIndex = currentPageIndex;
qry.PageSize = pageSize;
qry.OrderBy = OrderBy.Asc(Comment.Columns.PKId);
CommentCollection cc=new CommentCollection();
cc.LoadAndCloseReader(qry.ExecuteReader());
return cc;
}
}
public int GetCount(int? articleId)
{
if (!articleId.HasValue)
{
return 0;
}
else
{
return new Query(Comment.Schema).WHERE(Comment.Columns.FkArticleId, articleId).GetCount(Comment.Columns.PKId);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -