Пример #1
0
        private void AddPatientButton_Click(object sender, EventArgs e)
        {
            string patientName = name.Text;
            int    patientAge;

            int.TryParse(age.Text, out patientAge);
            string patientGender = gender.Text;
            int    patientWeight;

            int.TryParse(weight.Text, out patientWeight);

            if (name.Text != string.Empty && age.Text != string.Empty && gender.Text != string.Empty && weight.Text != string.Empty && patientAge != 0 && patientWeight != 0)
            {
                Patient patient = new Patient(patientName, patientAge, patientGender, patientWeight);
                DoctorClient.AddPatient(patient);
                PatientGUI patientGUI = new PatientGUI(DoctorClient, patient);
                specialistForm.AddPatientGUI(patientGUI);
                patientGUI.Show();
                this.Dispose();
            }
            else
            {
                MessageBox.Show("Please fill in all required fields with valid data");
            }
        }
 public void AddPatientGUI(PatientGUI patientGUI)
 {
     patientGUIs.Add(patientGUI);
 }