//public ArrayList GetRawFingerCollection(string id) //{ // //byte[] buffer = new byte[1]; // byte[][] buffer = new byte[11][]; // //ArrayList fingersCollection = null; // //if (getAppSetting("Enroll") == "db") // if (_settings["enroll"] == "db") // { // //var ds = new Database(_settings); // DataSource ds = null; // if (_settings["dbProvider"] == "dedicatedServer") // ds = new DAO.Database(_settings); // else if (_settings["dbProvider"] == "cloudServer") // ds = new DAO.CloudDatabase(_settings); // else // throw new Exception("Wrong database provider settings"); // buffer = ds.GetImage(IMAGE_TYPE.wsq, Convert.ToInt32(id)); // var biometricService = new WSQImageServiceClient(); // //byte[] buffer2 = buffer[0]; // try // { // //_fingersCollection = biometricService.DeserializeWSQArray(buffer); // _fingersCollection = biometricService.processRawData(buffer); // } catch(Exception ex) // { // throw new Exception(ex.Message); // } // //var bioProcessor = new BioProcessor.BioProcessor(); // //bioProcessor.DeserializeWSQArray(buffer, out fingersCollection); // } // return _fingersCollection; // //return buffer[0]; //} public ArrayList GetQualityFingerCollection(string id) { if (IsDirty(id)) { _fingersCollection = null; MemoryCache.Default["dirty"] = "true"; //byte[] buffer = new byte[1]; byte[][] buffer = new byte[11][]; //ArrayList fingersCollection = null; //if (getAppSetting("Enroll") == "db") if (_settings["enroll"] == "db") { DataSource ds = null; if (_settings["dbProvider"] == "dedicatedServer") ds = new DAO.Database(_settings); else if (_settings["dbProvider"] == "cloudServer") ds = new DAO.CloudDatabase(_settings); else throw new Exception("Wrong database provider settings"); //if (getAppSetting("provider") == "directDb") //ds = new Database(_settings); //else if (getAppSetting("provider") == "directWebService") // ds = new CloudDatabase(); //if (getAppSetting("fingerTemplates") == "yes") //buffer = ds.GetImage(IMAGE_TYPE.fingerTemplates, Convert.ToInt32(id)); //else buffer = ds.GetImage(IMAGE_TYPE.wsq, Convert.ToInt32(id)); if (buffer[0] != null) { var biometricService = new WSQImageServiceClient(); _fingersCollection = biometricService.processEnrolledData(buffer); //var bioProcessor = new BioProcessor.BioProcessor(); //bioProcessor.processEnrolledData(buffer, out fingersCollection); MemoryCache.Default["id"] = id; if (_fingersCollection != null) { MemoryCache.Default["fingersCollection"] = _fingersCollection; MemoryCache.Default["dirty"] = "false"; } } } return _fingersCollection; } else return MemoryCache.Default["fingersCollection"] as ArrayList; }
public void saveWsqInDatabase(int id, byte[] buffer) { var biometricService = new WSQImageServiceClient(); biometricService.SaveWSQImage(id, buffer); }