| | |
| | | |
| | | *pResult = 0; |
| | | } |
| | | |
| | | void CPageReport::OnClickedBtn(const char* btnName) |
| | | { |
| | | ASSERT(btnName); |
| | | if (_strcmpi(btnName, "删除") == 0) { |
| | | POSITION pos = m_listCtrl.GetFirstSelectedItemPosition(); |
| | | if (pos == nullptr) return; |
| | | int nItem = m_listCtrl.GetNextSelectedItem(pos); |
| | | auto pRpt = reinterpret_cast<SERVO::CReport*>(m_listCtrl.GetItemData(nItem)); |
| | | if (pRpt == nullptr) return; |
| | | |
| | | int rc = UX_CanExecute(L"delReports"); |
| | | if (rc != 1) { |
| | | AfxMessageBox("操作权限不足,请联系管理人员!"); |
| | | return; |
| | | } |
| | | |
| | | int ret = theApp.m_model.m_hsmsPassive.deleteReport((int)pRpt->getReportId()); |
| | | if (ret == 0) { |
| | | UX_RecordAction(L"delReports"); |
| | | m_listCtrl.DeleteAllItems(); |
| | | loadReports(); |
| | | if (CButton* pDel = GetBtnByName("删除")) pDel->EnableWindow(FALSE); |
| | | if (CButton* pEdit = GetBtnByName("编辑")) pEdit->EnableWindow(FALSE); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("删除报告失败")); |
| | | } |
| | | } |
| | | } |