private Sys_MenuInRoleDAL dal = new Sys_MenuInRoleDAL();
/// <summary>
/// 获取分页列表信息
/// </summary>
/// <param name="fields">所需字段</param>
/// <param name="query">查询条件</param>
/// <param name="orderby">排序方式</param>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">页长</param>
/// <param name="totalCount">总记录</param>
/// <returns></returns>
public List<Sys_MenuInRoleInfo> GetListPage(string fields, string query, string orderby, int pageIndex, int pageSize, out int totalCount)
{
// 参数合法性校验
if (pageSize <= 0) { totalCount = 0; return new List<Sys_MenuInRoleInfo>(); }
if (pageIndex <= 0) { pageIndex = 1; }
if (string.IsNullOrWhiteSpace(fields)) { fields = "*"; }
if (string.IsNullOrWhiteSpace(query)) { query = "1=1"; }
if (string.IsNullOrWhiteSpace(orderby)) { orderby = "ID"; }
return dal.GetList(fields, query, orderby, pageIndex, pageSize, out totalCount);
}
/// <summary>
/// 获取列表信息
/// </summary>
/// <param name="fields">所需字段</param>
/// <param name="query">查询条件</param>
/// <param name="orderBy">排序方式</param>
/// <returns></returns>
public List<Sys_MenuInRoleInfo> GetList(string fields, string query, string orderBy)
{
// 参数合法性校验
if (string.IsNullOrWhiteSpace(fields)) { fields = "*"; }
if (string.IsNullOrWhiteSpace(query)) { query = "1=1"; }
if (string.IsNullOrWhiteSpace(orderBy)) { orderBy = "ID"; }
return dal.GetList(fields, query, orderBy);
}
/// <summary>
/// 获取实体信息
/// </summary>
/// <param name="fields">所需字段</param>
/// <param name="query">查询条件(如果top1 的话,可以在此处添加排序方式)</param>
/// <returns></returns>
public Sys_MenuInRoleInfo GetInfo(string fields, string query)
{
// 参数合法性校验
if (string.IsNullOrWhiteSpace(fields)) { fields = "*"; }
if (string.IsNullOrWhiteSpace(query)) { query = "1=1"; }
return dal.GetInfo(fields, query);
}
/// <summary>
/// 新增
/// </summary>
/// <param name="info">实体</param>
/// <returns></returns>
public int Insert(Sys_MenuInRoleInfo info)
{
object obj = dal.Insert(info);
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="query">删除条件</param>
/// <returns></returns>
public int Delete(string query)
{
// 如果条件为空的话,不进行删除,直接返回
if (string.IsNullOrWhiteSpace(query)) { return -1; }
return dal.Delete(query);
}
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |