private void DeleteDoctorButton_Click(object sender, EventArgs e) { if (SelectedDoctorRow == null) { return; } var doctorId = SelectedDoctorRow.Cells[0].Value.ToString(); MyDb.DeleteObjectFromDataBase("Врач", doctorId); UpdateAllView(); }
private void DeletePatientButton_Click(object sender, EventArgs e) { if (SelectedPatientRow == null) { return; } var patientId = SelectedPatientRow.Cells[0].Value.ToString(); MyDb.DeleteObjectFromDataBase("Пациент", patientId); UpdateAllView(); }
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); } }
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); } }