public override bool SaveData(string fid, string cardid, bool IsChangingPass, string dbcontrolstr = null) { bool result = false; if (_driver is ReaderM1S50Method) { string msg = string.Empty; ReaderM1S50Method reader = _driver as ReaderM1S50Method; if (reader.MifareAuthHex(SectionNo, this.Block3.CurrentPasswordA, out msg) || reader.MifareAuthHex(SectionNo, this.Block3.CurrentPasswordB, out msg)) { result = this.Block0.SaveData(SectionNo); if (result) { result = this.Block1.SaveData(SectionNo); } if (result) { result = this.Block2.SaveData(SectionNo); } if (result && IsChangingPass) { result = this.Block3.SaveData(SectionNo, fid, cardid, dbcontrolstr); } } } return(result); }
public ZY2000Card(ReaderM1S50Method ReaderMethod, IPassword ipassword) : base() { _ReaderMethod = ReaderMethod; _Ipassword = ipassword; Section0 = new ZY2000Section0(ReaderMethod, ipassword); Section1 = new ZY2000Section1(ReaderMethod, ipassword); Section2 = new ZY2000Section2(ReaderMethod, ipassword); }
public virtual bool SaveData(int sectionid, string fid = null, string cardid = null, string dbcontrolstr = null) { bool result = true; if (_driver is ReaderM1S50Method) { string msg; ReaderM1S50Method reader = _driver as ReaderM1S50Method; byte[] data = reader.HexToBin(this.GetData()); result = reader.MifareWrite(sectionid * 4 + BlockNo, data, out msg); } HasChanged = false;; //return string.Empty; return(result); }
public HYYY_R6U141_M1S50(IPassword ipassword) { _ReaderMethod = new ReaderM1S50Method(); _card = new ZY2000Card(_ReaderMethod, ipassword); }