/// <summary> /// 获取EasyUIRequest对应的分页数据 /// </summary> /// <param name="request"></param> /// <param name="args"></param> /// <param name="sql"></param> /// <returns></returns> public MVCPagerData GetPagerData(MVCRequest request, object args, string sql) { ExecSqlQuery queryEr = MVCNHibernateHelp.BuildPager(request, args, sql); queryEr.Sql = sql; return(GetPagerData(request, queryEr)); }
/// <summary> /// 获取所有数据 /// </summary> /// <param name="queryEr"></param> /// <param name="sql"></param> /// <returns></returns> public IList GetAllData(object args, string sql) { ExecSqlQuery queryEr = MVCNHibernateHelp.BuildSqlQuery(args, sql); SqlPart sqlPart = MVCNHibernateHelp.RefactorToSqlPart(sql); return(GetData(queryEr, sqlPart)); }
/// <summary> /// 获取所有数据 /// </summary> /// <param name="request"></param> /// <param name="queryEr"></param> /// <param name="sql"></param> /// <returns></returns> public IList GetAllData(MVCRequest request, IDictionary <string, object> args, string sql) { ExecSqlQuery queryEr = MVCNHibernateHelp.BuildSqlQuery(args, sql); SqlPart sqlPart = MVCNHibernateHelp.RefactorToSqlPart(request, sql); return(GetData(queryEr, sqlPart)); }
/// <summary> /// 获取EasyUIRequest对应的分页数据 /// </summary> /// <param name="request"></param> /// <param name="queryEr"></param> /// <returns></returns> public MVCPagerData GetPagerData(MVCRequest request, ExecSqlQuery queryEr) { #region 数据部分 string sql = queryEr.Sql; SqlPart sqlPart = MVCNHibernateHelp.RefactorToSqlPart(request, sql); IList listData = GetData(queryEr, sqlPart); #endregion #region count行数部分 //默认行数 int total = GetCount(queryEr, sqlPart); #endregion return(new MVCPagerData { rows = listData, total = total }); }
/// <summary> /// 将request、args、sql所代表的属性赋值给queryEr /// </summary> /// <param name="request"></param> /// <param name="args"></param> /// <param name="sql"></param> /// <param name="queryEr">有可能是ExecSqlQuery或SqlPager类型</param> /// <returns></returns> public static ExecSqlQuery BuildSqlQuery(object args, string sql, ExecSqlQuery queryEr) { queryEr.ParamerList.AddRange(MVCNHibernateHelp.ConvertToParamerList(args, sql)); return(queryEr); }