private void buttonSaveResults_Click(object sender, EventArgs e) { if (this.currentTestHasResults) { bool successful = LabTestResultDAL.UpdateResults(this.order.OrderId, this.currentTestCode, this.textBoxResults.Text, this.checkBoxAbnormal.Checked, this.dateTimePickerTest.Value); if (!successful) { MessageBox.Show("Updating test results failed!"); return; } } else { bool successful = LabTestResultDAL.AddResults(this.order.OrderId, this.currentTestCode, this.textBoxResults.Text, this.checkBoxAbnormal.Checked, this.dateTimePickerTest.Value); if (!successful) { MessageBox.Show("Adding test results failed!"); return; } } this.resetResults(); }
private void listViewTests_MouseUp(object sender, MouseEventArgs e) { if (this.order != null) { if (this.listViewTests.SelectedItems.Count > 0) { int testCode = Convert.ToInt32(this.listViewTests.SelectedItems[0].Tag); this.currentTestCode = testCode; LabTestResults results = LabTestResultDAL.GetResults(this.order.OrderId, testCode); if (results != null) { this.currentTestHasResults = true; this.textBoxResults.Text = results.Results; this.checkBoxAbnormal.Checked = results.IsAbnormal; this.dateTimePickerTest.Value = results.TakenOn; } else { this.currentTestHasResults = false; this.resetResults(); } } } }