Exemplo n.º 1
0
 private void btnDiagnose_Click(object sender, EventArgs e)
 {
     viewController.updatePatientState(selectedIndex, State.Diagosed);
     textView.showList();
     graphicView.showList();
     readonlyView.showList();
     btnDiagnose.Enabled = false;
     btnCare.Enabled     = true;
 }
Exemplo n.º 2
0
 private void diagnoseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (viewController.getPatientState(selectedIndex) == State.Undiagosed)
     {
         viewController.updatePatientState(selectedIndex, State.Diagosed);
         textView.showList();
         graphicView.showList();
         readonlyView.showList();
         pbxDoctor.Image  = Image.FromFile(@"..\..\assets\diagnosing.png");
         pbxPatient.Image = Image.FromFile(@"..\..\assets\diagnosed.png");
     }
     else
     {
         MessageBox.Show("This patient has already been diagnosed!");
     }
 }
Exemplo n.º 3
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            string firstName = txtFirstName.Text;
            string lastName  = txtLastName.Text;

            switch (personType)
            {
            case PersonType.Patient:

                string doctorName = cmbDoctor.Text;
                string nurseName  = cmbNurse.Text;

                if (firstName == "" || lastName == "" || doctorName == "" || nurseName == "")
                {
                    MessageBox.Show("You must specify all the fields! You may need to add a doctor and a nurse first.");
                }
                else
                {
                    // if not duplicate, add to list
                    if (viewController.isDuplicate(firstName, lastName, personType))
                    {
                        MessageBox.Show("This patient is already registered!");
                    }
                    else
                    {
                        viewController.addPatient(firstName, lastName, doctorName, nurseName);
                        MessageBox.Show("New Patient Added Successfully!");
                    }
                }
                break;

            case PersonType.Doctor:

                string strSpecialty = cmbStaffType.Text;
                Enum.TryParse(strSpecialty, out Specialty specialty);

                if (firstName == "" || lastName == "" || strSpecialty == "")
                {
                    MessageBox.Show("You must specify all the fields for a doctor!");
                }
                else
                {
                    // if not duplicate, add to list
                    if (viewController.isDuplicate(firstName, lastName, personType))
                    {
                        MessageBox.Show("This doctor is already registered!");
                    }
                    else
                    {
                        viewController.addDoctor(firstName, lastName, specialty);
                        MessageBox.Show("New Doctor Added Successfully!");
                    }
                }
                break;

            case PersonType.Nurse:

                string strRank = cmbStaffType.Text;
                Enum.TryParse(strRank, out Rank rank);

                if (firstName == "" || lastName == "" || strRank == "")
                {
                    MessageBox.Show("You must specify all the fields for a nurse!");
                }
                else
                {
                    // if not duplicate, add to list
                    if (viewController.isDuplicate(firstName, lastName, personType))
                    {
                        MessageBox.Show("This nurse is already registered!");
                    }
                    else
                    {
                        viewController.addNurse(firstName, lastName, rank);
                        MessageBox.Show("New Nurse Added Successfully!");
                    }
                }
                break;

            default:
                MessageBox.Show("You must specify the type of person first!");
                break;
            }

            txtFirstName.Text = "";
            txtLastName.Text  = "";
            this.showList();
            textView.showList();
            readonlyView.showList();
        }