private void closeBtn_Click(object sender, EventArgs e) { LogStaff logStaff = new LogStaff(); logStaff.stopAttendance(); this.Close(); }
protected virtual void Process(DPFP.Sample Sample) { // Process the sample and create a feature set for the enrollment purpose. DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification); // Check quality of the sample and start verification if it's good // TODO: move to a separate task if (features != null) { List <Staff> staffs; // Compare the feature set with our template using (ModelContext db = new ModelContext()) { staffs = db.Staffs.ToList(); } Template = new DPFP.Template(); foreach (var staff in staffs) { if (staff.Fingerprint != null) { Template.DeSerialize(staff.Fingerprint); DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); Verificator.Verify(features, Template, ref result); if (result.Verified) { verPicBox.Invoke(new Action(() => { verPicBox.ImageLocation = staff.ImageUrl; verPicBox.Visible = true; })); rptLbl.Invoke(new Action(() => rptLbl.Text = $"{staff.Lastname} {staff.Firstname} VERIFIED.")); LogStaff logStaff = new LogStaff(); switch (logStaff.LogAttendance(staff)) { case 0: rptLbl.Invoke(new Action(() => rptLbl.Text = $"{staff.Lastname} {staff.Firstname} already logged.")); break; case 1: rptLbl.Invoke(new Action(() => rptLbl.Text = $"{staff.Lastname} {staff.Firstname} Goodbye!.")); break; case 2: rptLbl.Invoke(new Action(() => rptLbl.Text = $"{staff.Lastname} {staff.Firstname} Welcome!.")); break; default: rptLbl.Invoke(new Action(() => rptLbl.Text = $"error")); break; } ; break; } else { rptLbl.Invoke(new Action(() => rptLbl.Text = "The fingerprint was NOT VERIFIED.")); } } } } }