private void tsmUpdateResultDetail_Click(object sender, EventArgs e) { try { if (grdResultDetail.CurrentRow == null) return; var frm = new frmResultDetailInfo(); frm.grdResultDetail = grdResultDetail; frm.ShowDialog(); if (frm.vAction == action.ConfirmData) { Insert_Update_Result(); } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
private void tsmManualAddDetail_Click(object sender, EventArgs e) { try { if (tabTestInfo.SelectedTab.Name != "tabResult" | grdTestInfo.CurrentRow == null) return; var frm = new frmResultDetailInfo(); frm.vAction = action.Insert; frm.m_dtResultDetail = m_dtResultDetail; frm.grdResultDetail = grdResultDetail; frm.vTestID = Utility.Int32Dbnull(grdTestInfo.GetValue("Test_ID")); frm.ShowDialog(); //Khi ResultDetail đã được thêm thì add row vào grd KQ if (frm.vAction == action.ConfirmData) { //grdResultDetail.CurrentRow.Cells[TResultDetail.Columns.TestId].Value = Utility.Int32Dbnull(grdTestInfo.GetValue("Test_ID")); grdResultDetail.CurrentRow.Cells[TResultDetail.Columns.PatientId].Value = Utility.Int32Dbnull(grdPatients.GetValue("Patient_ID")); grdResultDetail.CurrentRow.Cells[TResultDetail.Columns.TestTypeId].Value = Utility.Int32Dbnull(grdTestInfo.GetValue("TestType_ID")); grdResultDetail.CurrentRow.Cells[TResultDetail.Columns.Barcode].Value = Utility.sDbnull(grdTestInfo.GetValue("Barcode")); Insert_Update_Result(); FocusColumnResult(); } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }