/// <summary> /// 设置电话区密码 /// </summary> //public void InitPhoneSector() //{ // JocatDevice.SetCardPassword(m_intComPort, "10", m_strPhonePassword); //} /// <summary> /// 设置用水收集卡 /// </summary> public void ResetWaterCollectCard() { //设置读卡器密码 JocatDevice.SetReaderPassWord(m_intComPort, m_strWaterCollectCardPW); //写入资料 JocatDevice.WriteCard(m_intComPort, "9", 2, m_strCollectionNormal + m_strCollectionNormal); }
/// <summary> /// 设置热水管理卡 /// </summary> public void SetWaterAdminCard(string p_strPassword, int p_intPreUse, int p_intDailyUse, decimal p_decPrice) { //设置读卡器密码 JocatDevice.SetReaderPassWord(m_intComPort, m_strAdminPassword); string l_strCRC = "FFFF9E10"; string l_strPreUse = EquipmentGeneral.IntToHexInSorting(p_intPreUse, 4); string l_strDailyUse = EquipmentGeneral.IntToHexInSorting(p_intDailyUse, 4); string l_strPrice = EquipmentGeneral.IntToHexInSorting(Convert.ToInt32(p_decPrice * 100), 4); string l_strAdmin = p_strPassword + l_strPreUse + l_strDailyUse + l_strPrice + l_strCRC; //写入数据 JocatDevice.WriteCard(m_intComPort, "9", 2, l_strAdmin + l_strAdmin); }
/// <summary> /// 设置水表管理卡 /// </summary> /// <param name="watermeterPassword">水表消费密码</param> /// <param name="amountInEach">单次用水限额</param> /// <param name="amountInDay">日用水限额</param> /// <param name="unitPrice">每升价格</param> /// <returns></returns> public override bool SetWatermeterAdminCard(int port, string paymentPassword, int eachTimeMaxinumNumber, int dailyMaxinumNumber, decimal unitPrice) { byte bSection = 2; bool isSccess = false; string strPiece = EquipmentGeneral.GetCardSectionPieceList()[bSection][1].ToString(); string l_strEachAmount = EquipmentGeneral.IntToHexInSorting(eachTimeMaxinumNumber, 4); string l_strMaxAmount = EquipmentGeneral.IntToHexInSorting(dailyMaxinumNumber, 4); decimal fUPrice = unitPrice * 100; int uPrice = Convert.ToInt32(fUPrice); string l_strUnitPrice = EquipmentGeneral.IntToHexInSorting(uPrice, 4); string l_strWaterInfo = paymentPassword + l_strEachAmount + l_strMaxAmount + l_strUnitPrice + "FFFF"; l_strWaterInfo = l_strWaterInfo + DataConvert.GetCRC16Code(l_strWaterInfo); isSccess = JocatDevice.WriteCard(port, strPiece, 2, l_strWaterInfo + l_strWaterInfo); return(isSccess); }
/// <summary> /// 设置亲情号码资料 /// </summary> /// <param name="p_strPhoneInfo">亲情号码卡信息</param> /// <param name="p_lisPhones">亲情号码</param> /// <returns></returns> public bool WriteFamilyPhones(string p_strPhoneInfo, List <string> p_lisPhones) { byte bSection = 10; Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList(); string l_strPhoneInfo = p_strPhoneInfo + "FFFFFFFFFFFFFFFFFFFFFF"; string l_strPhoneNo1 = FormatPhoneNo(p_lisPhones[0], p_lisPhones[1]); string l_strPhoneNo2 = FormatPhoneNo(p_lisPhones[2], p_lisPhones[3]); if (l_strPhoneInfo.Length != 32) { throw new Exception("亲情号码卡信息格式不正确。"); } if ((l_strPhoneNo1 + l_strPhoneNo2).Length != 64) { throw new Exception("亲情号码格式不正确。"); } return(JocatDevice.WriteCard(m_intComPort, dicSection[bSection][0].ToString(), 3, l_strPhoneInfo + l_strPhoneNo1 + l_strPhoneNo2)); }