SystemConfigHelpers.cs 876 B

1234567891011121314151617181920212223242526272829
  1. using DBHelper;
  2. using Microsoft.EntityFrameworkCore;
  3. using System.Linq;
  4. using WCS.Entity.Protocol;
  5. namespace WCS.Service.Helpers
  6. {
  7. /// <summary>
  8. /// 系统设置
  9. /// </summary>
  10. public class SystemConfigHelpers
  11. {
  12. /// <summary>
  13. /// 获取指定设备配置信息 true表示设备启用,false标识设备未启用
  14. /// </summary>
  15. /// <param name="DEVICECODE">设备编号</param>
  16. /// <returns></returns>
  17. public static bool GetDeviceConfig(string DEVICECODE)
  18. {
  19. bool result = true;
  20. DB.Do(db =>
  21. {
  22. var systemConfig = db.Default.Set<WCS_SystemConfig>().AsNoTracking().SingleOrDefault(p => p.DEVICECODE == DEVICECODE);
  23. if (systemConfig != null) result = systemConfig.ENABLED;
  24. });
  25. return result;
  26. }
  27. }
  28. }