/// <summary> /// Ons the enter tests click. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> /// <exception cref="InvalidOperationException"></exception> private void onEnterTestsClick(object sender, RoutedEventArgs e) { this.enterTestFlyout.Hide(); TestDatabaseAccess tdb = new TestDatabaseAccess(); var testObject = this.testDataView.SelectedItem; var testid = testObject as Test; var flyoutCheckboxIsChecked = this.flyoutCheckbox.IsChecked; bool isAbnormal = flyoutCheckboxIsChecked != null && (bool)flyoutCheckboxIsChecked; var result = this.flyoutTextBox.Text; var dateTime = new DateTime(this.datePicker.Date.Year, this.datePicker.Date.Month, this.datePicker.Date.Day, this.timePicker.Time.Hours, this.timePicker.Time.Minutes, 0); tdb.EditTestResults(result, !isAbnormal, int.Parse(testid?.TestId ?? throw new InvalidOperationException()), dateTime); this.flyoutTextBox.Text = ""; this.flyoutCheckbox.IsChecked = false; this.updateTests(); }
/// <summary> /// Handles the OnClick event of the ConfirmButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private async void ConfirmButton_OnClick(object sender, RoutedEventArgs e) { if (this.order.Order.Count > 0) { TestDatabaseAccess tdb = new TestDatabaseAccess(); foreach (var test in this.order.Order) { tdb.AddTests(test); } this.confirmationFlyout.Hide(); this.Hide(); } else { var message = new MessageDialog("You must add tests to your order to place one!", "Order Empty!"); await message.ShowAsync(); this.confirmationFlyout.Hide(); } }
private List <Test> getTests() { TestDatabaseAccess tbd = new TestDatabaseAccess(); var testStringList = tbd.GetTests(this.appointmentid); var tests = new List <Test>(); foreach (var test in testStringList) { var test1 = new Test(test[1]) { TestId = test[0] }; var date = DateTime.Parse(test[3]); test1.DatePerformed = date; test1.TestResults = test[4]; test1.IsNormal = bool.Parse(test[5]); tests.Add(test1); } return(tests); }