WarningRepository.cs 818 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace GDNXFD.Data
  7. {
  8. public class WarningRepository
  9. {
  10. /// <summary>
  11. /// 获取所有有故障编码的报警
  12. /// </summary>
  13. /// <returns></returns>
  14. public static IList<Warning> GetWarningInfoHaveFaultCode()
  15. {
  16. IList<Warning> wList = new List<Warning>();
  17. try
  18. {
  19. using (GDNXFDDbContext ctx = new GDNXFDDbContext())
  20. {
  21. wList = ctx.Warning.Where(s => !string.IsNullOrEmpty(s.FaultCode)).ToList();
  22. }
  23. }
  24. catch (Exception ex)
  25. {
  26. }
  27. return wList;
  28. }
  29. }
  30. }