/// <summary> /// 清空数据 /// </summary> /// <param name="flag"></param> public void ClearData(ClearDataFlag flag) { if (!_Connected) { LJH.GeneralLibrary.LOG.FileLog.Log(Parameter.Name, "清空失败,未连接设备"); return; } bool ret = false; if ((flag & ClearDataFlag.AttendanceLog) == ClearDataFlag.AttendanceLog) { ret = axCZKEM1.ClearData(iMachineNumber, 1); if (!ret) { int idwErrorCode = 0; axCZKEM1.GetLastError(ref idwErrorCode); LJH.GeneralLibrary.LOG.FileLog.Log(Parameter.Name, "清空考勤记录失败,ErrorCode=" + idwErrorCode.ToString()); } } if ((flag & ClearDataFlag.FPTemplate) == ClearDataFlag.FPTemplate) { ret = axCZKEM1.ClearData(iMachineNumber, 2); if (!ret) { int idwErrorCode = 0; axCZKEM1.GetLastError(ref idwErrorCode); LJH.GeneralLibrary.LOG.FileLog.Log(Parameter.Name, "清空指纹模板失败,ErrorCode=" + idwErrorCode.ToString()); } } if ((flag & ClearDataFlag.OperatorLog) == ClearDataFlag.OperatorLog) { ret = axCZKEM1.ClearData(iMachineNumber, 4); if (!ret) { int idwErrorCode = 0; axCZKEM1.GetLastError(ref idwErrorCode); LJH.GeneralLibrary.LOG.FileLog.Log(Parameter.Name, "清空操作记录失败,ErrorCode=" + idwErrorCode.ToString()); } } if ((flag & ClearDataFlag.UserInfo) == ClearDataFlag.UserInfo) { ret = axCZKEM1.ClearData(iMachineNumber, 5); if (!ret) { int idwErrorCode = 0; axCZKEM1.GetLastError(ref idwErrorCode); LJH.GeneralLibrary.LOG.FileLog.Log(Parameter.Name, "清空用户信息失败,ErrorCode=" + idwErrorCode.ToString()); } } }