コード例 #1
0
        public static string WarningCodeTypeToDBStr(EWarningInfoCodeType type)
        {
            switch (type)
            {
            case EWarningInfoCodeType.ERain: return(CS_EWarningCodeType_Rain);

            case EWarningInfoCodeType.EWater: return(CS_EWarningCodeType_Water);

            case EWarningInfoCodeType.EVlotage: return(CS_EWarningCodeType_Voltate);
            }
            throw new Exception("WarningCodeTypeToDBStr Error");
        }
コード例 #2
0
 /// <summary>
 /// 添加站点的告警信息,2014.5.17新增需求
 /// </summary>
 /// <param name="info"></param>
 /// <param name="time"></param>
 /// <param name="type"></param>
 /// <param name="StrStationID"></param>
 public void AddInfo(string info, DateTime time, EWarningInfoCodeType type, string strStationID)
 {
     // 异步写入数据库
     CDBDataMgr.Instance.GetWarningInfoProxy().AddNewRow(new Entity.CEntityWarningInfo()
     {
         DataTime            = time,
         InfoDetail          = info,
         StrStationId        = strStationID,
         WarningInfoCodeType = type
     });
     Task.Factory.StartNew(() =>
     {
         if (null != RecvedNewWarningInfo)
         {
             // 通知其它订阅者
             RecvedNewWarningInfo.Invoke(this, new CEventSingleArgs <CTextInfo>(new CTextInfo()
             {
                 Time = time, Info = info
             }));
         }
         //CVoicePlayer.Instance.Play();
     });
 }