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!"; } } }
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(); } }
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(); //} }
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(); }
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(); //} }