public bool Execute() { try { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string RoomCardType = _content[6].ToString(); //房卡类型。 string OldIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //原身份证Id. string NewCardType = _content[15].ToString(); //房卡类型。 string NewIdentitycardId = ConverUtil.ByteToStr_Q(_content, 16, 8); //新身份证Id. string NewIdentitycard = SFZUtil.ByteToStr(_content, 24); //新身份证。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF003 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "9"; //0x01 info.pi_lordcardtype = RoomCardType; info.pi_lordidentitycardid = OldIdentitycardId; info.pi_cardtype = NewCardType; info.pi_identitycardid = NewIdentitycardId; info.pi_identitycard = NewIdentitycard; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string CardType = _content[6].ToString(); //卡类型。 string IdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //身份证Id. string Identitycard = SFZUtil.ByteToStr(_content, 15); string HomeNum = _content[24].ToString(); //房东编号 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF004 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "1"; //0x01 info.pi_cardtype = CardType; info.pi_identitycardid = IdentitycardId; info.pi_identitycard = Identitycard; info.pi_houseno = HomeNum; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 != 10) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } string SimCardNum = ConverUtil.ByteToStr_Q(_content, 0, 10); //SIM卡串号 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "67"; //0x0043 info.pi_devicetime = PlatformTime; info.pi_devicetype = ""; info.pi_devicecode = StationId.ToString(); info.pi_param1 = SimCardNum; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 != 1) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } string AlarmState = _content[0].ToString(); //报警状态 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "23"; //0x0017 info.pi_devicetime = PlatformTime; info.pi_devicecode = StationId.ToString(); info.pi_param1 = AlarmState; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { int length = 12; int count = _content.Length / length; DateTime DeviceTime; string MacAddress = ""; for (int i = 0; i < count; i++) { DeviceTime = ConverUtil.Time(_content, i * length); //设备时间。 MacAddress = ConverUtil.ByteToStr_Q(_content, 6 + (i * length), 6); //Mac地址。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61446"; //0xF006 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_param1 = MacAddress; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 != 9) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间 string VersionNum = ConverUtil.ByteToStr_2(_content, 6); //版本号 string SignalStrength = _content[8].ToString(); //信号强度 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "5"; //0x0005 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = ""; info.pi_version = VersionNum; info.pi_param1 = SignalStrength; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; info.pi_devicetime = ConverUtil.Time(Content, 0); //设备时间。 info.pi_protocoltype = "12"; info.pi_lordcardtype = Data(Type.房东卡类型, Content); //房东卡类型。 info.pi_lordidentitycardid = Data(Type.房东卡身份证ID, Content); //房东卡身份证ID。 info.pi_cardtype = Data(Type.E居卡卡类型, Content); //E居卡卡类型。 info.pi_cardid = Data(Type.E居卡卡号, Content); //E居卡卡号。 info.pi_identitycardid = Data(Type.用户身份证ID, Content); //用户身份证ID。 info.pi_identitycard = Data(Type.用户身份证号码, Content); //用户身份证号码。 info.pi_param2 = Data(Type.用户卡类型, Content); //用户卡类型。 info.pi_param1 = Data(Type.用户卡卡号, Content); //用户卡卡号。 info.pi_houseno = Data(Type.房东编号, Content); //房东编号。 info.pi_roomno = Data(Type.房间号, Content); //房间号。 info.pi_devicecode = StationId.ToString(); info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string HomeCardType = _content[6].ToString(); //房东卡类型. string HomeCardIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //房东卡身份证ID. string CardType = _content[15].ToString(); //卡类型。 string CardId = ""; byte[] EJUcardNum = new byte[4]; //E居卡卡号 Array.Copy(_content, 16, EJUcardNum, 0, 4); if (CardType == "9") { CardId = ConverUtil.ByteToStr_A(EJUcardNum); } else { CardId = (Convert.ToUInt32(ConverUtil.ByteToStr_A(EJUcardNum), 16)).ToString(); } string UserIdentitycardId = ConverUtil.ByteToStr_Q(_content, 20, 8); //用户身份证ID。 string Identitycard = SFZUtil.ByteToStr(_content, 28); //身份证。 string HomeNum = _content[37].ToString(); //房东编号。 string RoomNum = ConverUtil.ByteToStr_2(_content, 38); //房间号。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF004 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "4"; //0x01 info.pi_lordcardtype = HomeCardType; info.pi_lordidentitycardid = HomeCardIdentitycardId; info.pi_cardtype = CardType; info.pi_cardid = CardId; info.pi_identitycardid = UserIdentitycardId; info.pi_identitycard = Identitycard; info.pi_houseno = HomeNum; info.pi_roomno = RoomNum; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string HomeCardType = _content[6].ToString(); //房东卡类型。 string HomeIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //房东身份Id. string CardType = _content[15].ToString(); //卡类型。 string pi_cardid = ""; byte[] ShenFenZhengID = new byte[8]; Array.Copy(_content, 16, ShenFenZhengID, 0, 8); if (CardType == "5") { pi_cardid = (Convert.ToUInt64(ConverUtil.ByteToStr_A(ShenFenZhengID), 16)).ToString(); } if (CardType == "9") { pi_cardid = ConverUtil.ByteToStr_A(ShenFenZhengID); } string HomeNum = _content[24].ToString(); //房东编号。 string RoomNum = ConverUtil.ByteToStr_2(_content, 25); //房间号。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF004 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "7"; //0x01 info.pi_lordcardtype = HomeCardType; info.pi_lordidentitycardid = HomeIdentitycardId; info.pi_cardtype = CardType; info.pi_cardid = pi_cardid; info.pi_houseno = HomeNum; info.pi_roomno = RoomNum; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string CardType = _content[6].ToString(); //卡类型。 byte[] CardNum = new byte[8]; Array.Copy(_content, 7, CardNum, 0, 8); string CardId = ""; if (CardType == "9") { CardId = ConverUtil.ByteToStr_A(CardNum); } else { CardId = Convert.ToUInt64(ConverUtil.ByteToStr_A(CardNum), 16).ToString(); } string Identitycard = SFZUtil.ByteToStr(_content, 15); //身份证号码。 string HomeNum = _content[24].ToString(); //房东编号 string RoomNum = ConverUtil.ByteToStr_2(_content, 25); //房间号。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61444"; //0xF004 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "2"; //0x01 info.pi_cardtype = CardType; info.pi_cardid = CardId; info.pi_identitycard = Identitycard; info.pi_houseno = HomeNum; info.pi_roomno = RoomNum; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); 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 != 6) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } string DoorState = _content[0].ToString(); //门状态。 string DoorOpenTime = ConverUtil.ByteToStr_2(_content, 1); //门敞开时间。 string LookSpeedState = _content[3].ToString(); //锁加速度状态。 string BigChangeValue = ConverUtil.ByteToStr_2(_content, 4); //最大变哈值。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "22"; //0x0016 info.pi_devicetime = PlatformTime; info.pi_devicecode = StationId.ToString(); info.pi_param1 = DoorState; info.pi_param2 = DoorOpenTime; info.pi_param3 = LookSpeedState; info.pi_param4 = BigChangeValue; info.pi_servicetime = PlatformTime; string Result = IMj2Dal.Insert(info); if (Result != "0") { MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }