private void btnOk_Click(object sender, EventArgs e) { try { //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal); //dl.SaveTemplate(_template); //DB.AEF.EnrollDAO dl = new DB.AEF.EnrollDAO(); //dl.SaveTemplate(_template); BLL.mEnroll dl = new BLL.mEnroll(); //DB.AEF.EnrollDAO dl = new DB.AEF.EnrollDAO(); _templateDTO = new FingerprintTemplateDTO(); _templateDTO.Buffer = _template.Buffer; _templateDTO.Quality = _template.Quality; dl.SaveTemplate(_templateDTO); this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); this.DialogResult = DialogResult.Abort; this.Close(); } }
void refFingercore_onImage(object source, GriauleFingerprintLibrary.Events.ImageEventArgs ie) { rawImage = ie.RawImage; SetImage(ie.RawImage.Image); stepCount++; //ExtractTemplate(); try { _template = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate(); int ret = (int)refFingercore.Enroll(ie.RawImage, ref _template, GrTemplateFormat.GR_FORMAT_DEFAULT, FingerprintConstants.GR_DEFAULT_CONTEXT); if (ret >= FingerprintConstants.GR_ENROLL_SUFFICIENT) { //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal); //dl.SaveTemplate(template); if (ret == FingerprintConstants.GR_ENROLL_SUFFICIENT) { SetStatusMessage("Sufficient quality value."); PerformStep(QualityTemplate.SUF, Color.YellowGreen); } else if (ret == FingerprintConstants.GR_ENROLL_GOOD) { SetStatusMessage("Good quality value."); PerformStep(QualityTemplate.GOOD, Color.MediumSeaGreen); } else if (ret == FingerprintConstants.GR_ENROLL_VERY_GOOD) { //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal); //dl.SaveTemplate(_template); BLL.mEnroll dl = new BLL.mEnroll(); //DB.AEF.EnrollDAO dl = new DB.AEF.EnrollDAO(); _templateDTO = new FingerprintTemplateDTO(); _templateDTO.Buffer = _template.Buffer; _templateDTO.Quality = _template.Quality; dl.SaveTemplate(_templateDTO); PerformStep(QualityTemplate.VERYGOOD, Color.SeaGreen); this.DialogResult = DialogResult.OK; this.Close(); } else if (ret == FingerprintConstants.GR_ENROLL_MAX_LIMIT_REACHED) { //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal); //dl.SaveTemplate(_template); //DB.AEF.EnrollDAO dl = new DB.AEF.EnrollDAO(); //dl.SaveTemplate(_template); BLL.mEnroll dl = new BLL.mEnroll(); //DB.AEF.EnrollDAO dl = new DB.AEF.EnrollDAO(); _templateDTO = new FingerprintTemplateDTO(); _templateDTO.Buffer = _template.Buffer; _templateDTO.Quality = _template.Quality; dl.SaveTemplate(_templateDTO); this.DialogResult = DialogResult.OK; this.Close(); } EnableOk(); } else { // WriteLog("The Template does not reach a good quality value"); SetStatusMessage("Please put your finger again"); PerformStep(QualityTemplate.INSF, Color.LightCoral); } } catch { } System.Threading.Thread.Sleep(100); }