private void dataViewSurgical_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataViewSurgical.SelectedRows.Count > 0) { int surgicalID = Convert.ToInt32(dataViewSurgical.SelectedRows[0].Cells[0].Value); Surgical updateSurgical = Surgical.GetSurgical(surgicalID); FormSurgicalDetail formSD = new FormSurgicalDetail(updateSurgical, "edit"); formSD.ShowDialog(); refreshDataViewSurgical(); refreshDataViewSurgicalDetail(); } }
//Add a new surgical private void buttonPatientSurgery_Click(object sender, EventArgs e) { if (dataViewPatient.SelectedRows.Count > 0) { int patientID = Convert.ToInt32(dataViewPatient.SelectedRows[0].Cells[0].Value); if (Patient.GetPatient(patientID).State == 1) { FormSurgicalDetail formSD = new FormSurgicalDetail(patientID); formSD.ShowDialog(); } else { MessageBox.Show("Bệnh nhân chưa nhập viện nên không thể thực hiện phẩu thuật", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void buttonSurgeryEdit_Click(object sender, EventArgs e) { if (dataViewSurgical.SelectedRows.Count > 0) { int surgicalID = Convert.ToInt32(dataViewSurgical.SelectedRows[0].Cells[0].Value); Surgical updateSurgical = Surgical.GetSurgical(surgicalID); FormSurgicalDetail formSD = new FormSurgicalDetail(updateSurgical, "edit"); formSD.ShowDialog(); refreshDataViewSurgical(); refreshDataViewSurgicalDetail(); } }