예제 #1
0
 public Translater()
 {
     _mySqlContext = new data_centerEntities();
     _sqlContext   = new ESMonitorEntities();
     _devList      = _sqlContext.T_Devs.ToList();
     _statList     = _sqlContext.T_Stats.ToList();
     LastRecordId  = -1;
 }
예제 #2
0
        private static void TryGetUpdateStatList()
        {
            while (true)
            {
                _sqlContext = new ESMonitorEntities();

                var devs =
                    _sqlContext.T_Devs.Where(
                        obj => obj.OuterCode != null && obj.OuterCode != string.Empty && obj.OuterCode != "").ToList();

                lock (_devStatPairList)
                {
                    foreach (var dev in devs)
                    {
                        if (_devStatPairList.Any(list => list.DevId == dev.Id))
                        {
                            continue;
                        }

                        var pair = new DevStatPair()
                        {
                            DevId    = dev.Id,
                            StatCode = dev.OuterCode
                        };

                        _devStatPairList.Add(pair);
                    }

                    for (var i = 0; i < _devStatPairList.Count; i++)
                    {
                        if (devs.All(obj => obj.Id != _devStatPairList[i].DevId))
                        {
                            _devStatPairList.RemoveAt(i);
                        }
                    }
                }
                Thread.Sleep(120000);
            }
            // ReSharper disable once FunctionNeverReturns
        }
 public AuthenticationProcess()
 {
     DbContext = new ESMonitorEntities();
 }
예제 #4
0
 public ControllerBase()
 {
     WdContext = new WdContext();
     DbContext = new ESMonitorEntities();
 }
예제 #5
0
 public AuthenticationProcess()
 {
     DbContext = new ESMonitorEntities();
 }
예제 #6
0
 public ControllerBase()
 {
     WdContext = new WdContext();
     DbContext = new ESMonitorEntities();
 }