private void updateTestType()
 {
     if (this.appointmentPage.SelectedLabTest.TestType.Code != this.SelectedTestType.Code)
     {
         LabTestDAL.RemoveLabTest(this.appointmentPage.SelectedLabTest.AppointmentID, this.appointmentPage.SelectedLabTest.TestType.Code);
         LabTestDAL.InsertLabTest(this.buildLabTest());
     }
 }
Ejemplo n.º 2
0
        private void initializeTestsComboBox()
        {
            List <LabTest> allTests = LabTestDAL.GetAllTests();

            this.comboBoxTestOrder.ValueMember   = "Code";
            this.comboBoxTestOrder.DisplayMember = "CodeAndName";
            this.comboBoxTestOrder.DataSource    = allTests;
        }
        private void promptRemoveLabTest()
        {
            var message = $"Are you sure you want to remove Lab Test {this.SelectedLabTest.TestType.Code} - {this.SelectedLabTest.TestType.Name}?";

            if (MessageBox.Show(message, "Delete Lab Test", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question).Equals(DialogResult.Yes))
            {
                LabTestDAL.RemoveLabTest(this.Appointment.ID, this.SelectedLabTest.TestType.Code);
                this.refreshLabTestsGrid();
            }
        }
        private void showFinalResultsWarning()
        {
            var message = "Once you check finished, this lab test will not be able to be edited again. Would you like to continue?";

            if (MessageBox.Show(message, "Finished Lab Test", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LabTestDAL.EditLabTest(this.buildLabTest());
                MessageBox.Show("Lab Test results have been saved");
                this.Close();
            }
        }
 private void handleManageSave()
 {
     if (this.finishedCheckBox.Checked)
     {
         this.showFinalResultsWarning();
     }
     else
     {
         LabTestDAL.EditLabTest(this.buildLabTest());
     }
 }
Ejemplo n.º 6
0
        /// <summary>Gets the tests from order.</summary>
        /// <param name="orderId">The order identifier.</param>
        /// <returns>List of lab tests</returns>
        public static List <LabTest> GetTestsFromOrder(int orderId)
        {
            List <int> testCodes = HasTestsDAL.GetTestCodesFromOrder(orderId);

            List <LabTest> testsOrdered = new List <LabTest>();

            foreach (int code in testCodes)
            {
                string name = LabTestDAL.GetTestName(code);
                testsOrdered.Add(new LabTest(code, name));
            }

            return(testsOrdered);
        }
        private void handleSave()
        {
            if (this.IsEditingTest)
            {
                this.updateTestType();
            }
            else if (this.IsManagingTest)
            {
                this.handleManageSave();
            }
            else
            {
                LabTestDAL.InsertLabTest(this.buildLabTest());
            }

            this.Close();
        }
        private void refreshLabTestsGrid()
        {
            this.LabTests = LabTestDAL.GetAllLabTests(this.Appointment.ID);
            this.labTestsDataGrid.Rows.Clear();

            foreach (var labTest in this.LabTests)
            {
                DataGridViewRow newRow = new DataGridViewRow();

                newRow.CreateCells(this.labTestsDataGrid);

                newRow.Cells[0].Value = labTest.IsFinished;
                newRow.Cells[1].Value = $"{labTest.TestType.Code} - {labTest.TestType.Name}";
                newRow.Cells[2].Value = labTest.Date == default ? "" : labTest.Date.ToString();
                newRow.Cells[3].Value = labTest.Results;

                this.labTestsDataGrid.Rows.Add(newRow);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructor for the LabTestController class.
 /// </summary>
 public LabTestController()
 {
     this.labTestSource = new LabTestDAL();
 }