Пример #1
0
        // add appointment button:
        private void button1_Click(object sender, EventArgs e)
        {
            string appointment_id        = maskedTextBox1.Text;
            string doctor_id             = maskedTextBox2.Text;
            string patient_id            = maskedTextBox3.Text;
            string date                  = maskedTextBox6.Text;
            string time                  = maskedTextBox5.Text;
            string needed_specialization = maskedTextBox4.Text;
            string details               = maskedTextBox9.Text;
            string needs_follow_up       = maskedTextBox8.Text;
            string current               = maskedTextBox7.Text;

            MD.Appointment apt = new MD.Appointment(appointment_id, doctor_id, patient_id, date, time, needed_specialization, details, needs_follow_up, current);
            MD.Appointment.appointments.Add(apt);

            maskedTextBox1.Clear();
            maskedTextBox2.Clear();
            maskedTextBox3.Clear();
            maskedTextBox4.Clear();
            maskedTextBox5.Clear();
            maskedTextBox6.Clear();
            maskedTextBox7.Clear();
            maskedTextBox8.Clear();
            maskedTextBox9.Clear();
        }
Пример #2
0
        // load file button:
        private void button7_Click_1(object sender, EventArgs e)
        {
            Boolean end_doctors  = false;
            Boolean end_patients = false;

            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string   filename = openFileDialog1.FileName;
                string[] lines    = File.ReadAllLines(filename);
                foreach (string line in lines)
                {
                    if (line == "END DOCTORS")
                    {
                        end_doctors = true;
                        continue;
                    }

                    if (line == "END PATIENTS")
                    {
                        end_patients = true;
                        continue;
                    }

                    if (end_doctors == true && end_patients == false)
                    {
                        string[]   col = line.Split(new char[] { ',' });
                        MD.Patient pat = new MD.Patient(col[0], col[1], col[2], col[3], col[4], col[5], col[6], col[7], col[8]);
                        MD.Patient.patients.Add(pat);
                    }

                    if (end_patients == true)
                    {
                        string[]       col = line.Split(new char[] { ',' });
                        MD.Appointment apt = new MD.Appointment(col[0], col[1], col[2], col[3], col[4], col[5], col[6], col[7], col[8]);
                        MD.Appointment.appointments.Add(apt);
                    }

                    if (end_doctors == false && end_patients == false)
                    {
                        string[]  col = line.Split(new char[] { ',' });
                        MD.Doctor doc = new MD.Doctor(col[0], col[1], col[2], col[3], col[4], col[5], col[6], col[7], col[8]);
                        MD.Doctor.doctors.Add(doc);
                    }
                }
            }
        }
Пример #3
0
 // add search appointments to list box:
 public void AddSearchAppointmentToListBox(MD.Appointment appointment)
 {
     listBox1.Items.Add(appointment);
 }