From f56f083a7e59e58dd44913b11ce4e959fb0475cc Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期三, 20 十一月 2024 19:16:44 +0800
Subject: [PATCH] 1. 添加运行日志界面2.运行日志基本功能已经完成

---
 SourceCode/Bond/BondEq/View/UserManagerDlg.cpp |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/SourceCode/Bond/BondEq/UserManagerDlg.cpp b/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
similarity index 95%
rename from SourceCode/Bond/BondEq/UserManagerDlg.cpp
rename to SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
index f58d1e6..512eb5e 100644
--- a/SourceCode/Bond/BondEq/UserManagerDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
@@ -6,7 +6,6 @@
 #include "afxdialogex.h"
 #include "UserManagerDlg.h"
 #include "InputDialog.h"
-#include "UserManager.h"
 #include "NewCellTypes/GridCellCombo.h"
 #include "NewCellTypes/GridCellNumeric.h"
 
@@ -202,12 +201,12 @@
 
 	CString inputText = inputDialog.GetInputText();
 	if (inputText.IsEmpty()) {
-		AfxMessageBox(_T("鐢ㄦ埛鍚嶄笉鑳戒负绌猴紒"), MB_OK | MB_ICONEXCLAMATION);
+		AfxMessageBox(_T("鐢ㄦ埛鍚嶄笉鑳戒负绌猴紒"));
 		return;
 	}
 
 	if (IsUsernameDuplicate(inputText)) {
-		AfxMessageBox(_T("鐢ㄦ埛鍚嶉噸澶嶏紒"), MB_OK | MB_ICONEXCLAMATION);
+		AfxMessageBox(_T("鐢ㄦ埛鍚嶉噸澶嶏紒"));
 		return;
 	}
 
@@ -259,6 +258,11 @@
 	pGridCtrl->ExpandLastColumn();
 	pGridCtrl->Invalidate();
 	pGridCtrl->UpdateWindow();
+
+	CString cstrMessage;
+	cstrMessage.Format(_T("棰勬坊鍔犵敤鎴� [%s]锛�"), inputText);
+	std::string strMessage = CT2A(cstrMessage);
+	SystemLogManager::getInstance().log(SystemLogManager::LogType::Operation, strMessage);
 }
 
 void CUserManagerDlg::DeleteSelectedRow(CGridCtrl* pGridCtrl)
@@ -286,7 +290,7 @@
 			if (selectedUser == currentUser) {
 				CString message;
 				message.Format(_T("鐢ㄦ埛 [%s] 鏄綋鍓嶇櫥褰曠敤鎴凤紝涓嶈兘鍒犻櫎锛�"), currentUser);
-				AfxMessageBox(message, MB_OK | MB_ICONEXCLAMATION);
+				AfxMessageBox(message);
 				return;
 			}
 
@@ -294,7 +298,7 @@
 		}
 
 		if (rowsToDelete.empty()) {
-			AfxMessageBox(_T("璇峰厛閫夋嫨瑕佸垹闄ょ殑琛岋紒"), MB_OK | MB_ICONINFORMATION);
+			AfxMessageBox(_T("璇峰厛閫夋嫨瑕佸垹闄ょ殑琛岋紒"));
 			return;
 		}
 
@@ -302,6 +306,11 @@
 		if (rowsToDelete.size() == 1) {
 			CString selectedUser = pGridCtrl->GetItemText(rowsToDelete[0], 1);
 			message.Format(_T("纭畾瑕佸垹闄ら�変腑鐢ㄦ埛 [%s] 鍚楋紵"), selectedUser);
+
+			CString cstrMessage;
+			cstrMessage.Format(_T("棰勫垹闄ょ敤鎴� [%s]锛�"), selectedUser);
+			std::string strMessage = CT2A(cstrMessage);
+			SystemLogManager::getInstance().log(SystemLogManager::LogType::Operation, strMessage);
 		}
 		else {
 			message.Format(_T("纭畾瑕佸垹闄ら�変腑鐨� %d 涓敤鎴峰悧锛�"), rowsToDelete.size());
@@ -319,7 +328,7 @@
 		}
 	}
 	else {
-		AfxMessageBox(_T("璇峰厛閫夋嫨瑕佸垹闄ょ殑鐢ㄦ埛锛�"), MB_OK | MB_ICONINFORMATION);
+		AfxMessageBox(_T("璇峰厛閫夋嫨瑕佸垹闄ょ殑鐢ㄦ埛锛�"));
 	}
 }
 
@@ -498,14 +507,14 @@
 
 	CCellRange selectedRange = m_gridUserManager.GetSelectedCellRange();
 	if (!selectedRange.IsValid()) {
-		AfxMessageBox(_T("璇峰厛閫夋嫨瑕佹彃鍏ョ殑浣嶇疆锛�"), MB_OK | MB_ICONINFORMATION);
+		AfxMessageBox(_T("璇峰厛閫夋嫨瑕佹彃鍏ョ殑浣嶇疆锛�"));
 		return;
 	}
 
 	int minRow = selectedRange.GetMinRow();
 	int maxRow = selectedRange.GetMaxRow();
 	if (minRow < 1) {
-		AfxMessageBox(_T("璇烽�夋嫨鏈夋晥鐨勮锛�"), MB_OK | MB_ICONEXCLAMATION);
+		AfxMessageBox(_T("璇烽�夋嫨鏈夋晥鐨勮锛�"));
 		return;
 	}
 

--
Gitblit v1.9.3