private void cmdInsert_Click(object sender, EventArgs e) { frm_AddCapPhatThuocNoiTru frm = new frm_AddCapPhatThuocNoiTru(KIEU_THUOC_VT, loaiphieu); frm.m_Action = action.Insert; frm._OnInsertCompleted += frm__OnInsertCompleted; frm.dtList = dtList; frm.ShowDialog(); grdList_SelectionChanged(grdList, new EventArgs()); }
private void cmdUpdate_Click(object sender, EventArgs e) { try { if (!Utility.isValidGrid(grdList)) { Utility.ShowMsg("Bạn cần chọn phiếu để sửa"); return; } TPhieuCapphatNoitru _item = TPhieuCapphatNoitru.FetchByID(_ID_CAPPHAT); if (_item == null) { Utility.ShowMsg("Phiếu bạn chọn đã bị người khác tác động xóa mất. Đề nghị nhấn tìm kiếm để thử kiểm tra lại"); return; } if (DAPHATTHUOC_BENHNHAN()) { Utility.ShowMsg("Đã phát thuốc cho Bệnh nhân nên bạn không thể sửa phiếu"); return; } frm_AddCapPhatThuocNoiTru frm = new frm_AddCapPhatThuocNoiTru(KIEU_THUOC_VT, loaiphieu); frm.m_Action = action.Update; frm.dtList = dtList; frm.StaffId = Utility.Int32Dbnull(grdList.CurrentRow.Cells[TPhieuCapphatNoitru.Columns.IdNhanvien].Value, -1); frm.DepartmentId = Utility.Int32Dbnull(grdList.CurrentRow.Cells[TPhieuCapphatNoitru.Columns.IdKhoaLinh].Value, -1); frm._IDCAPPHAT = _ID_CAPPHAT; frm.ShowDialog(); grdList_SelectionChanged(grdList, new EventArgs()); } catch (Exception ex) { } finally { modifyActButtons(); } }
private void cmdUpdate_Click(object sender, EventArgs e) { try { if (!Utility.isValidGrid(grdList)) { Utility.ShowMsg("Bạn cần chọn phiếu để sửa"); return; } if (DAPHATTHUOC_BENHNHAN()) { Utility.ShowMsg("Đã phát thuốc cho Bệnh nhân nên bạn không thể sửa phiếu"); return; } frm_AddCapPhatThuocNoiTru frm = new frm_AddCapPhatThuocNoiTru(KIEU_THUOC_VT, loaiphieu); frm.m_Action = action.Update; frm.dtList = dtList; frm.StaffId = Utility.Int32Dbnull(grdList.CurrentRow.Cells[TPhieuCapphatNoitru.Columns.IdNhanvien].Value, -1); frm.DepartmentId = Utility.Int32Dbnull(grdList.CurrentRow.Cells[TPhieuCapphatNoitru.Columns.IdKhoaLinh].Value, -1); frm._IDCAPPHAT = _ID_CAPPHAT; frm.ShowDialog(); grdList_SelectionChanged(grdList, new EventArgs()); } catch (Exception ex) { } finally { modifyActButtons(); } }
private void cmdInsert_Click(object sender, EventArgs e) { frm_AddCapPhatThuocNoiTru frm = new frm_AddCapPhatThuocNoiTru(KIEU_THUOC_VT, loaiphieu); frm.m_Action = action.Insert; frm.dtList = dtList; frm.ShowDialog(); grdList_SelectionChanged(grdList, new EventArgs()); }