1234567891011121314151617181920212223242526272829 |
- using DBHelper;
- using Microsoft.EntityFrameworkCore;
- using System.Linq;
- using WCS.Entity.Protocol;
- namespace WCS.Service.Helpers
- {
- /// <summary>
- /// 系统设置
- /// </summary>
- public class SystemConfigHelpers
- {
- /// <summary>
- /// 获取指定设备配置信息 true表示设备启用,false标识设备未启用
- /// </summary>
- /// <param name="DEVICECODE">设备编号</param>
- /// <returns></returns>
- public static bool GetDeviceConfig(string DEVICECODE)
- {
- bool result = true;
- DB.Do(db =>
- {
- var systemConfig = db.Default.Set<WCS_SystemConfig>().AsNoTracking().SingleOrDefault(p => p.DEVICECODE == DEVICECODE);
- if (systemConfig != null) result = systemConfig.ENABLED;
- });
- return result;
- }
- }
- }
|