示例#1
0
        private async void EndButton_Click(object sender, RoutedEventArgs e)
        {
            //try
            //{
            string duration = ht.Text + ":" + mt.Text + ":" + st.Text;

            DatabaseManagement.InsertLectureData(txtbxLecName.Text, gloablvalue.CurrentId, datetime, duration, txtbxRoom.Text);
            mytimer.Stop();
            HideFINGER.Stop();
            ShowFINGER.Stop();
            gloablvalue.NewLecId = "";
            //try
            //{
            await BluetoothConnection.SendCommand(",");

            Frame.Navigate(typeof(AllLec));
            //}
            //catch (Exception)
            //{
            //    var dialo2g = new MessageDialog("device not ending the fingerprint..!");
            //    await dialo2g.ShowAsync();
            //}
            //}
            //catch (Exception)
            //{
            //    var dialog = new MessageDialog("Error in insert lecture data !");
            //    await dialog.ShowAsync();
            //}
        }
示例#2
0
        private async void ShowFINGER_Completed(object sender, object e)
        {
            FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
            if (gloablvalue.checksend(gloablvalue.RecivedText) == "Stored!")
            {
                FingerStatusText.Text   = "Id = " + newfpid.Text + " Stored!";
                btnAdd.IsEnabled        = true;
                gloablvalue.RecivedText = "";
                HideFINGER.Stop();
                ShowFINGER.Stop();
            }
            else if (gloablvalue.checksend(gloablvalue.RecivedText) == "Fingerprints did not match")
            {
                FingerStatusText.Text = "Fingerprints did not match"
                                        + "\r\n" + "Click on Take fingerprint to try again";
                HideFINGER.Stop();
                ShowFINGER.Stop();
                await BluetoothConnection.SendCommand("+");

                FINGER.IsTapEnabled   = true;
                BtN_Menu.IsTapEnabled = true;
            }
            else
            {
                FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
                //FingerStatusText.Text = "Error at receiving, please click again";
                //HideFINGER.Stop();
                //ShowFINGER.Stop();
                //await BluetoothConnection.SendCommand("+");
                //FINGER.IsTapEnabled = true;
                //BtN_Menu.IsTapEnabled = true;
                HideFINGER.Begin();
            }
        }
示例#3
0
        private async void HideFINGER_Completed(object sender, object e)
        {
            FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
            gloablvalue.attendid  = gloablvalue.checksend(gloablvalue.RecivedText);

            if (gloablvalue.attendid == "F")
            {
                FingerStatusText.Text = "Put your finger!";
            }
            else
            {
                FingerStatusText.Text = gloablvalue.attendid;
                await DatabaseManagement.SearchStudentFingerPrint(studentid, Acadimicid, studentname, fingerprintid); //get fingerprint was get from fingerprint and search on student id if found return it

                if (studentid.Text == "NULL")
                {
                    FingerStatusText.Text = "An error occured!";
                }
                else if (studentid.Text == "Not Found")
                {
                    FingerStatusText.Text = "Id = " + gloablvalue.attendid + " not stored!";
                }
                else
                {
                    await DatabaseManagement.CheckAttend(state);

                    if (state.Text == "Not Found")
                    {
                        DatabaseManagement.InsertAllStudentsInLecData(gloablvalue.NewLecId, studentid.Text, Acadimicid.Text, studentname.Text, fingerprintid.Text);
                        FingerStatusText.Text = "Done id = " + gloablvalue.attendid;
                    }
                    else if (state.Text == "Found")
                    {
                        FingerStatusText.Text = "Id = " + gloablvalue.attendid + " Attend Before";
                    }
                    else
                    {
                        FingerStatusText.Text = "An error occured!";
                    }
                }
                //try
                //{
                await BluetoothConnection.SendCommand("-");

                //}
                //catch (Exception)
                //{
                //    var dialo2g = new MessageDialog("error in start device, click again.");
                //    await dialo2g.ShowAsync();
                //}
            }
            ShowFINGER.Begin();
        }