LAPTOP-T815PCOQ\25526
2024-11-20 f56f083a7e59e58dd44913b11ce4e959fb0475cc
SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
ÎļþÃû´Ó SourceCode/Bond/BondEq/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;
   }