12345678910111213141516171819202122232425262728293031323334353637 |
- using Cksoft.Data;
- using DllEapEntity;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace DllScan.DAL
- {
- public class MacOrderDal
- {
- public IDatabase CurrDb;
- public MacOrderDal(IDatabase db)
- {
- CurrDb = db;
- }
- public IEnumerable<MacOrder> GetMacOrders(int start, int length, string order, string sort, string filter, string errorinfo)
- {
- var pros = CurrDb.FindListForCondition<MacOrder>($" {filter} order by {sort} {order} limit {start - 1},{length}", ref errorinfo);
- return pros;
- }
- public int GetCount(string filter)
- {
- string errorinfo = string.Empty;
- //string sql = $"select count(1) from ProgramRule a where 1=1 {filter}";
- var entities = CurrDb.FindListForCondition<MacOrder>(filter, ref errorinfo);
- if (entities != null)
- {
- return entities.Count();
- }
- return 0;
- }
- }
- }
|