private void buttonAssignmentEdit_Click(object sender, EventArgs e) { if (dataViewAssignment.SelectedRows.Count > 0) { int assignID = Convert.ToInt32(dataViewAssignment.SelectedRows[0].Cells[0].Value); Assignment updateAssign = Assignment.GetAssignment(assignID); FormAssignDetail formAD = new FormAssignDetail(updateAssign, "edit"); formAD.ShowDialog(); refreshDataViewAssignment(); refreshDataViewAssignmentDetail(); } }
private void dataViewAssignment_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataViewAssignment.SelectedRows.Count > 0) { int assignID = Convert.ToInt32(dataViewAssignment.SelectedRows[0].Cells[0].Value); Assignment updateAssign = Assignment.GetAssignment(assignID); FormAssignDetail formAD = new FormAssignDetail(updateAssign, "edit"); formAD.ShowDialog(); refreshDataViewAssignment(); refreshDataViewAssignmentDetail(); } }
//Add a new assignment private void buttonAssign_Click(object sender, EventArgs e) { if (dataViewPatient.SelectedRows.Count > 0) { int patientID = Convert.ToInt32(dataViewPatient.SelectedRows[0].Cells[0].Value); if (HospitalizationCertificate.IsPatientHadHC(patientID)) { if (Assignment.IsPatientHadAssignment(patientID)) { MessageBox.Show("Bệnh nhân đã được phân công chăm sóc", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { FormAssignDetail formAD = new FormAssignDetail(patientID); formAD.ShowDialog(); } } else { MessageBox.Show("Bệnh nhân chưa nhập viện", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }