public static DJJ_2050_Mod GetMod(byte[] content) { DJJ_2050_Mod info = new DJJ_2050_Mod(); info.源卡ID = ConverUtil.ByteToStr_4(content, 0); info.姓名 = GetName(content.Skip(4).Take(32).ToArray()); info.民族 = GetMinZu(content.Skip(36).Take(10).ToArray()); info.身份信息类型 = content[46].ToString(); info.号码长度 = content[47]; info.证件号码 = GetIdCard(content.Skip(48).Take(info.号码长度).ToArray()); //if (info.号码长度 == content.Length - 48) //{ //} //else //{ // throw er; //} return(info); }
public bool Execute() { try { DJJ_2050_Mod Cm = DJJ_2050_Dal.GetMod(Content); Cm.基站编号 = (uint)StationId; Cm.平台时间 = this.PlatformTime; Pro_InDatabase_LY_Mod info = DJJ_2050_Dal.Get_Pro_Mod(Cm, "2050"); Pro_InDatabase_LY_Bll c = new Pro_InDatabase_LY_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 static Pro_InDatabase_LY_Mod Get_Pro_Mod(DJJ_2050_Mod info, string cmdId) { Pro_InDatabase_LY_Mod m = new Pro_InDatabase_LY_Mod(); m.PI_DEVICETIME = info.平台时间; m.PI_SERVICETIME = info.平台时间; m.PI_DEVICECODE = info.基站编号.ToString(); m.PI_DEVICETYPE = ""; //先传空,吴聪聪确认。 m.PI_PROTOCOLTYPE = cmdId; m.PI_IDENTITYTYPE = info.身份信息类型; m.PI_IDENTITYCARD = info.证件号码; m.PI_IDENTITYNAME = info.姓名; m.PI_NATION = info.民族; m.PI_CARDID = info.源卡ID; return(m); }