예제 #1
0
        private void buttonUpdateDiagnoses_Click(object sender, EventArgs e)
        {
            PatientVisitSymptoms updatedDiag = new PatientVisitSymptoms();

             updatedDiag.DiagnosesID = Int32.Parse(comboBox1.SelectedValue.ToString());
             bool updateFlag = _controller.UpdateDiagnoses(visitID, updatedDiag.DiagnosesID, symptom);

             if (updateFlag)
                {
                    MessageBox.Show(this, "Diagnoses was updated successfuly!", "Message");
                    this.Close();
                }
                else
                {
                    MessageBox.Show(this, "Could not update diagnoses!", "Message");
                }
        }
예제 #2
0
        private void getTestData(object sender, EventArgs e)
        {
            try
            {
                //Get the visitID
                //Fill the data
                this.patient_visitTableAdapter.Fill(this.patientVisitInfoDataSet.patient_visit, this.visitID);
                this.patient_visit_vitalsTableAdapter.Fill(this.patientVisitInfoDataSet.patient_visit_vitals,
                    this.visitID);
                // Get symtpom / daigs

                try
                {
                    this.symptoms = _controller.GetAllPatientSymtomsByVisitId(this.visitID);
                    symptomtextBox.Text = this.symptoms.SymptomName;
                    if (this.symptoms.DiagnosesID != null)
                    {
                        Diagnoses diag = _controller.GetDiagnoses(this.symptoms.DiagnosesID);
                        diagtextBox.Text = diag.Name;
                        treatmenttextBox.Text = diag.Treatment;

                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Something went wrong" + exception);
                }

                //this.patient_visit_symptomsTableAdapter.Fill(this.patientVisitInfoDataSet.patient_visit_symptoms,this.visitID);
                this.patient_testsTableAdapter.Fill(this.patientVisitInfoDataSet.patient_tests, this.visitID);
                this.patient_visit_notesTableAdapter.Fill(this.patientVisitInfoDataSet.patient_visit_notes, this.visitID);
            }
            catch (InvalidCastException)
            {
                MessageBox.Show("VisitID is not an integer.", "Property Error");
            }
            catch (SqlException ex)
            {
                MessageBox.Show("SQL Server error # " + ex.Number + ": " + ex.Message, ex.GetType().ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().ToString());
            }
        }
예제 #3
0
 //Saves info in the symptoms table for the diagnoses
 private void saveButton4_Click(object sender, EventArgs e)
 {
     if (IsValidDataDiagnoses())
     {
         dsymptoms = new PatientVisitSymptoms();
         note = new PatientVisitNotes();
         this.PutPatientVisitDiagnosesData(dsymptoms, note);
         try
         {
             NorthwindController.UpdatePatientDiagnoses(dsymptoms);
             if (note.Note != null)
             {
                 note.NotesId = NorthwindController.AddPatientVisitNotes(note);
             }
             saveButton4.Visible = false;
             editButton4.Visible = true;
             editButton4.Enabled = false;
         }
         catch (SqlException ex)
         {
             MessageBox.Show(ex.Message, ex.GetType().ToString());
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, ex.GetType().ToString());
         }
     }
 }
예제 #4
0
 //Saves the symptoms/notes data
 private void PutPatientVisitSymptomsData(PatientVisitSymptoms symptoms, PatientVisitNotes note)
 {
     symptoms.VisitId = patientVisit.VisitId;
     symptoms.SymptomName = txtBoxSymptoms.Text;
     note.Note = txtBoxNotes.Text;
     note.EmployeeId = NwLogin.employeeUser.EmployeeId;
     note.VisitId = patientVisit.VisitId;
 }
예제 #5
0
 //Saves the diagnoses for the symptoms/notes data
 private void PutPatientVisitDiagnosesData(PatientVisitSymptoms dsymptoms, PatientVisitNotes note)
 {
     dsymptoms.VisitId = patientVisit.VisitId;
     dsymptoms.SymptomId = symptoms.SymptomId;
     dsymptoms.DiagnosesID = (int)diagnosesComboBox.SelectedValue;
     note.Note = notesBox2.Text;
     note.EmployeeId = NwLogin.employeeUser.EmployeeId;
     note.VisitId = patientVisit.VisitId;
 }
예제 #6
0
 private void editButton4_Click(object sender, EventArgs e)
 {
     if (IsValidDataDiagnoses())
     {
         PatientVisitSymptoms updateDiagnoses = new PatientVisitSymptoms();
         PatientVisitNotes updateNote = new PatientVisitNotes();
         this.PutPatientVisitDiagnosesData(updateDiagnoses, updateNote);
         updateNote.NotesId = note.NotesId;
         try
         {
             NorthwindController.UpdatePatientDiagnoses(updateDiagnoses);
             if (updateNote.Note != note.Note)
             {
                 NorthwindController.UpdatePatientNotes(updateNote);
             }
             editButton4.Enabled = false;
         }
         catch (SqlException ex)
         {
             MessageBox.Show(ex.Message, ex.GetType().ToString());
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, ex.GetType().ToString());
         }
     }
 }
 public static void UpdatePatientSymptoms(PatientVisitSymptoms symptoms)
 {
     PatientVisitSymptomsDal.UpdatePatientSymptoms(symptoms);
 }
 public static int AddPatientVisitSymptoms(PatientVisitSymptoms symptoms)
 {
     return PatientVisitSymptomsDal.AddPatientVisitSymptoms(symptoms);
 }