Beispiel #1
0
        private bool CancelScanning()
        {
            DisposeNLComponents();
            CaptureFingerNotifyer(null, null, FingerDescription.Unknown);
            ParentForm.Dispose();

            return(true);
        }
Beispiel #2
0
 private void buttonOk_Click(object sender, EventArgs e)
 {
     if (pictureBoxCroped.Image == null)
     {
         MessageBox.Show(this, @"Please Crop the Picture before you Click OK");
         return;
     }
     CancelWork();
     DisposeNComponents();
     CapturePhotoNotifyer(_croppedPhotoImage, _template.ToArray(), true);
     ParentForm.Dispose();
 }
Beispiel #3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            var fingerQuality = Settings.Default.FQualityThreshold;

            decimal.TryParse(_subjectFinger.Objects[0].Quality.ToString(), out recordQuality);
            if (recordQuality >= fingerQuality)
            {
                CancelWork();
                DisposeNLComponents();
                try
                {
                    var saveStatus = _formSingleScanFinger.SaveBioRecord(_subjectFinger, _subject,
                                                                         _fingerDescription, true);

                    if (saveStatus)
                    {
                        if (_fingerprintScanPosition == 10)
                        {
                            ParentForm.Dispose();
                        }
                        else
                        {
                            _formSingleScanFinger.InitNextFingerScan(_fingerDescription, 0);
                            Dispose();
                        }
                    }
                    else
                    {
                        _formSingleScanFinger.InitNextFingerScan(_fingerDescription, _fingerprintScanPosition);
                        Dispose();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            else
            {
                MessageBox.Show(this,
                                $"Fingerprint image does not meet expected quality of {fingerQuality}. Click on Scan button to re-capture. ",
                                Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #4
0
        private async void resetButton_Click(object sender, System.EventArgs e)
        {
            resetButton.Visible  = false;
            cancelButton.Visible = false;
            loadingPictureBox.Start();
            loadingPictureBox.Visible = true;

            if (await SqlUtility.Write("UPDATE [users] SET [password] = @password WHERE [email] = @email;",
                                       new string[] { newPasswordTextBox.Text, email }, delegate(SqlException ex)
            {
                StopLoading();
            }) != 1)
            {
                return;
            }

            StopLoading();
            MessageBox.Show("Password reset successful!", ChatAppForm.TITLE, MessageBoxButtons.OK, MessageBoxIcon.Information);
            ParentForm.Dispose();
        }
Beispiel #5
0
        private void OnEnrollCompleted(IAsyncResult r)
        {
            Invoke(new Action(() =>
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new AsyncCallback(OnEnrollCompleted), r);
                }
                else
                {
                    var task = _biometricClient.EndPerformTask(r);
                    EnableButtons(false);
                    var status = task.Status;

                    // Check if extraction was canceled
                    if (status == NBiometricStatus.Canceled)
                    {
                        return;
                    }

                    if (status == NBiometricStatus.Ok)
                    {
                        lblQuality.Text = $"Quality: {_subjectFinger.Objects[0].Quality}";

                        decimal.TryParse(_subjectFinger.Objects[0].Quality.ToString(), out recordQuality);

                        //Send the FingerImage and Extracted Template with FingerIdentifyer to MainForm
                        //CaptureFingerNotifyer(image.ToBitmap(), _template.ToArray(),_FingerDescription, true);
                        //This will only be done when the OK button is clicked

                        //AUTOMATICALLY CLICKING THE OK BUTTON
                        var fingerQuality = Settings.Default.FQualityThreshold;
                        if (recordQuality >= fingerQuality)
                        {
                            CancelWork();
                            DisposeNLComponents();

                            try
                            {
                                //var status = CaptureFingerNotifyer(_imageShow.ToBitmap(), fMs.ToArray(), _template.ToArray(), _fingerDescription, true);
                                var saveStatus = _formSingleScanFinger.SaveBioRecord(_subjectFinger, _subject, _fingerDescription, true);

                                if (saveStatus)
                                {
                                    if (_fingerprintScanPosition == 10)
                                    {
                                        ParentForm.Dispose();
                                    }
                                    else
                                    {
                                        _formSingleScanFinger.InitNextFingerScan(_fingerDescription, 0);
                                        Dispose();
                                    }
                                }
                                else
                                {
                                    _formSingleScanFinger.InitNextFingerScan(_fingerDescription, _fingerprintScanPosition);
                                    Dispose();
                                }
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.ToString());
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show($"The template was not extracted: {status}.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        _subject       = null;
                        _subjectFinger = null;
                        EnableButtons(false);
                    }
                }

                if (_subjectFinger == null)
                {
                    EnableButtons(false);
                }
                else
                {
                    EnableButtons(true);
                }
            }));
        }
Beispiel #6
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     DisposeNComponents();
     CapturePhotoNotifyer(null, null);
     ParentForm.Dispose();
 }
Beispiel #7
0
 private void btnLogout_Click(object sender, System.EventArgs e)
 {
     ParentForm.Dispose();
     Login.Show();
 }