private void dataViewHC_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataViewHC.SelectedRows.Count > 0) { int hcID = Convert.ToInt32(dataViewHC.SelectedRows[0].Cells[0].Value); HospitalizationCertificate updateHC = HospitalizationCertificate.GetHC(hcID); FormHCDetail formHCD = new FormHCDetail(updateHC, "edit"); formHCD.ShowDialog(); refreshDataViewHC(); } }
//Add a new hostpitalization certificate private void buttonHospitalizationCert_Click(object sender, EventArgs e) { if (dataViewPatient.SelectedRows.Count > 0) { int patientID = Convert.ToInt32(dataViewPatient.SelectedRows[0].Cells[0].Value); //Current user int staffID = loginStaff.StaffID; if (HospitalizationCertificate.IsPatientHadHC(patientID)) { MessageBox.Show("Bệnh nhân đã có giấy nhập viện", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { FormHCDetail formHCD = new FormHCDetail(staffID, patientID); formHCD.ShowDialog(); } } }