From 5e9b9b53a8a853365c29149871bd024c9ca0cbac Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 11 十二月 2025 11:26:27 +0800
Subject: [PATCH] 1.报告的删除功能;

---
 SourceCode/Bond/Servo/CPageReport.cpp |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageReport.cpp b/SourceCode/Bond/Servo/CPageReport.cpp
index ca178ef..b537d06 100644
--- a/SourceCode/Bond/Servo/CPageReport.cpp
+++ b/SourceCode/Bond/Servo/CPageReport.cpp
@@ -148,3 +148,33 @@
 
 	*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("鍒犻櫎鎶ュ憡澶辫触"));
+		}
+	}
+}

--
Gitblit v1.9.3