Пример #1
0
        public DeviceANDItemRefOR(DeviceOREx obj)
        {
            DeviceID = obj.DeviceID;
            Performance = obj.Performance;
            PerformanceVal = obj.PerformanceVal;
            LastPollingTime = obj.LastPollingTime.ToString("yyyy-MM-dd HH:mm:ss");
            NextPollingTime = obj.NextPollingTime.ToString("yyyy-MM-dd HH:mm:ss");
            Status = obj.State;
            StatusVal = obj.StatusVal;

            HealthStatus = obj.HealthStatus;
            HealthStatusVal = obj.HealthStatusVal;
        }
Пример #2
0
 public DeviceOREx SelectDeviceORExByID(string m_id)
 {
     string sql = string.Format(@"select dt.TypeName,sty.name ClassName,WarningStatus.MonitorValue WarningStatus,
     State.MonitorValue State,HealthStatus.MonitorValue HealthStatus,dev.*,
     case(dev.Performance) when '故障' then 0 when  '报警' then 2 when '未启动' then 3 else 0 end  perf
      from t_Device  dev
     left join t_DeviceType dt on dev.DeviceTypeID = dt.DeviceTypeID
     left join t_ServersType sty on sty.typeid= dt.typeid and sty.ServerID= dt.ServerID
     left join  t_TmpValue WarningStatus on WarningStatus.DeviceID= dev.DeviceID and WarningStatus.ChannelNO=11101
     left join  t_TmpValue HealthStatus on HealthStatus.DeviceID= dev.DeviceID and HealthStatus.ChannelNO=11102
     left join  t_TmpValue State on State.DeviceID= dev.DeviceID and State.ChannelNO=11103
     where dev.Deviceid='{0}'", m_id);
     DataTable dt = null;
     try
     {
         dt = db.ExecuteQueryDataSet(sql).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     if (dt == null)
         return null;
     if (dt.Rows.Count == 0)
         return null;
     DataRow dr = dt.Rows[0];
     DeviceOREx m_obj = new DeviceOREx(dr);
     return m_obj;
 }