예제 #1
0
        protected void UpdateCamState(int user, NmsMsgInfo nmsInfo)
        {
            StringBuilder sbSQL = new StringBuilder("");

            switch (nmsInfo.alarmstate.ToString() + nmsInfo.alarmtype)
            {
            case "266049":      //停止告警,也就是在线

                sbSQL.Append("update set i_status=1 from Device_Info  where [deviceIndexcode] ='" + nmsInfo.resindexcode + "'");


                break;

            case "166048":      //开始告警了,也就是不在线
            case "166049":
                sbSQL.Append("update set i_status=0 from Device_Info  where [deviceIndexcode] ='" + nmsInfo.resindexcode + "'");
                break;
            }
            if (sbSQL.ToString() == "")
            {
                return;
            }

            try
            {
                DbComponent.SQLHelper.ExecuteNonQuery(CommandType.Text, sbSQL.ToString());
            }
            catch (Exception ex)
            {
                log.Error(ex.ToString());
            }
        }
예제 #2
0
 protected int OnCamStatInfo(ref NmsMsgInfo nmsInfo, IntPtr userData)//监控点状态回调函数
 {
     Task.Factory.StartNew((info) =>
     {
         this.UpdateCamState(0, (NmsMsgInfo)info);
     }, nmsInfo);
     return(0);
 }