From 19261d011387ec57d646decc945aadaf8913eeab Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 10 三月 2025 09:05:54 +0800
Subject: [PATCH] Merge branch 'clh'

---
 SourceCode/Bond/Servo/AlarmDlg.cpp |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/AlarmDlg.cpp b/SourceCode/Bond/Servo/AlarmDlg.cpp
index 6fc3e88..66c14dd 100644
--- a/SourceCode/Bond/Servo/AlarmDlg.cpp
+++ b/SourceCode/Bond/Servo/AlarmDlg.cpp
@@ -5,6 +5,7 @@
 #include "Servo.h"
 #include "afxdialogex.h"
 #include "AlarmDlg.h"
+#include "AlarmManager.h"
 #include "Common.h"
 #include <iomanip>
 
@@ -84,13 +85,14 @@
 						bool result = alarmManager.addAlarm(alarmData, alarmEventId);
 						if (result) {
 							LOGI("<CAlarmDlg> Alarm added successfully!");
-						}
+					}
 						else {
 							LOGI("<CAlarmDlg> Failed to add alarm.");
-						}
-					}
 				}
 			}
+				}
+			}
+
 
 		pAny->release();
 		}, [&]() -> void {
@@ -277,7 +279,6 @@
 	pListCtrl->SetColumnWidth(7, LVSCW_AUTOSIZE_USEHEADER);
 
 	// 璁$畻鎬婚〉鏁�
-	int totalRecords = AlarmManager::getInstance().getTotalAlarmCount("", "", m_strDeviceName, m_strUnitName, m_strKeyword, m_szTimeStart, m_szTimeEnd);
 	m_nTotalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE;
 	m_nCurPage = 1;
 
@@ -286,6 +287,11 @@
 
 	return TRUE;  // return TRUE unless you set the focus to a control
 	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+BOOL CAlarmDlg::DestroyWindow()
+{
+	return CDialogEx::DestroyWindow();
 }
 
 HBRUSH CAlarmDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
@@ -471,4 +477,4 @@
 	// 鐐瑰嚮涓嬩竴椤�
 	m_nCurPage++;
 	UpdatePageData();  // 璋冪敤鍒嗛〉鏇存柊鍑芥暟
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3