public static void Insert(Tb_LKCommunityRecord_Mod info) { Database db = DataConnect.GetConnect; string Sql = "Insert into tb_lkcommunityrecord(recordid,DeviceId, RecordTime, DeviceTime, CardId, IdCard, CardType, Reserve)values(SEQ_COMMUNITYID.nextval,:DeviceId, :RecordTime, :DeviceTime, :CardId,:IdCard, :CardType, :Reserve)"; DbCommand cmd = db.GetSqlStringCommand(Sql); db.AddInParameter(cmd, ":DeviceId", DbType.String, info.DeviceId); db.AddInParameter(cmd, ":RecordTime", DbType.Date, info.RecordTime); db.AddInParameter(cmd, ":DeviceTime", DbType.Date, info.DeviceTime); db.AddInParameter(cmd, ":CardId", DbType.String, info.CardId); db.AddInParameter(cmd, ":IdCard", DbType.String, info.IdCard); db.AddInParameter(cmd, ":CardType", DbType.String, info.CardType); db.AddInParameter(cmd, ":Reserve", DbType.String, info.Reserve); db.ExecuteNonQuery(cmd); }
private void Single(byte[] content) { try { Tb_LKCommunityRecord_Mod info = new Tb_LKCommunityRecord_Mod(); info.DeviceId = StationId.ToString(); info.RecordTime = DateTime.Now; info.DeviceTime = ConverUtil.Time(content, 0); info.CardType = content[6].ToString(); //身份证卡类型09信息为8位,IC卡类型05信息为4位; info.CardId = CardId(info.CardType, content); info.Reserve = ConverUtil.ByteToStr_Q(content, 7, 3); info.IdCard = DataJM.SFZ_Str(content, 18); FileManagementDal.SocialAppTerminal.Tb_LKCommunityRecord_Dal.Insert(info); } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode); } }