コード例 #1
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        /// <summary>
        /// 获取卡号
        /// </summary>
        /// <returns></returns>
        public override int GetCardNo()
        {
            int  iCardNo  = 0;
            byte bSection = 3;
            Dictionary <byte, List <byte> > dicSetcion = EquipmentGeneral.GetCardSectionPieceList();

            try
            {
                if (!ReadCardsPrepare(bSection))
                {
                    return(0);
                }

                YuChuanDevice.rf_beep(_iBeepInterval);
                byte[] arrData  = new byte[16];
                int    iResRead = YuChuanDevice.rf_read(dicSetcion[bSection][1], arrData);
                string strPiece = YuChuanDevice.ChangeHexToString(arrData);
                if (strPiece.Length == 32)
                {
                    string strHexCardNo = strPiece.Substring(2, 1) + strPiece.Substring(3, 1) + strPiece.Substring(0, 1) + strPiece.Substring(1, 1);
                    iCardNo = Convert.ToInt32(strHexCardNo, 16);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            return(iCardNo);
        }
コード例 #2
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        /// <summary>
        /// 获得卡片的固有ID号
        /// </summary>
        /// <returns></returns>
        public override string GetMacID()
        {
            string strMacID = string.Empty;
            string strPwd   = this._strSectionPwd;

            try
            {
                this._strSectionPwd = string.Empty.PadLeft(12, 'F');
                if (!ReadCardsPrepare(0))
                {
                    return(string.Empty);
                }

                YuChuanDevice.rf_beep(_iBeepInterval);

                byte[] arrData  = new byte[16];
                int    iResRead = YuChuanDevice.rf_read(0, arrData);
                strMacID            = YuChuanDevice.ChangeHexToString(arrData).ToUpper();
                this._strSectionPwd = strPwd;
            }
            catch (Exception ex)
            {
                this._strSectionPwd = strPwd;
                throw ex;
            }
            return(strMacID);
        }
コード例 #3
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        /// <summary>
        /// 设置指定卡扇区密码
        /// </summary>
        /// <param name="p_intSector">扇区号</param>
        /// <param name="p_strPassword">密码</param>
        /// <returns></returns>
        public override bool SetCardPassword(int p_intSector, string p_strPassword)
        {
            bool res = false;

            YuChuanDevice.rf_beep(_iBeepInterval);

            try
            {
                if (string.IsNullOrEmpty(p_strPassword))
                {
                    return(res);
                }
                if (p_strPassword.Length != 12)
                {
                    return(res);
                }

                byte[] arrNewPwd = YuChuanDevice.ChangeStrToHex(p_strPassword);

                if (!ReadCardsPrepare((byte)p_intSector))
                {
                    return(false);
                }

                List <byte> listNewPwd = new List <byte>();
                listNewPwd.AddRange(arrNewPwd);
                listNewPwd.AddRange(YuChuanDevice.bCardContentTemplate);

                Dictionary <byte, List <byte> > dicSP = EquipmentGeneral.GetCardSectionPieceList();
                int iPwdPieceNum = dicSP[(byte)p_intSector][3];
                int iResWrite    = YuChuanDevice.rf_write((byte)iPwdPieceNum, listNewPwd.ToArray());
                if (iResWrite == 0)
                {
                    res = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            YuChuanDevice.rf_beep(_iBeepInterval);
            return(res);
        }
コード例 #4
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override decimal GetSubzVal()
        {
            decimal dSubzVal = 0.00M;
            byte    bSection = 2;

            try
            {
                if (!ReadCardsPrepare(bSection))
                {
                    return(0);
                }

                YuChuanDevice.rf_beep(_iBeepInterval);

                Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList();

                byte[] arrData  = new byte[16];
                int    iResRead = YuChuanDevice.rf_read(dicSection[bSection][0], arrData);
                if (iResRead != 0)
                {
                    //读数失败
                    return(0);
                }
                string strPiece = YuChuanDevice.ChangeHexToString(arrData);
                if (strPiece.Length != 32)
                {
                    //读取块数据不完整,不足32位
                    return(0);
                }

                dSubzVal = EquipmentGeneral.HexMoneyToDouble(strPiece.Substring(0, 8));
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(dSubzVal);
        }
コード例 #5
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override bool WriteInitPosVal(decimal dMoney)
        {
            YuChuanDevice.rf_beep(_iBeepInterval);
            byte bSection;

            try
            {
                bSection = 4;
                Dictionary <byte, List <byte> > dicSect = EquipmentGeneral.GetCardSectionPieceList();

                #region 写入初始消费金额数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                //卡内金额
                string strCardVal = EquipmentGeneral.IntToHex((int)(dMoney * 100), 8).PadRight(8, '0');
                strCardVal = strCardVal.Substring(6, 2) + strCardVal.Substring(4, 2) + strCardVal.Substring(2, 2) + strCardVal.Substring(0, 2);

                //卡内金额反码
                string strComplement = EquipmentGeneral.GetComplement(strCardVal);

                string strPieceData = strCardVal + strComplement + strCardVal + this._strPosValCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                byte[] arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                int    iRes    = YuChuanDevice.rf_write(dicSect[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入备份消费金额数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                strPieceData = strCardVal + strComplement + strCardVal + this._strPosValCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                bSection = 5;

                #region 写入初始消费金额数据(备份扇区)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                strPieceData = strCardVal + strComplement + strCardVal + this._strPosValBakCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入备份消费金额数据(备份扇区)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                strPieceData = strCardVal + strComplement + strCardVal + this._strPosValBakCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                bSection = 6;

                #region 写入消费记录初始数据(0号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                strPieceData = DateTime.Now.AddDays(-1).ToString("yyMMdd01");
                strPieceData = strPieceData.PadLeft(24, '0').PadRight(32, '0');
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入消费记录初始数据(1号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入消费记录初始数据(2号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                string strPieceDataTmp = string.Empty.PadLeft(30, '0') + "AA";
                arrData = YuChuanDevice.ChangeStrToHex(strPieceDataTmp);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][2], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion


                bSection = 7;

                #region 写入备份消费记录初始数据(0号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入备份消费记录初始数据(1号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入备份消费记录初始数据(2号位置)

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceDataTmp);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][2], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }
            YuChuanDevice.rf_beep(_iBeepInterval);
            return(true);
        }
コード例 #6
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override List <string> GetPhoneNumList()
        {
            List <string> listPhones = new List <string>();
            byte          bSection   = 10;

            try
            {
                YuChuanDevice.rf_beep(_iBeepInterval);
                Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList();

                if (!ReadCardsPrepare(bSection))
                {
                    return(null);
                }

                byte[] arrData  = new byte[16];
                int    iResRead = YuChuanDevice.rf_read(dicSection[bSection][0], arrData);
                if (iResRead != 0)
                {
                    //读数失败
                    return(null);
                }
                string strPiece = YuChuanDevice.ChangeHexToString(arrData);
                if (strPiece.Length != 32)
                {
                    //读取块数据不完整,不足32位
                    return(null);
                }
                strPiece = strPiece.ToUpper().TrimEnd('F');
                strPiece = Convert.ToChar(Convert.ToInt32(strPiece.Substring(0, 2), 16)).ToString() + strPiece.Substring(2, strPiece.Length - 2);
                listPhones.Add(strPiece);

                string strEmpty = string.Empty;
                strEmpty = strEmpty.PadRight(16, '0');
                for (int i = 0; i < 2; i++)
                {
                    if (!ReadCardsPrepare(bSection))
                    {
                        return(null);
                    }

                    arrData  = new byte[16];
                    iResRead = YuChuanDevice.rf_read(dicSection[bSection][i + 1], arrData);
                    if (iResRead != 0)
                    {
                        //读数失败
                        return(null);
                    }
                    strPiece = YuChuanDevice.ChangeHexToString(arrData);
                    if (strPiece.Length != 32)
                    {
                        //读取块数据不完整,不足32位
                        return(null);
                    }

                    string strPhoneOneTmp = strPiece.Substring(0, 16);
                    string strPhoneTwoTmp = strPiece.Substring(16, 16);
                    if (strPhoneOneTmp != strEmpty)
                    {
                        string strPhoneOne = GetPhoneNum(strPhoneOneTmp);
                        if (!string.IsNullOrEmpty(strPhoneOne) && strPhoneOne.Substring(0, 1) != "1" && strPhoneOne.Length != 7 && strPhoneOne.Length != 8)
                        {
                            strPhoneOne = "0" + strPhoneOne;
                        }
                        listPhones.Add(strPhoneOne);
                    }
                    if (strPhoneTwoTmp != strEmpty)
                    {
                        string strPhoneTwo = GetPhoneNum(strPhoneTwoTmp);
                        if (!string.IsNullOrEmpty(strPhoneTwo) && strPhoneTwo.Substring(0, 1) != "1" && strPhoneTwo.Length != 7 && strPhoneTwo.Length != 8)
                        {
                            strPhoneTwo = "0" + strPhoneTwo;
                        }
                        listPhones.Add(strPhoneTwo);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(listPhones);
        }
コード例 #7
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override bool RechargeSubsidize(decimal p_dMoney)
        {
            try
            {
                byte bSection = 2;
                Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList();

                #region 读第1块

                if (!ReadCardsPrepare((bSection)))
                {
                    return(false);
                }

                byte[] arrData  = new byte[16];
                int    iResRead = YuChuanDevice.rf_read(dicSection[bSection][0], arrData);
                if (iResRead != 0)
                {
                    //读数失败
                    return(false);
                }
                string strPiece8 = YuChuanDevice.ChangeHexToString(arrData);
                if (strPiece8.Length != 32)
                {
                    //读取块数据不完整,不足32位
                    return(false);
                }
                decimal dMoney = EquipmentGeneral.HexMoneyToDouble(strPiece8.Substring(0, 8));

                #endregion

                dMoney = dMoney + p_dMoney;

                #region 写入第1块数据

                if (!ReadCardsPrepare((bSection)))
                {
                    return(false);
                }

                //水控金额
                string strCardVal = EquipmentGeneral.IntToHex((int)(dMoney * 100), 8).PadRight(8, '0');
                strCardVal = strCardVal.Substring(6, 2) + strCardVal.Substring(4, 2) + strCardVal.Substring(2, 2) + strCardVal.Substring(0, 2);

                //水控金额反码
                string strComplement = EquipmentGeneral.GetComplement(strCardVal);

                string strPieceData = strCardVal + strComplement + strCardVal + this._strSubValCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                int iRes = YuChuanDevice.rf_write(dicSection[bSection][0], arrData);
                if (iRes == 0)
                {
                    YuChuanDevice.rf_beep(_iBeepInterval);
                }
                else
                {
                    return(false);
                }

                #endregion

                #region 读第2块

                if (!ReadCardsPrepare((bSection)))
                {
                    return(false);
                }

                arrData  = new byte[16];
                iResRead = YuChuanDevice.rf_read(dicSection[bSection][1], arrData);
                if (iResRead != 0)
                {
                    //读数失败
                    return(false);
                }
                string strPiece9 = YuChuanDevice.ChangeHexToString(arrData);
                if (strPiece9.Length != 32)
                {
                    //读取块数据不完整,不足32位
                    return(false);
                }
                dMoney = EquipmentGeneral.HexMoneyToDouble(strPiece9.Substring(0, 8));

                #endregion

                dMoney = dMoney + p_dMoney;

                #region 写入第2块数据

                if (!ReadCardsPrepare((bSection)))
                {
                    return(false);
                }

                //水控备份金额
                string strCardBakVal = EquipmentGeneral.IntToHex((int)(dMoney * 100), 8).PadRight(8, '0');
                strCardBakVal = strCardBakVal.Substring(6, 2) + strCardBakVal.Substring(4, 2) + strCardBakVal.Substring(2, 2) + strCardBakVal.Substring(0, 2);

                //水控备份金额反码
                string strBakComplement = EquipmentGeneral.GetComplement(strCardBakVal);

                strPieceData = strCardBakVal + strBakComplement + strCardBakVal + this._strSubValBakCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSection[bSection][1], arrData);
                if (iRes == 0)
                {
                    YuChuanDevice.rf_beep(_iBeepInterval);
                }
                else
                {
                    return(false);
                }

                #endregion
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(true);
        }
コード例 #8
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override bool WriteInitUserBasicInfo(PaymentCard payCard)
        {
            YuChuanDevice.rf_beep(_iBeepInterval);
            byte bSection = 3;

            try
            {
                Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList();
                string strPieceData = string.Empty;

                #region 初始化第1块信息数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                //卡号
                string strCardNo = EquipmentGeneral.IntToHex(payCard.No, 4);
                strCardNo = strCardNo.Substring(2, 2) + strCardNo.Substring(0, 2);
                //状态值
                string strState = payCard.Valid ? "80" : "00";
                //注销时间
                string strRegDate = payCard.ExpiryDate.Value.ToString("yyMMdd");
                //功能
                string strFunc = string.Empty;
                if (payCard.FunctionCode.Length == 16)
                {
                    strFunc = EquipmentGeneral.BinToHex(payCard.FunctionCode).PadLeft(4, '0');
                }
                else if (payCard.FunctionCode.Length == 4)
                {
                    strFunc = payCard.FunctionCode;
                }
                else
                {
                    strFunc = string.Empty.PadRight(4, '0');
                }

                //姓名
                string strName = EquipmentGeneral.StrToHex(payCard.Name).PadRight(16, '0');

                strPieceData = strCardNo + strState + strRegDate + strFunc + strName;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                byte[] arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                int    iRes    = YuChuanDevice.rf_write(dicSection[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 初始化第2块信息数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                //卡内最低余额
                string strMinVal = EquipmentGeneral.IntToHex((int)(payCard.LimitRemainder * 100), 8);
                //每日最大消费额
                string strMaxPosVal = EquipmentGeneral.IntToHex((int)(payCard.DailyMaxPayment * 100), 8);
                //时段限次消费次数
                string strIntervalCount = EquipmentGeneral.IntToHex(payCard.Span1PaymentCount, 2) + EquipmentGeneral.IntToHex(payCard.Span2PaymentCount, 2) + EquipmentGeneral.IntToHex(payCard.Span3PaymentCount, 2) + EquipmentGeneral.IntToHex(payCard.Span4PaymentCount, 2);
                //卡片类型
                string strType = EquipmentGeneral.IntToHex(Convert.ToInt32(char.Parse(payCard.Type)), 2);

                strPieceData = strMinVal + payCard.PaymentPassword + strMaxPosVal + strIntervalCount + strType;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSection[bSection][2], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }

            YuChuanDevice.rf_beep(_iBeepInterval);
            return(true);
        }
コード例 #9
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override bool WriteInitContactPhone(string strContactInfo, List <string> listPhoneNums)
        {
            YuChuanDevice.rf_beep(_iBeepInterval);
            byte bSection;

            try
            {
                bSection = 10;
                Dictionary <byte, List <byte> > dicSection = EquipmentGeneral.GetCardSectionPieceList();

                //strContactInfo = Convert.ToString(Convert.ToInt32(char.Parse(strContactInfo.Substring(0, 1))), 16) + strContactInfo.Substring(1, strContactInfo.Length - 1);
                if (string.IsNullOrEmpty(strContactInfo))
                {
                    return(false);
                }

                string strPhoneInfo;
                if (strContactInfo.Length == 9)
                {
                    strContactInfo = Convert.ToString(Convert.ToInt32(char.Parse(strContactInfo.Substring(0, 1))), 16) + strContactInfo.Substring(1, strContactInfo.Length - 1);
                }
                strPhoneInfo = strContactInfo.PadRight(32, 'F');


                #region 初始化卡显示信息

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                byte[] arrData = YuChuanDevice.ChangeStrToHex(strPhoneInfo);
                int    iRes    = YuChuanDevice.rf_write(dicSection[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                string        strPhoneSub   = string.Empty.PadLeft(12, 'F');
                List <string> listPhoneWait = new List <string>();
                for (int i = 0; i < 4; i++)
                {
                    listPhoneWait.Add(strPhoneSub);
                }
                for (int i = 0; i < listPhoneNums.Count; i++)
                {
                    listPhoneWait[i] = listPhoneNums[i].PadLeft(12, '0').PadRight(16, 'F');
                }
                string strPhoneListOne = listPhoneWait[0] + listPhoneWait[1];
                string strPhoneListTwo = listPhoneWait[2] + listPhoneWait[3];

                #region 初始化第一批电话列表

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPhoneListOne);
                iRes    = YuChuanDevice.rf_write(dicSection[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 初始化第二批电话列表

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPhoneListTwo);
                iRes    = YuChuanDevice.rf_write(dicSection[bSection][2], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }

            YuChuanDevice.rf_beep(_iBeepInterval);
            return(true);
        }
コード例 #10
0
ファイル: YuChuanWriter.cs プロジェクト: dandyyang/VPMS
        public override bool WriteInitSubzVal(decimal dMoney)
        {
            Dictionary <byte, List <byte> > dicSect = EquipmentGeneral.GetCardSectionPieceList();
            byte bSection = 2;

            YuChuanDevice.rf_beep(_iBeepInterval);

            try
            {
                #region 写入初始水控金额数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                //水控金额
                string strSubVal = EquipmentGeneral.IntToHex((int)(dMoney * 100), 8).PadRight(8, '0');
                strSubVal = strSubVal.Substring(6, 2) + strSubVal.Substring(4, 2) + strSubVal.Substring(2, 2) + strSubVal.Substring(0, 2);

                //水控金额反码
                string strSubComplement = EquipmentGeneral.GetComplement(strSubVal);

                string strPieceData = strSubVal + strSubComplement + strSubVal + this._strSubValCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                byte[] arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                int    iRes    = YuChuanDevice.rf_write(dicSect[bSection][0], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion

                #region 写入备份水控金额数据

                if (!ReadCardsPrepare(bSection))
                {
                    return(false);
                }

                strPieceData = strSubVal + strSubComplement + strSubVal + this._strSubValBakCRC;
                if (strPieceData.Length != 32)
                {
                    return(false);
                }

                arrData = YuChuanDevice.ChangeStrToHex(strPieceData);
                iRes    = YuChuanDevice.rf_write(dicSect[bSection][1], arrData);
                if (iRes != 0)
                {
                    return(false);
                }

                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }

            YuChuanDevice.rf_beep(_iBeepInterval);
            return(true);
        }