Exemplo n.º 1
0
        private void cmbDoctorSignUpDepartment_SelectedIndexChanged(object sender, EventArgs e)
        {
            // MessageBox.Show(cmbDoctorSignUpDepartment.SelectedValue.ToString());
            int deparmentId;

            bool isCheckt = int.TryParse(cmbDoctorSignUpDepartment.SelectedValue.ToString(), out deparmentId);

            if (isCheckt)
            {
                cmbDoctorSignUpPolyclinic.DataSource    = polyclinicsController.GetPolyclinic(deparmentId);
                cmbDoctorSignUpPolyclinic.DisplayMember = "PolyclinicName";
                cmbDoctorSignUpPolyclinic.ValueMember   = "PolyclinicId";
            }
        }
        private void cmbAppointmentDepartmentName_SelectedIndexChanged(object sender, EventArgs e)
        {
            int deparmentId;

            bool isCheckt = int.TryParse(cmbAppointmentDepartmentName.SelectedValue.ToString(), out deparmentId);

            if (isCheckt)
            {
                cmbAppointmentPolyclinicName.DataSource    = polyclinicController.GetPolyclinic(deparmentId);
                cmbAppointmentPolyclinicName.DisplayMember = "PolyclinicName";
                cmbAppointmentPolyclinicName.ValueMember   = "PolyclinicId";
            }

            if (cmbAppointmentPolyclinicName.SelectedValue == null)
            {
                btnDoctorsPolyclinicQuery.Enabled = false;
            }
            else
            {
                btnDoctorsPolyclinicQuery.Enabled = true;
            }
        }