Exemple #1
0
        private void buttonAddPatient_Click(object sender, EventArgs e)
        {
            PatientWindow window = new WindowsFormsApplication1.PatientWindow();

            window.ShowDialog();

            if (window.DialogResult == DialogResult.OK)
            {
                AddPatient(window);
            }

            window.Dispose();
        }
Exemple #2
0
        private void buttonEditPatient_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count != 1)
            {
                MessageBox.Show("Please select only one row to edit.");
                return;
            }
            DataGridViewRow row = dataGridView1.SelectedRows[0];

            PatientWindow window = new WindowsFormsApplication1.PatientWindow(row);

            window.ShowDialog();

            if (window.DialogResult == DialogResult.OK)
            {
                EditPatient((int)row.Cells[0].Value, window);
            }

            window.Dispose();
        }