/// <summary> /// 14字节处理程序。 /// </summary> /// <param name="content"></param> private void Single_14(byte[] content) { try { Pro_ShipDevice_Card_Mod info = new Pro_ShipDevice_Card_Mod(); info.Pi_DevId = StationId.ToString(); //设备编号 info.Pi_DevTime = ConverUtil.Time(content, 0); //设备时间 info.Pi_CardNo = ConverUtil.ByteToStr_Q(content, 6, 8); //身份证Id。 UInt16 ResultNum; string Reason; Pro_ShipDevice_Card_Dal.Exec(info, out ResultNum, out Reason); if (ResultNum != 0) { MyLibrary.Log.Debug(Name + "出错;" + Reason + " 原始代码:" + OriginalCode); } } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode); } }
public static void Exec(Pro_ShipDevice_Card_Mod info, out UInt16 resultNum, out string reason) { Database db = DataConnect.GetConnect; DbCommand cmd = db.GetStoredProcCommand("PRO_SHIPDEVICE_CARD"); db.AddInParameter(cmd, ":pi_devid", DbType.String, info.Pi_DevId); db.AddInParameter(cmd, ":pi_devtime", DbType.Date, info.Pi_DevTime); db.AddInParameter(cmd, ":pi_cardno", DbType.String, info.Pi_CardNo); db.AddOutParameter(cmd, ":po_ret", DbType.String, 256); db.AddOutParameter(cmd, ":po_content", DbType.String, 256); db.ExecuteNonQuery(cmd); string Result = db.GetParameterValue(cmd, ":po_ret").ToString(); if (string.IsNullOrEmpty(Result)) { resultNum = 1; } else { resultNum = Convert.ToUInt16(Result); } reason = db.GetParameterValue(cmd, ":po_content").ToString(); }