Exemple #1
0
        private void DeleteDoctorButton_Click(object sender, EventArgs e)
        {
            if (SelectedDoctorRow == null)
            {
                return;
            }
            var doctorId = SelectedDoctorRow.Cells[0].Value.ToString();

            MyDb.DeleteObjectFromDataBase("Врач", doctorId);
            UpdateAllView();
        }
Exemple #2
0
        private void DeletePatientButton_Click(object sender, EventArgs e)
        {
            if (SelectedPatientRow == null)
            {
                return;
            }
            var patientId = SelectedPatientRow.Cells[0].Value.ToString();

            MyDb.DeleteObjectFromDataBase("Пациент", patientId);
            UpdateAllView();
        }
Exemple #3
0
 private void DeletePatientButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (SelectedPatientRow == null)
         {
             return;
         }
         var patientId = SelectedPatientRow.Cells[0].Value.ToString();
         MyDb.DeleteObjectFromDataBase("Пациент", patientId);
         UpdateAllView();
     }
     catch (Exception e7)
     {
         ShowAppError(e7.Message);
     }
 }
Exemple #4
0
 private void DeleteDoctorButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (SelectedDoctorRow == null)
         {
             return;
         }
         var doctorId = SelectedDoctorRow.Cells[0].Value.ToString();
         if (MessageBox.Show($"Удалить строку с ID = '{doctorId}'?", "Удаление",
                             MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             MyDb.DeleteObjectFromDataBase("Врач", doctorId);
             UpdateAllView();
         }
     }
     catch (Exception e4)
     {
         ShowAppError(e4.Message);
     }
 }