Пример #1
0
        private void BtnAddDoctor_Click(object sender, EventArgs e)
        {
            using (var formDoctor = new FrmDoctor())
            {
                var result = formDoctor.ShowDialog();

                if (result == DialogResult.OK)
                {
                    var doctor = formDoctor.doctor;

                    InitializeDoctors();

                    selectedDoctor         = doctor;
                    cbDoctor.SelectedIndex = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);
                }
            }
        }
Пример #2
0
        private void BtnEditDoctor_Click(object sender, EventArgs e)
        {
            if (selectedDoctor == null)
            {
                MessageBox.Show("Um einen bestehenden Arzt zu bearbeiten, muss zunächst ein Arzt ausgewählt werden.");
            }
            else
            {
                using (var formDoctor = new FrmDoctor(selectedDoctor))
                {
                    var result = formDoctor.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        var doctor = formDoctor.doctor;

                        InitializeDoctors();

                        selectedDoctor         = doctor;
                        cbDoctor.SelectedIndex = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);
                    }
                }
            }
        }