/// <summary> /// 查询的数据 /// </summary> /// <param name="id">额外的参数</param> /// <param name="page">页码</param> /// <param name="rows">每页显示的行数</param> /// <param name="order">排序字段</param> /// <param name="sort">升序asc(默认)还是降序desc</param> /// <param name="search">查询条件</param> /// <param name="total">结果集的总数</param> /// <returns>结果集</returns> public List <SysField> GetByParam(string id, int page, int rows, string order, string sort, string search, ref int total) { IQueryable <SysField> queryData = repository.DaoChuData(db, order, sort, search); total = queryData.Count(); if (total > 0) { if (page <= 1) { queryData = queryData.Take(rows); } else { queryData = queryData.Skip((page - 1) * rows).Take(rows); } foreach (var item in queryData) { if (item.ParentId != null && item.SysField2 != null) { item.ParentIdOld = item.SysField2.MyTexts.GetString(); // } } } return(queryData.ToList()); }
/// <summary> /// 导出Flexigrid中查询的数据 /// </summary> /// <param name="param">客户端传进的数据</param> /// <param name="id">额外的参数</param> /// <returns></returns> public SysField[] DaoChu(string id, FlexigridParam param) { return(repository.DaoChuData(db, param).ToArray()); }