public bool Execute() { try { Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "4"; info.pi_devicetime = ConverUtil.Time(_content, 0); info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 7); info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 9); info.pi_protocoltype = _content[13].ToString(); char[] ModelStateChar = DataJM.ModelState(_content[14].ToString()); info.pi_param1 = ModelStateChar[0].ToString(); //模块状态 info.pi_param2 = ModelStateChar[1].ToString(); //模块状态 info.pi_param3 = DataJM.电池电压(_content, 15); //电池电压。 info.pi_version = _content[18].ToString(); info.pi_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info); string Result = c.Exec(); if (Result != "0") { MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
public bool Execute() { try { if (RepeatData.IsRepeatData(_content)) { MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode); return(true); } Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "4"; info.pi_devicetime = ConverUtil.Time(_content, 0); info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 7); info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 9); info.pi_protocoltype = _content[13].ToString(); info.pi_param1 = ConverUtil.ByteToStr_2(_content, 14); //功率过大阀值 info.pi_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info); string Result = c.Exec(); if (Result != "0") { MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
public bool Execute() { try { Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "4"; info.pi_devicetime = ConverUtil.Time(_content, 0); info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 7); info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 9); info.pi_protocoltype = _content[13].ToString(); info.pi_param1 = ConverUtil.ByteToStr_2(_content, 14); //单位时间内最大幅度值 info.pi_param2 = _content[16].ToString(); //有轻微震动状态 info.pi_param3 = _content[17].ToString(); //每天报警次数 info.pi_version = _content[18].ToString(); info.pi_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info); string Result = c.Exec(); if (Result != "0") { MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
/// <summary> /// 执行过程。 /// </summary> /// <param name="info"></param> /// <param name="resultNo"></param> /// <param name="reason"></param> /// <param name="status"></param> /// <param name="wechatId"></param> /// <param name="alarmcontent"></param> public static void Exec(Pro_IndateBase_Sec_Mod info, out int resultNo, out string reason, out int status, out string wechatId, out string alarmcontent) { Database db = DataConnect.GetConnect; DbCommand cmd = db.GetStoredProcCommand("pro_indatebase_sec"); db.AddInParameter(cmd, ":pi_bigtype", DbType.String, info.pi_bigtype); db.AddInParameter(cmd, ":pi_devicetime", DbType.Date, info.pi_devicetime); db.AddInParameter(cmd, ":pi_devicetype", DbType.String, info.pi_devicetype); db.AddInParameter(cmd, ":pi_devicecode", DbType.String, info.pi_devicecode); db.AddInParameter(cmd, ":pi_protocoltype", DbType.String, info.pi_protocoltype); db.AddInParameter(cmd, ":pi_param1", DbType.String, info.pi_param1); db.AddInParameter(cmd, ":pi_param2", DbType.String, info.pi_param2); db.AddInParameter(cmd, ":pi_param3", DbType.String, info.pi_param3); db.AddInParameter(cmd, ":pi_param4", DbType.String, info.pi_param4); db.AddInParameter(cmd, ":pi_param5", DbType.String, info.pi_param5); db.AddInParameter(cmd, ":pi_param6", DbType.String, info.pi_param6); db.AddInParameter(cmd, ":pi_param7", DbType.String, info.pi_param7); db.AddInParameter(cmd, ":pi_param8", DbType.String, info.pi_param8); db.AddInParameter(cmd, ":pi_param9", DbType.String, info.pi_param9); db.AddInParameter(cmd, ":pi_param10", DbType.String, info.pi_param10); db.AddInParameter(cmd, ":pi_stationno", DbType.String, info.pi_stationno); db.AddInParameter(cmd, ":pi_version", DbType.String, info.pi_version); db.AddInParameter(cmd, ":pi_relayno", DbType.String, info.pi_relayno); db.AddInParameter(cmd, ":pi_servicetime", DbType.Date, info.pi_servicetime); db.AddOutParameter(cmd, ":po_resultnum", DbType.String, 256); db.AddOutParameter(cmd, ":po_reason", DbType.String, 512); db.AddOutParameter(cmd, ":po_status", DbType.String, 256); db.AddOutParameter(cmd, ":po_wechatid", DbType.String, 8192); db.AddOutParameter(cmd, ":po_alarmcontent", DbType.String, 512); db.ExecuteNonQuery(cmd); string resultNum = db.GetParameterValue(cmd, ":po_resultnum").ToString(); if (resultNum != null && resultNum != "") { resultNo = Convert.ToInt16(resultNum); } else { resultNo = 0; } reason = db.GetParameterValue(cmd, ":po_reason").ToString(); string poStatus = db.GetParameterValue(cmd, ":po_status").ToString(); if (poStatus != null && poStatus.ToString() != "") { status = Convert.ToInt16(poStatus); } else { status = 0; } wechatId = db.GetParameterValue(cmd, ":po_wechatid").ToString().Replace(" ", ""); alarmcontent = db.GetParameterValue(cmd, ":po_alarmcontent").ToString(); }
public bool Execute() { try { if (_content.Length != 20) { MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode); return(true); } string DeviceType = ConverUtil.ByteToStr_2(_content, 0); //设备类型 string DeviceId = ConverUtil.ByteToStr_4(_content, 2); //设备Id DateTime time = ConverUtil.Time(_content, 6); //设备时间 string IdentityId = ConverUtil.ByteToStr_Q(_content, 12, 8); //身份证Id Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "10"; info.pi_devicetime = time; info.pi_devicetype = DeviceType; info.pi_devicecode = DeviceId; info.pi_protocoltype = "519"; info.pi_param1 = IdentityId; info.pi_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info); string Result = c.Exec(); if (Result != "0") { MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
public bool Execute() { try { if (_content.Length != 17) { MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode); return(true); } Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "9"; info.pi_protocoltype = "518"; info.pi_devicetime = ConverUtil.Time(_content, 6); //设备时间 info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 0); //设备类型 info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 2); //设备Id info.pi_param1 = ConverUtil.ByteToStr_4(_content, 12); //房间号 info.pi_param2 = _content[16].ToString(); //模块状态 info.pi_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info); string Result = c.Exec(); if (Result != "0") { MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
public Pro_IndateBase_Sec_Bll(Pro_IndateBase_Sec_Mod info) { this.Info = info; }