OfAppletlogDal.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Cksoft.Data;
  2. using DllEapEntity;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. namespace DllEapDal.OFILM.MES
  8. {
  9. public class OfAppletlogDal
  10. {
  11. private IDatabase CurrDb = null;
  12. public OfAppletlogDal(IDatabase db)
  13. {
  14. CurrDb = db;
  15. }
  16. public IEnumerable<OfAppletlog> Get(int start, int length, string order, string sort, string filter, string errorinfo)
  17. {
  18. try
  19. {
  20. var pros = CurrDb.FindListForCondition<OfAppletlog>($" {filter} order by {sort} {order} limit {start - 1},{length}", ref errorinfo);
  21. return pros;
  22. }
  23. catch (Exception ex)
  24. {
  25. Console.WriteLine(ex.ToString() + ex.StackTrace);
  26. return null;
  27. }
  28. }
  29. public int GetCount(string filter)
  30. {
  31. string errorinfo = string.Empty;
  32. var entities = CurrDb.FindListForCondition<OfAppletlog>(filter, ref errorinfo);
  33. if (entities != null)
  34. {
  35. return entities.Count();
  36. }
  37. return 0;
  38. }
  39. }
  40. }