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