private void buttonReject_Click(object sender, EventArgs e)
        {
            Notice notObj = new Notice();

            Patient patObj    = new Patient(storeKeys.loginUserName);
            string  patientID = patObj.getID();

            DoctorClass docObj   = new DoctorClass(notificationListView.SelectedItems[0].Text);
            string      doctorID = docObj.getID();

            //create a method to permit doctor in notice class
            notObj.permitOrDeny("R" + "" + patientID + "" + doctorID);
            MessageBox.Show("You have denied access to your medical records. ");
        }
        private void buttonMakeAppointment_Click(object sender, EventArgs e)
        {
            //create objects for patient class using login username
            Patient patObj = new Patient(storeKeys.loggedInfo);

            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());

            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }

            //check if appoinment is open or not
            Notice notObj = new Notice();
            int    isOpen = notObj.checkAvailability(dateTimePicker1.Text, comboBoxAvailableHours.SelectedItem.ToString());

            if (isOpen == 1)
            {
                MessageBox.Show("That time is unavailable!");
                return;
            }

            MessageBox.Show("You have successfully made an appointment with " + comboBoxDoctor.SelectedItem.ToString() + ".");

            List <string> appoint = new List <string>();

            appoint.Add(docObj.getID());                                 //doctor ID
            appoint.Add(patObj.getID());                                 // patient id
            appoint.Add(patObj.getName());                               //patient full name
            appoint.Add(comboBoxAvailableHours.SelectedItem.ToString()); //selected appointment time
            appoint.Add(dateTimePicker1.Text);                           //selected appointment date
            appoint.Add(textBoxReason.Text);                             //discription for doctor from patient about the appointment
            patObj.requestDoctorAppointment(appoint);
        }
예제 #3
0
        private void buttonSubmitRefillRequest_Click(object sender, EventArgs e)
        {
            //create objects of different classes
            Notice notObj = new Notice();

            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());

            Patient patObj = new Patient(storeKeys.loggedInfo);

            textBoxFullName.Text = patObj.getName();



            //check if field is empty
            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }


            //creates a list of data inputed from patient when they request a refill permit - Bereket
            List <string> requestRefillPermitList = new List <string>();

            requestRefillPermitList.Add("RD");                                                                               //type
            requestRefillPermitList.Add(docObj.getID());                                                                     //send t0
            requestRefillPermitList.Add(patObj.getID());                                                                     //received from
            requestRefillPermitList.Add(patObj.getName() + " | " + textBoxMedicationName.Text + " | " + textBoxReason.Text); //message + additional

            //calls a method from patient class to send a doctor phone call request - Bereket
            notObj.SendMessage(requestRefillPermitList);

            MessageBox.Show("You have successfully sent your medicine refill request!");
        }
        private void buttonMakePhoneCallRequest_Click(object sender, EventArgs e)
        {
            //creating an object for patient class using login info
            Patient patObj = new Patient(storeKeys.loggedInfo);

            textBoxFullName.Text = patObj.getName();

            //creating an object for doctor class using doctor name
            DoctorClass docObj = new DoctorClass(comboBoxDoctor.SelectedItem.ToString());


            foreach (Control c in groupBox1.Controls.Cast <Control>().OrderBy(c => c.TabIndex))
            {
                if (string.IsNullOrWhiteSpace(c.Text))
                {
                    MessageBox.Show(string.Format("Empty field {0} ", c.Name.Substring(7)));
                    c.Focus();
                    return;
                }
            }


            //creates a list of inputs from patient when they request an immediate phone call. - Bereket
            List <string> requestDoctorCallList = new List <string>();

            requestDoctorCallList.Add("PD");
            requestDoctorCallList.Add(docObj.getID());
            requestDoctorCallList.Add(patObj.getID());
            requestDoctorCallList.Add(textBoxFullName.Text + " | " + textBoxMobile.Text + " | " + textBoxReason.Text);

            //calls a method from patient class to send a doctor phone call request - Bereket
            //*****Right now i have it where it a method is patient class is called and that methods calls a sendMessage() method in notice class - Bereket
            //You can change it if you want to
            patObj.requestDoctorCall(requestDoctorCallList);
            MessageBox.Show("You have successfully send your request for an immediate phone call.");
        }