SystemConfigHelpers.cs 803 B

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