private void deletePatientForCheckout() { if (patientDataGridView.SelectedRows.Count == 0) { return; } int idx = patientDataGridView.SelectedRows[0].Index; int patientId = Convert.ToInt32(patientDataGridView.Rows[idx].Cells[0].Value.ToString()); string name = patientDataGridView.Rows[idx].Cells[1].Value.ToString(); string gender = patientDataGridView.Rows[idx].Cells[2].Value.ToString(); string age = patientDataGridView.Rows[idx].Cells[3].Value.ToString(); string address = patientDataGridView.Rows[idx].Cells[4].Value.ToString(); string phone = patientDataGridView.Rows[idx].Cells[5].Value.ToString(); string roomNo = patientDataGridView.Rows[idx].Cells[6].Value.ToString(); int doctorId = Convert.ToInt32(patientDataGridView.Rows[idx].Cells[7].Value.ToString()); int testId = Convert.ToInt32(patientDataGridView.Rows[idx].Cells[8].Value.ToString()); string checkinDate = patientDataGridView.Rows[idx].Cells[9].Value.ToString(); p = new patientDTO(patientId, name, gender, age, address, phone, roomNo, doctorId, testId, checkinDate); pD.deletePatient(p); }
private void patientDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e) { pD.deletePatient(p); loadPatientsInfo(); }