using Cksoft.Data; using DllEapEntity; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DllEapDal { public class FileParamsCommstDal { private IDatabase CurrDb; public FileParamsCommstDal(IDatabase db) { CurrDb = db; } public IEnumerable Get(int start, int length, string order, string sort, string filter, string errorinfo) { var pros = CurrDb.FindListForCondition($" {filter} order by {sort} {order} limit {start - 1},{length}", ref errorinfo).ToList(); // 加入参数信息 if (pros != null && pros.Count() > 0) { for (var i = 0; i < pros.Count(); i++) { var detail = CurrDb.FindListForCondition($" and a.PreID='{pros[i].ID}'", ref errorinfo).ToList(); // var detail = CurrDb.FindList(sql).ToList(); if (detail == null) { detail = new List(); } pros[i].CurrDetails = detail; } } return pros; } public int GetCount(string filter) { string errorinfo = string.Empty; var entities = CurrDb.FindListForCondition(filter, ref errorinfo); if (entities != null) { return entities.Count(); } return 0; } } }