/// <summary> /// Initializes a new instance of the <see cref="LabResultForm" /> class. /// </summary> /// <param name="testOrder">The Lab Test Order.</param> public LabResultForm(LabTestOrder testOrder) { this.InitializeComponent(); this.resultController = new LabTestResultController(); try { this.result = this.resultController.GetById(testOrder.TestResultId); } catch { this.result = null; } if (this.result == null) { this.result = new LabTestResult(testOrder.TestOrderedId, ""); } this.textBox.Text = this.result.TestResults; }
private void buttonSubmitOrder_Click(object sender, EventArgs e) { if (this.listViewTests.Items.Count > 0) { DialogResult okToProceed = MessageBox.Show("After submitting an order, you will NOT be able to edit it!", "Please confirm you would like to continue", MessageBoxButtons.YesNo); if (okToProceed == DialogResult.Yes) { if (LabTestOrderDAL.HasTestOrder(this.patientId, this.visitDateTime)) { MessageBox.Show("A test order has already been placed for this visit"); return; } List <int> testCodes = new List <int>(); foreach (ListViewItem item in this.listViewTests.Items) { int code = int.Parse(item.Tag.ToString()); testCodes.Add(code); } int orderId = LabTestHelpers.CreateTestOrder(this.patientId, this.visitDateTime, testCodes); if (orderId == -1) { MessageBox.Show("Creating test order failed"); } else { this.switchMode(true); LabTestOrder order = new LabTestOrder(orderId, this.patientId, this.visitDateTime); this.order = order; } } } else { MessageBox.Show("Please add at least one test to the order"); } }
/// <summary> /// Initializes a new instance of the <see cref="Labs"/> class. /// </summary> /// <param name="patientId">The patient's id.</param> /// <param name="visitDateTime">The visit date time.</param> /// <param name="disableEditing">if set to <c>true</c> [disable editing].</param> public Labs(int patientId, DateTime visitDateTime, bool disableEditing = false) { InitializeComponent(); this.patientId = patientId; this.visitDateTime = visitDateTime; this.dateTimePickerTest.CustomFormat = Constants.Constants.DATE_TIME_PICKER_FORMAT; this.switchMode(LabTestOrderDAL.HasTestOrder(patientId, visitDateTime)); if (this.orderSubmitted) { this.order = LabTestOrderDAL.GetTestOrder(patientId, visitDateTime); } if (disableEditing) { this.initializeAdminView(); } this.initializeTestsComboBox(); this.initializeTestsListView(); }
public void Add(LabTestOrder labTestOrder) { this.labTestOrderedRepository.Add(labTestOrder); }