Exemplo n.º 1
0
 public IndictmentForm()
 {
     InitializeComponent();
     TxtBox_Yearin.Focus();
     TxtBox_ID8.SelectAll();
     TxtBox_ID13.SelectAll();
     TxtBox_Name.SelectAll();
     TxtBox_Sname.SelectAll();
     AddEnterKeyDown();
 }
Exemplo n.º 2
0
 private void Btn_Search_Click(object sender, EventArgs e)
 {
     dcore = new DataCoreLibrary();
     page  = 1;
     Search(gv_result);
     TxtBox_Yearin.Focus();
     TxtBox_ID8.SelectAll();
     TxtBox_ID13.SelectAll();
     TxtBox_Name.SelectAll();
     TxtBox_Sname.SelectAll();
     GVsSetAutoSizeColumns();
 }
Exemplo n.º 3
0
 void NameForm_Shown(object sender, EventArgs e)
 {
     TxtBox_Name.Text = string.Empty;
     TxtBox_Name.Focus();
 }
Exemplo n.º 4
0
        private void OnCaptured(CaptureResult captureResult)
        {
            Application.Current.Dispatcher.Invoke((Action) delegate
            {
                Snackbar_Recorded.IsActive = false;
            });
            try
            {
                if (!fingerprintReader.CheckCaptureResult(captureResult))
                {
                    return;
                }

                DataResult <Fmd> resultConversion = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI);
                if (captureResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                {
                    fingerprintReader.CurrentReader.Reset();
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        Snackbar_Recorded.IsActive = true;
                        SnackBar_Message.Text      = "Sorry, please try again.";
                    });
                    throw new Exception(captureResult.ResultCode.ToString());
                }

                // See the SDK documentation for an explanation on threshold scores.
                int            thresholdScore = DPFJ_PROBABILITY_ONE * 1 / 100000;
                IdentifyResult identifyResult = Comparison.Identify(resultConversion.Data, 0, studentFmds.ToArray(), thresholdScore, studentFmds.Count);
                if (identifyResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                {
                    throw new Exception(identifyResult.ResultCode.ToString());
                }

                if (identifyResult.Indexes.Length > 0)
                {
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        string findStudentId = studentIds.ElementAt(identifyResult.Indexes[0][0]);
                        UpdateStudentInformation(findStudentId);
                        if (IsAttendedAlready(findStudentId))
                        {
                            SnackBar_Message.Text      = "Your attendance is already recorded.";
                            Snackbar_Recorded.IsActive = true;
                        }
                        else
                        {
                            if (SaveAttendancetoDatabase(findStudentId))
                            {
                                SnackBar_Message.Text      = "Successful, your attendance is recorded.";
                                Snackbar_Recorded.IsActive = true;
                                AttendedIds.AddFirst(findStudentId);
                            }
                            else
                            {
                                SnackBar_Message.Text      = "Sorry, that doesn't work. Please try again.";
                                Snackbar_Recorded.IsActive = true;
                            }
                        }
                    });
                }
                else
                {
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        TxtBox_StudentID.Clear();
                        TxtBox_Name.Clear();
                        TxtBox_Course.Clear();
                        TxtBox_Year.Clear();
                        SnackBar_Message.Text      = "Sorry, that doesn't work. Please try again.";
                        Snackbar_Recorded.IsActive = true;
                    });
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error while capturing the fingerprint.\nPlease try again later." + ex, "Error Fingerprint", MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Dispatcher.Invoke((Action) delegate
                {
                    this.Close();
                });
            }
        }