//Add a new heath file private void buttonHealthFile_Click(object sender, EventArgs e) { if (dataViewPatient.SelectedRows.Count > 0) { int patientID = Convert.ToInt32(dataViewPatient.SelectedRows[0].Cells[0].Value); int state = Patient.GetPatient(patientID).State; if (state == 1) { if (!HeathFile.DidPatientHaveHF(patientID)) { FormHFDetail formHFD = new FormHFDetail(patientID); formHFD.ShowDialog(); } else { MessageBox.Show("Bệnh nhân đã có bệnh án", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Bệnh nhân chưa nhập viện", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void buttonHealthFileEdit_Click(object sender, EventArgs e) { if (dataViewHeathFile.SelectedRows.Count > 0) { int heathFileID = Convert.ToInt32(dataViewHeathFile.SelectedRows[0].Cells[0].Value); FormHFDetail formHFDetail = new FormHFDetail(HeathFile.GetHeathFile(heathFileID), "edit"); formHFDetail.ShowDialog(); refreshDataViewHeathFile(); } }
private void dataViewHeathFile_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataViewHeathFile.SelectedRows.Count > 0) { int heathFileID = Convert.ToInt32(dataViewHeathFile.SelectedRows[0].Cells[0].Value); FormHFDetail formHFDetail = new FormHFDetail(HeathFile.GetHeathFile(heathFileID), "edit"); formHFDetail.ShowDialog(); refreshDataViewHeathFile(); } }