| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // SystemLogManagerDlg.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "BondEq.h" |
| | | #include "afxdialogex.h" |
| | | #include "SystemLogManagerDlg.h" |
| | | |
| | | |
| | | // CSystemLogManagerDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CSystemLogManagerDlg, CDialogEx) |
| | | |
| | | CSystemLogManagerDlg::CSystemLogManagerDlg(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DIALOG_SYSTEM_LOG_MANAGER, pParent) |
| | | { |
| | | m_nInitialWidth = 0; |
| | | m_nInitialHeight = 0; |
| | | } |
| | | |
| | | CSystemLogManagerDlg::~CSystemLogManagerDlg() |
| | | { |
| | | for (auto& pair : m_mapFonts) { |
| | | if (pair.second) { |
| | | pair.second->DeleteObject(); |
| | | delete pair.second; |
| | | } |
| | | } |
| | | m_mapFonts.clear(); |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_COMBO_TYPE, m_comboType); |
| | | DDX_Control(pDX, IDC_COMBO_USER, m_comboUser); |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart); |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dateTimeEnd); |
| | | DDX_Control(pDX, IDC_EDIT_DESCRIPTION, m_editDescription); |
| | | DDX_Control(pDX, IDC_CUSTOM_LIST_LOGS, m_listLogs); |
| | | DDX_Control(pDX, IDC_STATIC_PAGE_NUMBER, m_staticPageNum); |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::InitSystemLogManager() |
| | | { |
| | | if (m_listLogs.GetSafeHwnd() == NULL) |
| | | return; |
| | | |
| | | int nRows = 21; // å
æ¬è¡¨å¤´ï¼1 è¡ï¼åæ°æ®ï¼20 è¡ï¼ |
| | | int nCols = 5; |
| | | |
| | | int nFixRows = 1; |
| | | int nFixCols = 0; |
| | | int nRowIdx = 0; |
| | | int nColIdx = 0; |
| | | |
| | | m_listLogs.DeleteAllItems(); |
| | | m_listLogs.SetVirtualMode(FALSE); |
| | | m_listLogs.GetDefaultCell(TRUE, FALSE)->SetBackClr(g_nGridFixCellColor); // 设置åºå®è¡èæ¯è² |
| | | m_listLogs.GetDefaultCell(FALSE, TRUE)->SetBackClr(g_nGridFixCellColor); // 设置åºå®åèæ¯è² |
| | | m_listLogs.GetDefaultCell(FALSE, FALSE)->SetBackClr(g_nGridCellColor); // 设置åå
æ ¼èæ¯è² |
| | | m_listLogs.SetFixedTextColor(g_nGridFixFontColor); // 设置åºå®è¡ååä½é¢è² |
| | | |
| | | m_listLogs.SetRowCount(nRows); |
| | | m_listLogs.SetColumnCount(nCols); |
| | | m_listLogs.SetFixedRowCount(nFixRows); |
| | | m_listLogs.SetFixedColumnCount(nFixCols); |
| | | |
| | | // Col |
| | | m_listLogs.SetColumnWidth(nColIdx, 10); |
| | | m_listLogs.SetItemText(nRowIdx, nColIdx++, _T("No.")); |
| | | m_listLogs.SetColumnWidth(nColIdx, 10); |
| | | m_listLogs.SetItemText(nRowIdx, nColIdx++, _T("ç±»å")); |
| | | m_listLogs.SetColumnWidth(nColIdx, 100); |
| | | m_listLogs.SetItemText(nRowIdx, nColIdx++, _T("äºä»¶")); |
| | | m_listLogs.SetColumnWidth(nColIdx, 30); |
| | | m_listLogs.SetItemText(nRowIdx, nColIdx++, _T("ç¨æ·")); |
| | | m_listLogs.SetColumnWidth(nColIdx, 50); |
| | | m_listLogs.SetItemText(nRowIdx, nColIdx++, _T("æ¶é´")); |
| | | |
| | | // å建 20 è¡ç©ºç½æ°æ®è¡ |
| | | for (int i = 1; i < nRows; ++i) { |
| | | for (int j = 0; j < nCols; ++j) { |
| | | m_listLogs.SetItemText(i, j, _T("")); // åå§å为空å符串 |
| | | } |
| | | } |
| | | |
| | | m_listLogs.SetFixedRowSelection(FALSE); |
| | | m_listLogs.SetFixedColumnSelection(FALSE); |
| | | m_listLogs.SetEditable(FALSE); |
| | | m_listLogs.SetRowResize(FALSE); |
| | | m_listLogs.SetColumnResize(TRUE); |
| | | m_listLogs.ExpandColumnsToFit(TRUE); |
| | | m_listLogs.SetListMode(TRUE); // å¯ç¨åè¡¨æ¨¡å¼ |
| | | m_listLogs.EnableSelection(TRUE); // å¯ç¨éæ© |
| | | m_listLogs.SetSingleRowSelection(TRUE); // èªå¨æ´è¡é«äº®ï¼éå¶ä¸ºåè¡éæ©ï¼ |
| | | m_listLogs.ExpandLastColumn(); // æåä¸åå¡«å
ç½æ ¼ |
| | | |
| | | try { |
| | | FillSystemLogManager(); |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("åå§åè¿è¡æ¥å¿å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::FillSystemLogManager() |
| | | { |
| | | // è·åç鿡件 |
| | | CString selectedType, selectedUser, description; |
| | | m_comboType.GetLBText(m_comboType.GetCurSel(), selectedType); |
| | | m_comboUser.GetLBText(m_comboUser.GetCurSel(), selectedUser); |
| | | m_editDescription.GetWindowText(description); |
| | | |
| | | COleDateTime startTime, endTime; |
| | | m_dateTimeStart.GetTime(startTime); |
| | | m_dateTimeEnd.GetTime(endTime); |
| | | CString strStartTime = startTime.Format(_T("%Y-%m-%d %H:%M:%S")); |
| | | CString strEndTime = endTime.Format(_T("%Y-%m-%d %H:%M:%S")); |
| | | |
| | | std::string type = CT2A(selectedType); |
| | | std::string user = CT2A(selectedUser); |
| | | std::string desc = CT2A(description); |
| | | std::string start = CT2A(strStartTime); |
| | | std::string end = CT2A(strEndTime); |
| | | |
| | | // è·åæ¥å¿ç®¡çå®ä¾ |
| | | SystemLogManager& logManager = SystemLogManager::getInstance(); |
| | | |
| | | int pageSize = 20; // æ¯é¡µæ¾ç¤º 20 æ¡è®°å½ |
| | | int totalRecords = logManager.getTotalLogCount(type, user, desc, start, end); |
| | | m_nTotalPages = (totalRecords + pageSize - 1) / pageSize; |
| | | auto logs = logManager.getFilteredLogs(type, user, desc, start, end, m_nCurrentPage, pageSize); |
| | | |
| | | // æ´æ°è¡¨æ ¼æ°æ® |
| | | int rowIdx = 1; |
| | | for (const auto& log : logs) { |
| | | m_listLogs.SetItemText(rowIdx, 0, CString(std::to_string(rowIdx).c_str())); // åºå· |
| | | m_listLogs.SetItemText(rowIdx, 1, CString(log[1].c_str())); // ç±»å |
| | | m_listLogs.SetItemText(rowIdx, 2, CString(log[2].c_str())); // äºä»¶ |
| | | m_listLogs.SetItemText(rowIdx, 3, CString(log[3].c_str())); // ç¨æ· |
| | | m_listLogs.SetItemText(rowIdx, 4, CString(log[4].c_str())); // æ¶é´ |
| | | ++rowIdx; |
| | | } |
| | | |
| | | // æ¸
空å¤ä½è¡ |
| | | for (; rowIdx <= 20; ++rowIdx) { |
| | | m_listLogs.SetItemText(rowIdx, 0, CString(std::to_string(rowIdx).c_str())); // åºå·å |
| | | for (int colIdx = 1; colIdx < m_listLogs.GetColumnCount(); ++colIdx) { |
| | | m_listLogs.SetItemText(rowIdx, colIdx, _T("")); |
| | | } |
| | | } |
| | | |
| | | m_listLogs.ExpandColumnsToFit(FALSE); |
| | | m_listLogs.ExpandLastColumn(); |
| | | m_listLogs.Invalidate(); |
| | | m_listLogs.UpdateWindow(); |
| | | |
| | | UpdatePageInfo(); |
| | | } |
| | | |
| | | CFont* CSystemLogManagerDlg::GetOrCreateFont(int nFontSize) |
| | | { |
| | | auto it = m_mapFonts.find(nFontSize); |
| | | if (it != m_mapFonts.end()) { |
| | | return it->second; |
| | | } |
| | | |
| | | CFont* font = new CFont(); |
| | | LOGFONT logFont = { 0 }; |
| | | _tcscpy_s(logFont.lfFaceName, _T("Segoe UI")); |
| | | logFont.lfHeight = -nFontSize; |
| | | logFont.lfQuality = CLEARTYPE_QUALITY; |
| | | font->CreateFontIndirect(&logFont); |
| | | m_mapFonts[nFontSize] = font; |
| | | |
| | | return font; |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::UpdatePageInfo() |
| | | { |
| | | // æ ¼å¼å页ç ä¿¡æ¯ä¸º "å½å页/æ»é¡µæ°" |
| | | CString pageInfo; |
| | | pageInfo.Format(_T("%d/%d 页"), m_nCurrentPage, m_nTotalPages); |
| | | m_staticPageNum.SetWindowText(pageInfo); |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::SetDefaultFont() |
| | | { |
| | | CFont* defaultFont = GetOrCreateFont(12); |
| | | |
| | | // éåæææ§ä»¶ï¼åºç¨é»è®¤åä½ |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | // è·³è¿ç¹æ®æ§ä»¶ï¼å¦ MFCGridCtrlï¼ |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | pWnd = pWnd->GetNextWindow(); |
| | | continue; |
| | | } |
| | | |
| | | pWnd->SetFont(defaultFont, TRUE); |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::AdjustControls(float dScaleX, float dScaleY) |
| | | { |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | int nCtrlID = pWnd->GetDlgCtrlID(); |
| | | if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end()) |
| | | { |
| | | CRect originalRect = m_mapCtrlLayouts[nCtrlID]; |
| | | CRect newRect( |
| | | static_cast<int>(originalRect.left * dScaleX), |
| | | static_cast<int>(originalRect.top * dScaleY), |
| | | static_cast<int>(originalRect.right * dScaleX), |
| | | static_cast<int>(originalRect.bottom * dScaleY)); |
| | | |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | |
| | | if (_tcsicmp(szClassName, _T("ComboBox")) == 0) { |
| | | CComboBox* pComboBox = (CComboBox*)pWnd; |
| | | pComboBox->SetItemHeight(-1, newRect.Height()); // -1 表示ææé¡¹çé«åº¦ |
| | | } |
| | | |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd; |
| | | pGridCtrl->SetDefCellHeight(newRect.Height() / 21); |
| | | pGridCtrl->ExpandColumnsToFit(TRUE); |
| | | pGridCtrl->ExpandLastColumn(); |
| | | pGridCtrl->Invalidate(); |
| | | pGridCtrl->UpdateWindow(); |
| | | } |
| | | |
| | | pWnd->MoveWindow(&newRect); |
| | | AdjustControlFont(pWnd, newRect.Width(), newRect.Height()); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | } |
| | | |
| | | void CSystemLogManagerDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight) |
| | | { |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | |
| | | // è·³è¿ç¹æ®æ§ä»¶ï¼å¦ MFCGridCtrlï¼ |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | return; |
| | | } |
| | | |
| | | // æ ¹æ®æ§ä»¶é«åº¦å¨æè°æ´åä½å¤§å° |
| | | int fontSize = nHeight / 2; |
| | | if (fontSize < 8) fontSize = 8; |
| | | |
| | | // è·åæå建åä½ |
| | | CFont* pFont = GetOrCreateFont(fontSize); |
| | | |
| | | pWnd->SetFont(pFont); |
| | | pWnd->Invalidate(); // å·æ°æ§ä»¶æ¾ç¤º |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::AdjustComboBoxStyle(CComboBox& comboBox) |
| | | { |
| | | DWORD dwStyle = comboBox.GetStyle(); |
| | | comboBox.ModifyStyle(0, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_OWNERDRAWFIXED); |
| | | |
| | | comboBox.Invalidate(); |
| | | comboBox.UpdateWindow(); |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::AdjustDateTimeCtrlStyle(CDateTimeCtrl& dateTimeCtrl) |
| | | { |
| | | dateTimeCtrl.ModifyStyle(0, DTS_RIGHTALIGN); |
| | | dateTimeCtrl.Invalidate(); |
| | | dateTimeCtrl.UpdateWindow(); |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CSystemLogManagerDlg, CDialogEx) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CSystemLogManagerDlg::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CSystemLogManagerDlg::OnBnClickedButtonPrevPage) |
| | | ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CSystemLogManagerDlg::OnBnClickedButtonNextPage) |
| | | ON_CBN_SELCHANGE(IDC_COMBO_TYPE, &CSystemLogManagerDlg::OnSelchangeComboType) |
| | | ON_CBN_SELCHANGE(IDC_COMBO_USER, &CSystemLogManagerDlg::OnSelchangeComboUser) |
| | | ON_WM_SIZE() |
| | | ON_WM_GETMINMAXINFO() |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CSystemLogManagerDlg æ¶æ¯å¤çç¨åº |
| | | |
| | | |
| | | BOOL CSystemLogManagerDlg::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | SetWindowText(_T("ç³»ç»è¿è¡æ¥å¿")); |
| | | |
| | | m_nCurrentPage = 1; // ä»ç¬¬ä¸é¡µå¼å§ |
| | | m_nTotalPages = 1; // é»è®¤æ»é¡µæ°ä¸º 1 |
| | | |
| | | m_comboType.AddString(_T("ALL")); |
| | | m_comboType.AddString(_T("ä¿¡æ¯")); |
| | | m_comboType.AddString(_T("æä½")); |
| | | m_comboType.AddString(_T("é误")); |
| | | m_comboType.AddString(_T("æªç¥")); |
| | | m_comboType.SetCurSel(0); |
| | | |
| | | m_comboUser.AddString(_T("ALL")); |
| | | m_comboUser.AddString(_T("SYSTEM")); |
| | | auto usernames = UserManager::getInstance().getUsernames(); |
| | | for (const auto& username : usernames) { |
| | | CString cstrUsername(username.c_str()); |
| | | m_comboUser.AddString(cstrUsername); |
| | | } |
| | | m_comboUser.SetCurSel(0); |
| | | |
| | | // 设置为 30 天å |
| | | COleDateTime currentTime = COleDateTime::GetCurrentTime(); |
| | | COleDateTime defaultStartTime = currentTime - COleDateTimeSpan(30, 0, 0, 0); |
| | | m_dateTimeStart.SetTime(defaultStartTime); |
| | | |
| | | CRect screenRect, dlgRect, clientRect; |
| | | GetClientRect(&clientRect); |
| | | m_nInitialWidth = clientRect.Width(); |
| | | m_nInitialHeight = clientRect.Height(); |
| | | |
| | | // åå§åé»è®¤åä½ |
| | | CFont* pDefaultFont = GetOrCreateFont(12); |
| | | |
| | | // éåææåæ§ä»¶ï¼è®°å½åå§ä½ç½®å¹¶è®¾ç½®é»è®¤åä½ |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | int nCtrlID = pWnd->GetDlgCtrlID(); |
| | | if (nCtrlID != -1) { |
| | | // è®°å½æ§ä»¶åå§å¸å± |
| | | CRect ctrlRect; |
| | | pWnd->GetWindowRect(&ctrlRect); |
| | | ScreenToClient(&ctrlRect); |
| | | m_mapCtrlLayouts[nCtrlID] = ctrlRect; |
| | | |
| | | // è·³è¿ç¹æ®æ§ä»¶ï¼å¦ MFCGridCtrlï¼ |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | pWnd = pWnd->GetNextWindow(); |
| | | continue; |
| | | } |
| | | |
| | | // 设置é»è®¤åä½ |
| | | pWnd->SetFont(pDefaultFont); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | |
| | | GetWindowRect(&dlgRect); |
| | | int dlgWidth = dlgRect.Width() * 2; |
| | | int dlgHeight = dlgRect.Height() * 2; |
| | | |
| | | SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0); |
| | | if (dlgWidth > screenRect.Width()) { |
| | | dlgWidth = screenRect.Width(); |
| | | } |
| | | if (dlgHeight > screenRect.Height()) { |
| | | dlgHeight = screenRect.Height(); |
| | | } |
| | | |
| | | int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2; |
| | | int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2; |
| | | MoveWindow(centerX, centerY, dlgWidth, dlgHeight); |
| | | |
| | | InitSystemLogManager(); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | |
| | | // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç |
| | | if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) { |
| | | return; |
| | | } |
| | | |
| | | float dScaleX = static_cast<float>(cx) / m_nInitialWidth; |
| | | float dScaleY = static_cast<float>(cy) / m_nInitialHeight; |
| | | |
| | | // éåå¯¹è¯æ¡ä¸çæææ§ä»¶ |
| | | AdjustControls(dScaleX, dScaleY); |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI) |
| | | { |
| | | // TODO: 卿¤æ·»å æ¶æ¯å¤çç¨åºä»£ç å/æè°ç¨é»è®¤å¼ |
| | | lpMMI->ptMinTrackSize.x = 400; // æå°å®½åº¦ |
| | | lpMMI->ptMinTrackSize.y = 300; // æå°é«åº¦ |
| | | |
| | | CDialogEx::OnGetMinMaxInfo(lpMMI); |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnBnClickedButtonSearch() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | try { |
| | | m_nCurrentPage = 1; |
| | | FillSystemLogManager(); |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("æç´¢å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnBnClickedButtonPrevPage() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | try { |
| | | if (m_nCurrentPage > 1) { |
| | | m_nCurrentPage--; |
| | | FillSystemLogManager(); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("å·²ç»æ¯ç¬¬ä¸é¡µï¼")); |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("忢å°ä¸ä¸é¡µå¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnBnClickedButtonNextPage() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | try { |
| | | if (m_nCurrentPage < m_nTotalPages) { |
| | | m_nCurrentPage++; |
| | | FillSystemLogManager(); |
| | | } |
| | | else { |
| | | AfxMessageBox(_T("å·²ç»æ¯æåä¸é¡µï¼")); |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("忢å°ä¸ä¸é¡µå¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnSelchangeComboType() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | try { |
| | | m_nCurrentPage = 1; |
| | | FillSystemLogManager(); |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("åæ¢ç±»å失败ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | void CSystemLogManagerDlg::OnSelchangeComboUser() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | try { |
| | | m_nCurrentPage = 1; |
| | | FillSystemLogManager(); |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("忢è§è²å¤±è´¥ï¼%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |