Example #1
0
        private async void FINGER_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (Validations.CheckTextBox(tbxName, tbxAcadimicId).Equals(true))
            {
                var dialog = new MessageDialog("Check Valuing fields");
                await dialog.ShowAsync();
            }
            else
            {
                try
                {
                    await DatabaseManagement.CountAllStudentsData(newfpid);

                    try
                    {
                        await BluetoothConnection.SendCommand(newfpid.Text);

                        FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
                        FINGER.IsTapEnabled   = false;
                        HideFINGER.Begin();
                        BtN_Menu.IsTapEnabled = false;
                    }
                    catch (Exception)
                    {
                        FingerStatusText.Text = "error in sending fingerprint id !";
                    }
                }
                catch (Exception)
                {
                    FingerStatusText.Text = "error in count student data!";
                }
            }
        }
Example #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            navigationHelper.OnNavigatedTo(e);
            if (gloablvalue.Currenttype != "Admin")
            {
                NewAccountBtn.Visibility  = Visibility.Collapsed;
                AllAccountsBtn.Visibility = Visibility.Collapsed;
                AddStudentBtn.Visibility  = Visibility.Collapsed;
                AllStudentsBtn.Visibility = Visibility.Collapsed;
            }
            else
            {
                NewLecBtn.Visibility = Visibility.Collapsed;
                AllLecBtn.Visibility = Visibility.Collapsed;
            }

            try
            {
                await BluetoothConnection.SendCommand("+");

                FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
            }
            catch (Exception)
            {
                FingerStatusText.Text = "An error occured!";
            }
        }
Example #3
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();
            }
        }
Example #4
0
        private async void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            //try
            //{
            DatabaseManagement.InsertAllStudentsData(tbxAcadimicId.Text, tbxName.Text, newfpid.Text);
            var dlg = new MessageDialog(tbxName.Text + " added.");
            await dlg.ShowAsync();

            tbxAcadimicId.Text  = "";
            tbxName.Text        = "";
            FINGER.IsTapEnabled = true;
            btnAdd.IsEnabled    = false;
            //try
            //{
            await BluetoothConnection.SendCommand("+");

            FingerStatusText.Text = gloablvalue.checksend(gloablvalue.RecivedText);
            BtN_Menu.IsTapEnabled = true;
            //}
            //catch (Exception)
            //{
            //    var dlg2 = new MessageDialog("error to run device again!");
            //    await dlg.ShowAsync();
            //    BtN_Menu.IsTapEnabled = true;
            //}
            //}
            //catch (Exception)
            //{
            //    var dlg = new MessageDialog("error to add in database!");
            //    await dlg.ShowAsync();
            //}
        }
Example #5
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();
            //}
        }
Example #6
0
        private async void ShowFINGER_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();
                //}
            }
            HideFINGER.Begin();
        }
Example #7
0
        protected async override void OnNavigatedFrom(NavigationEventArgs e)
        {
            navigationHelper.OnNavigatedFrom(e);
            try
            {
                await BluetoothConnection.SendCommand(",");

                //gloablvalue.RecivedText = "";
                //gloablvalue.Status = "";
            }
            catch (Exception)
            {
                FingerStatusText.Text = "An error occured!";
            }
        }
Example #8
0
        private async void FINGERIMG_Tapped(object sender, TappedRoutedEventArgs e)
        {
            //try
            //{
            await BluetoothConnection.SendCommand("-");

            HideFINGER.Begin();
            FINGERIMG.IsTapEnabled = false;
            Title2.Text            = "Taking attendance..";
            //}
            //catch (Exception)
            //{
            //    var dialo2g = new MessageDialog("error in start device, click again.");
            //    await dialo2g.ShowAsync();
            //}
        }