//删除用户按钮响应 void CTuopList::BeforeDelUser() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "BeforeDelUser"; LogItem.sDesc = strDelCon; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //m_pTopologyListTable->HideNullTip(); for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) { if(m_pRecordList->pCheckBox->isChecked() == true ) { if(pHideBtn) { string strDelDes = pHideBtn->getEncodeCmd("xclicked()") ; if(!strDelDes.empty()) { strDelDes = "_Delclick('" + strDel + "','" + szButNum + "','" + szButMatch + "','" + strDelDes + "');"; WebSession::js_af_up = strDelDes; } } break; } } DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void CSVWholeview::refresh() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "wholetree"; LogItem.sHitFunc = "refresh"; LogItem.sDesc = strRefresh; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); svutil::TTime ttime = svutil::TTime::GetCurrentTimeEx(); string curTime = ttime.Format(); if(m_pTime) m_pTime->setText(m_szRefreshTime + curTime); char szQuery[4096]={0}; int nSize = 4095; m_nShowType = -1; GetEnvironmentVariable( "QUERY_STRING", szQuery,nSize); char *pPos = strchr(szQuery, '='); if(pPos) { pPos ++; m_nShowType = atoi(pPos); } string szUserID = GetWebUserID(); if(szUserID != m_szUserID) { m_szUserID = szUserID; if(m_pSVUser) m_pSVUser->setUserID(m_szUserID); else m_pSVUser = new CUser(m_szUserID); } clearTree(); initTree(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
bool GetUserRight(string strRight) { bool bRight = false; string strSection = GetWebUserID(); //管理员则有所有权限 if(GetIniFileInt(strSection, "nAdmin", -1, "user.ini") != -1) return true; if(GetIniFileInt(strSection, strRight, 0, "user.ini") == 1) bRight = true; else bRight = false; return bRight; //return true; }
void CSVAddPlan::Cancel() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "Plan Set"; LogItem.sHitFunc = "Cancel"; LogItem.sDesc = szCancelAdd; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); emit SCancel(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void TrendReportFrame::initTreeTable() { strListHeights = ""; strListPans = ""; strListTitles = ""; // m_treePanelTable = new WSTreeAndPanTable(this); //AddJsParamToTable("treeviewPanel", m_treePanelTable->formName()); AddJsParam("treeviewPanel", m_treePanelTable->formName()); //TreeTable new WText("<div id='tree_panel' name='tree_panel' class='panel_tree'>", m_treePanelTable->elementAt(0, 0)); WTable * pTreeTable = new WTable(m_treePanelTable->elementAt(0, 0)); new WText(" ",pTreeTable->elementAt(0,0)); pTreeTable->elementAt(0,0)->setContentAlignment(AlignCenter | AlignTop); m_pTrendReportTree = new CCheckBoxTreeView((WTableCell*)pTreeTable->elementAt(0,0)); //new WText("<br>", m_pTrendReportTree->elementAt(0, 0)); if(m_pTrendReportTree) { string strSection = GetWebUserID(); m_pTrendReportTree->InitTree("", false, false, false, strSection); WObject::connect(m_pTrendReportTree, SIGNAL(ReportQueryRequest()), this, SLOT(ReportQueryResponse())); } m_pTrendReportTree->setStyleClass("viewtreebody"); new WText("</div>", pTreeTable->elementAt(0, 0)); //DragTable AddJsParam("drag_tree", m_treePanelTable->elementAt(0, 1)->formName()); //AddJsParamToTable("drag_tree", m_treePanelTable->elementAt(0, 1)->formName()); //PanTable new WText("<div id='view_panel' class='panel_view'>", m_treePanelTable->elementAt(0, 2)); m_pMainTable = new WSVMainTable(m_treePanelTable->elementAt(0, 2), strTrendTitle, true); if (m_pMainTable->pHelpImg) { connect(m_pMainTable->pHelpImg,SIGNAL(click()),this,SLOT(ShowHelp())); } initQueryTable(&m_pQueryTable, 1, "", m_pMainTable); new WText("</div>", m_treePanelTable->elementAt(0, 2)); }
//编辑事件的处理函数 void CTuopList::EditUserName(const std::string strIndex) { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "EditUserName"; LogItem.sDesc = strNameEdit; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //查找名称相同的用户 for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) { if(strIndex == m_pRecordList->strUserName) { bStrCurr = m_pRecordList->strUserName; m_pRecordList->pstrUserName->hide(); m_pRecordList->pLineEdit->show(); pCurrName = m_pRecordList->pstrUserName; pCurrEditUserName = m_pRecordList->pLineEdit; m_pRecordList->pLineEdit->enable(); } else { m_pRecordList->pstrUserName->show(); // m_pRecordList->pLineEdit->setText(m_pRecordList->pstrUserName->text()); m_pRecordList->pLineEdit->hide(); } } DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void TrendReportFrame::TrendReportQuery() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TrendReport"; LogItem.sHitFunc = "TrendReportQuery"; LogItem.sDesc = strQueryBtn; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); m_strMonitorid = m_pTrendReportTree->getSelMonitorID(); m_startTime = MakeTTime(pAlertStartTime->text()); m_endTime = MakeTTime(pAlertEndTime->text()); ChangeTrendReport(m_strMonitorid, m_startTime, m_endTime); WebSession::js_af_up = "hiddenbar()"; DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void CTuopList::refresh() { bool bEnd = false; string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "refresh"; LogItem.sDesc = strRefresh; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); OPEnd: if(bEnd) { DWORD dcalEnd=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd -dcalBegin); return; } if(bFirst) { bFirst =false; bEnd = true; goto OPEnd; } m_pTopologyListTable->GeDataTable()->clear(); RecordList.clear(); pSortTable->GeDataTable()->clear(); std::string strIndex; std::list<string> m_pList; std::list<string>::iterator m_pItem; #ifdef Tuopu m_pList = ReadFileName(GetSiteViewRootPath() + "\\htdocs\\tuoplist"); #else m_pList = ReadFileName(GetSiteViewRootPath() + "\\htdocs\\maintainlist"); #endif std::list<string> m_pVList; std::list<string>::iterator m_pVItem; #ifdef Tuopu m_pVList = ReadVSDName(GetSiteViewRootPath() + "\\htdocs\\tuoplist"); #else m_pVList = ReadVSDName(GetSiteViewRootPath() + "\\htdocs\\maintainlist"); #endif m_pVItem = m_pVList.begin(); for(m_pItem = m_pList.begin(); m_pItem != m_pList.end(); m_pItem++) { std::string strUserName = *m_pItem; std::string strVSD = *m_pVItem; OneRecord list; list.strUserName = strUserName; //vsd文件始终不会更改, 所以用它来制造key list.strBackName = ReplaceStdString(strVSD, ".vsd", ".htm"); list.strTuop = strVSD; //读取tuopfile.ini的sort信息并赋值给OneRecord变量。: //如果没有预先设置的sort信息则按什么规则自动赋值? ---》先是读预先设置的序号, 为默认值 则不存在 意味着是新发布的 //---》规则(读一遍ini, 找到序号最大值, 加1 并写到tuopfile.ini文件中) int nSort = GetIniFileInt("sort", strVSD, -1, "tuopfile.ini"); if(nSort != -1) { list.nSort = nSort; } else { //获取序号最大值, 加1 list.nSort = GetMaxSortId() + 1; //写序号值到ini #ifdef Tuopu WriteIniFileInt("sort", strVSD, list.nSort, "tuopfile.ini"); #else WriteIniFileInt("sort", strVSD, list.nSort, "maintainfile.ini"); #endif } RecordList.push_back(list); m_pVItem++; } //显示列表 int i = 1; std::string strOpen; for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) { m_pTopologyListTable->InitRow(i); pSortTable->InitRow(i); i++; } i = 1; for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) { m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 0)->setContentAlignment(AlignCenter); m_pRecordList->pCheckBox = new WCheckBox("", (WContainerWidget*)m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 0)); strOpen = "<a href=./showtuopu.exe?pageid="; strOpen += ReplaceStdString(m_pRecordList->strBackName, ".htm", ""); #ifdef Tuopu strOpen += "&version=0"; #else strOpen += "&version=0&usrleader=0&maintain=1"; #endif strOpen += " target=_blank>"; strOpen += m_pRecordList->strUserName; strOpen += "</a>"; m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 2)->setContentAlignment(AlignCenter); m_pRecordList->pstrUserName = new WText(strOpen, (WContainerWidget*)m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 2)); m_pRecordList->pLineEdit = new WLineEdit(m_pRecordList->strUserName,m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 2)); m_pRecordList->pLineEdit->hide(); m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 4)->setContentAlignment(AlignCenter); m_pRecordList->pTuop = new WImage("../Images/resource.gif",m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 4)); m_pRecordList->pTuop->setToolTip(strTuopTip); m_pRecordList->pTuop->setStyleClass("hand"); //绑定visio事件 std::string strJavascript; #ifdef Tuopu strJavascript = "window.open('../tuoplist/" + m_pRecordList->strTuop + "','newwindow')"; #else strJavascript = "window.open('../maintainlist/" + m_pRecordList->strTuop + "','newwindow')"; #endif connect(m_pRecordList->pTuop, SIGNAL(clicked()),strJavascript.c_str() ,WObject::JAVASCRIPT ); m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 6)->setContentAlignment(AlignCenter); m_pRecordList->pEdit = new WImage("/Images/edit.gif",m_pTopologyListTable->GeDataTable()->elementAt(m_pRecordList->nSort, 6)); m_pRecordList->pEdit->setToolTip(strEditTip); m_pRecordList->pEdit->setStyleClass("hand"); strIndex=m_pRecordList->strUserName.c_str(); m_userMapper.setMapping(m_pRecordList->pEdit, strIndex); connect(m_pRecordList->pEdit, SIGNAL(clicked()), &m_userMapper, SLOT(map())); connect(m_pRecordList->pLineEdit, SIGNAL(keyWentDown(int)), this, SLOT(EditReturn(int))); i++; //排序界面初始化 pSortTable->GeDataTable()->elementAt(m_pRecordList->nSort, 2)->setContentAlignment(AlignCenter); WText * pTmpText = new WText(m_pRecordList->strUserName, pSortTable->GeDataTable()->elementAt(m_pRecordList->nSort, 2)); char chItem[32] = {0}; sprintf(chItem, "%d", m_pRecordList->nSort); string strSort = chItem; pSortTable->GeDataTable()->elementAt(m_pRecordList->nSort, 4)->setContentAlignment(AlignCenter); WLineEdit * pTmpEdit = new WLineEdit(strSort, pSortTable->GeDataTable()->elementAt(m_pRecordList->nSort, 4)); //放到sv_table里去 SVTableCell ce; ce.setType(adText); ce.setValue(pTmpText); m_svSortList.WriteCell(m_pRecordList->strTuop, 0, ce); ce.setType(adLineEdit); ce.setValue(pTmpEdit); m_svSortList.WriteCell(m_pRecordList->strTuop, 1, ce); } m_pList.clear(); m_pVList.clear(); //列表为空 if(RecordList.size() <= 0) { m_pTopologyListTable->ShowNullTip(); } else { m_pTopologyListTable->HideNullTip(); } //可能有问题.. pSortTable->hide(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void CTuopList::EditReturn(int keyCode) { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "EditReturn"; LogItem.sDesc = strReturnSave; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); // OutputDebugString("EditReturn\n"); if(keyCode == 13) { char buf[1024]; memset(buf, 0, 1023); string str = pCurrEditUserName->text(); sprintf(buf, "%s", str.c_str()); // OutputDebugString(buf); std::list<string> keylist; std::list<string>::iterator itemkey; #ifdef Tuopu bool bret = GetIniFileKeys("filename", keylist, "tuopfile.ini"); #else bool bret = GetIniFileKeys("filename", keylist, "maintainfile.ini"); #endif if(!bret) { // } bool bExist1 = true; std::string sVal = ""; std::string defaultret = "error"; std::string sret = ""; //此名字是否已经存在? for(itemkey = keylist.begin(); itemkey != keylist.end(); itemkey++) { sVal = *itemkey; #ifdef Tuopu sret = GetIniFileString("filename", sVal, defaultret, "tuopfile.ini"); #else sret = GetIniFileString("filename", sVal, defaultret, "maintainfile.ini"); #endif if(strcmp(sret.c_str(), bStrCurr.c_str()) == 0) { continue; } if(strcmp(sret.c_str(), str.c_str()) == 0) { bExist1 = false; } } // OutputDebugString("befor bExtit1\n"); if(bExist1) { for(itemkey = keylist.begin(); itemkey != keylist.end(); itemkey++) { sVal = *itemkey; #ifdef Tuopu sret = GetIniFileString("filename", sVal, defaultret, "tuopfile.ini"); #else sret = GetIniFileString("filename", sVal, defaultret, "maintainfile.ini"); #endif if(strcmp(sret.c_str(), bStrCurr.c_str()) == 0) { // OutputDebugString("befor write1\n"); #ifdef Tuopu WriteIniFileString("filename", sVal, str, "tuopfile.ini"); #else WriteIniFileString("filename", sVal, str, "maintainfile.ini"); #endif break; } } string strOpen; strOpen = "<a href=./showtuopu.exe?pageid="; strOpen += ReplaceStdString(sVal, ".htm", ""); #ifdef Tuopu strOpen += "&version=0"; #else strOpen += "&version=0&usrleader=0&maintain=1"; #endif strOpen += " target=_blank>"; strOpen += buf; strOpen += "</a>"; pCurrName->setText(strOpen.c_str()); pCurrName->show(); pCurrEditUserName->hide(); //插记录到UserOperateLog表 string strUserID = GetWebUserID(); TTime mNowTime = TTime::GetCurrentTimeEx(); OperateLog m_pOperateLog; m_pOperateLog.InsertOperateRecord("UserOperateLog",strUserID,mNowTime.Format(),strEditTip,strMainTitle,buf); } else { WebSession::js_af_up = "alert('"; WebSession::js_af_up += "have same name tuop"; WebSession::js_af_up += "')"; } } DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
//删除操作 void CTuopList::DelUser() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "DelUser"; LogItem.sDesc = strDeleteType; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); string strDeleteTuop; for(m_pRecordList = RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList++) { if (m_pRecordList->pCheckBox->isChecked()) { std::string sVal = m_pRecordList->strBackName; std::string sVsd = ReplaceStdString(sVal, ".htm", ".vsd"); std::string sDiretory = ReplaceStdString(sVal, ".htm", ".files"); #ifdef Tuopu DeleteIniFileKey("filename", sVal, "tuopfile.ini"); DeleteIniFileKey("filename", sVsd, "tuopfile.ini"); #else std::string sName = ReplaceStdString(m_pRecordList->strBackName, ".htm", ""); DeleteIniFileKey("filename", sVal, "maintainfile.ini"); DeleteIniFileKey("filename", sVsd, "maintainfile.ini"); DeleteIniFileSection(sName, "maintain.ini"); #endif //std::string filepath = "C:\\Program Files\\Apache Group\\apache2\\htdocs\\tuoplist\\"; //删除了拓扑图 序号怎么变?---》是直接删除呢? 还是要加把其他的序号都整理一遍?---》或者把大于它的序号都减1即可。 DelSortId(sVsd); string strDelDir; #ifdef Tuopu std::string filepath = GetSiteViewRootPath() + "\\htdocs\\tuoplist\\"; filepath += sVal; bool bret = DeleteFile(filepath.c_str()); if(!bret) { // } #else std::string filepath = GetSiteViewRootPath() + "\\htdocs\\maintainlist\\"; std::string fileleaderpath = GetSiteViewRootPath() + "\\htdocs\\maintainleaderlist\\"; strDelDir = GetSiteViewRootPath() + "\\htdocs\\maintainlist\\"; filepath += sVal; bool bret = DeleteFile(filepath.c_str()); if(!bret) { // } fileleaderpath += sVal; bret = DeleteFile(fileleaderpath.c_str()); if(!bret) { // } strDelDir += sDiretory; //DeleteDirectory(strDelDir); #endif #ifdef Tuopu filepath = GetSiteViewRootPath() + "\\htdocs\\tuoplist\\"; filepath += sVsd; bret = DeleteFile(filepath.c_str()); if(!bret) { // } #else filepath = GetSiteViewRootPath() + "\\htdocs\\maintainlist\\"; fileleaderpath = GetSiteViewRootPath() + "\\htdocs\\maintainleaderlist\\"; filepath += sVsd; bret = DeleteFile(filepath.c_str()); if(!bret) { // } fileleaderpath += sVsd; bret = DeleteFile(fileleaderpath.c_str()); if(!bret) { // } #endif //files目录是否也删除 int nRow = ((WTableCell*)(m_pRecordList->pCheckBox->parent()))->row(); list<OneRecord>::iterator pItem = m_pRecordList; m_pRecordList --; std::string temp = pItem->pstrUserName->text(); int pos = temp.find(">", 0); int pos1 = temp.find("<", pos); string strTemp = temp.substr(pos + 1, pos1 - pos - 1); strDeleteTuop += strTemp; strDeleteTuop += " "; RecordList.erase(pItem); m_pTopologyListTable->GeDataTable()->deleteRow(nRow); } } //列表为空 if(RecordList.size() <= 0) { m_pTopologyListTable->ShowNullTip(); } else { m_pTopologyListTable->HideNullTip(); } //插记录到UserOperateLog表 TTime mNowTime = TTime::GetCurrentTimeEx(); OperateLog m_pOperateLog; m_pOperateLog.InsertOperateRecord("UserOperateLog",strUserID,mNowTime.Format(),strDeleteType,strMainTitle,strDeleteTuop); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
//界面排序完毕 void CTuopList::SortOk() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "SortOk"; LogItem.sDesc = strSaveSort; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //数据有效性判断 如果编辑过程中 输入无效的序号 怎么处理?---》小于等于零 有重复数字 不连续 等?---》不容易完全判定清楚, 暂时不判定。 //是数字吗? //if(!pAlertStop->text().empty()) //{ // nRet = sscanf(pAlertStop->text().c_str(), "%d", &nTmp); // if(nRet == EOF || nRet == 0 || nTmp < 0) // { // errorMsgList.push_back(strAlertStopError); // bError = true; // } // else // { // sprintf(chItem, "%d", nTmp); // pAlertStop->setText(chItem); // } //} //写拓扑图的顺序数据到ini for(row it = m_svSortList.begin(); it != m_svSortList.end(); it++) { SVTableCell * pcell = it->second.Cell(1); if(pcell) { // 修改每一项的选择状态 if (pcell->Type() == adLineEdit) { // int nSort = 0; string strSortId = ((WLineEdit*)pcell->Value())->text(); sscanf(strSortId.c_str(), "%d", &nSort); //OutputDebugString(pcell->Row()); //OutputDebugString(strSortId.c_str()); // #ifdef Tuopu WriteIniFileInt("sort", pcell->Row(), nSort, "tuopfile.ini"); #else WriteIniFileInt("sort", pcell->Row(), nSort, "maintainfile.ini"); #endif } } } //更新拓扑列表的数据 //RecordList需要重新构造---》刷新函数能解决此问题吗?---》应该能解决 refresh(); //界面隐现 pSortTable->hide(); m_pTopologyListTable->show(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
//显示排序界面 void CTuopList::Sort() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "Sort"; LogItem.sDesc = szSort; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //m_svSortList.clear(); ////pSortListTable->clear(); ////pSortTable->GetContentTable()->elementAt(0,0)->clear(); //pSortTable->GeDataTable()->clear(); ////排序界面怎么新构造? 名称 序号 (隐藏、显示、编辑、保存)? 初始化时怎么排列呢?---》以序号排吗? ////根据RecordList添加排序界面数据 ////pSortListTable = new WTable(pSortTable->GetContentTable()->elementAt(0,0)); ////pSortListTable->setStyleClass("t3"); ////AddSortColum(pSortListTable); //// //int i = 1; //for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) //{ // pSortTable->InitRow(i); // i++; //} //// //for(m_pRecordList=RecordList.begin(); m_pRecordList != RecordList.end(); m_pRecordList ++) //{ // //m_pRecordList->strTuop // //m_pRecordList->strUserName // //m_pRecordList->nSort // char chItem[32] = {0}; // sprintf(chItem, "%d", m_pRecordList->nSort); // string strSort = chItem; // AddSortData(m_pRecordList->strTuop, m_pRecordList->nSort, m_pRecordList->strUserName, strSort); //} //////界面隐现 //新增 //// //////排序 ////pSort = new WImage("../Images/sort.gif",(WContainerWidget *)pUserTable->m_pGroupOperate->elementAt(0, 5)); ////if (pSort) //// { //// pSort->setStyleClass("imgbutton"); //// pSort->setToolTip(szSort); //// } m_pTopologyListTable->hide(); pSortTable->show(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void CSVReportSet::DelPhone() { string strDeletePhone; for(m_pListItem = m_pListReport.begin(); m_pListItem != m_pListReport.end(); m_pListItem++) { if (m_pListItem->pSelect->isChecked()) { std::string temp = m_pListItem->pName->text(); int pos = temp.find(">", 0); int pos1 = temp.find("<", pos); temp = temp.substr(pos + 1, pos1 - pos - 1); DeleteIniFileSection(temp, "reportset.ini"); int nRow = ((WTableCell*)(m_pListItem->pSelect->parent()))->row(); list<REPORT_LIST>::iterator pItem = m_pListItem; m_pListItem --; strDeletePhone += temp; strDeletePhone += " "; m_pListReport.erase(pItem); //jansion.zhou 2006-12-18 //m_ptbPhone->deleteRow(nRow); m_pReportListTable->GeDataTable()->deleteRow(nRow); std::list<string> sectionlist; std::list<string>::iterator sectionitem; GetIniFileSections(sectionlist, "reportgenerate.ini"); int num =2; for(sectionitem = sectionlist.begin(); sectionitem != sectionlist.end(); sectionitem++) { std::string tempsection = *sectionitem; pos = tempsection.find("$", 0); if(pos < 0) { continue; } std::string substr = tempsection.substr(0, pos); if(strcmp(substr.c_str(), temp.c_str()) == 0) { DeleteIniFileSection(tempsection, "reportgenerate.ini"); } } } } if(m_pListReport.size() <= 0) { m_pReportListTable->ShowNullTip(); } else { m_pReportListTable->HideNullTip(); } //if(m_pListReport.size() == 0) //{ // WText * nText = new WText("[----------统计报告列表为空-----------]", (WContainerWidget*)nullTable -> elementAt(0, 0)); // nText ->decorationStyle().setForegroundColor(Wt::red); // nullTable -> elementAt(0, 0) -> setContentAlignment(AlignTop | AlignCenter); //} //插记录到UserOperateLog表 string strUserID = GetWebUserID(); TTime mNowTime = TTime::GetCurrentTimeEx(); OperateLog m_pOperateLog; m_pOperateLog.InsertOperateRecord("UserOperateLog",strUserID,mNowTime.Format(),m_formText.szTipDel,m_formText.szMainTitle,strDeletePhone); }
void TrendReportFrame::refresh() { OutputDebugString("----------TrendReportFrame Refresh------------\n"); string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TrendReport"; LogItem.sHitFunc = "refresh"; LogItem.sDesc = strRefresh; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //刷新树 string strSection = GetWebUserID(); m_pTrendReportTree->InitTree("", false, false, false, strSection); //if(m_treePanelTable != NULL) //{ // m_treePanelTable->clear(); // delete m_treePanelTable; // m_treePanelTable = NULL; // // /*this->clear();*/ // //m_treePanelTable->hide(); // //m_treePanelTable->show(); // //m_treePanelTable->refresh(); // // // //m_pTrendReportTree->hide(); // //m_pTrendReportTree->show(); // //m_pTrendReportTree->refresh(); // // // //m_pMainTable->hide(); // //m_pMainTable->show(); // //m_pMainTable->refresh(); // // // //m_pQueryTable->hide(); // //m_pQueryTable->show(); // //m_pQueryTable->refresh(); // //this->refresh(); // initTreeTable(); //} int bTrans = GetIniFileInt("translate", "translate", 0, "general.ini"); if(bTrans == 1) { this->pTranslateBtn->show(); connect(this->pTranslateBtn, SIGNAL(clicked()), this, SLOT(Translate())); this->pExChangeBtn->show(); connect(this->pExChangeBtn, SIGNAL(clicked()), this, SLOT(ExChange())); } else { this->pTranslateBtn->hide(); this->pExChangeBtn->hide(); } DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }
void CSVAddPlan::Save() { bool bEnd = false; string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "Plan Set"; LogItem.sHitFunc = "Save"; LogItem.sDesc = szSaveAddInPlan; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); OPEnd: if(bEnd) { DWORD dcalEnd=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd -dcalBegin); return; } ADD_PLAN_OK addPlan; bool bCheck = 0; addPlan.szName = m_pName->text(); std::list<string> errorMsgList; if (addPlan.szName.empty()) { errorMsgList.push_back(m_FormShowText.szErrorMsg); AddRangeTable->ShowErrorMsg(errorMsgList); //m_pPlanNameError->show(); bEnd = true; goto OPEnd; } //else //{ // AddRangeTable -> HideAllErrorMsg(); // //m_pPlanNameError-> hide(); //} std::string str1 = m_pTasklist->m_pStart[1]->text(); //Jansion.zhou 2006-12-25 //m_pErrMsg->setText(""); //m_pErrMsg->hide(); addPlan.nIndex = m_nIndex; std::list<string> tasknamelist; std::list<string>::iterator m_pItem; bool IsSave = false; bool IsConn = GetAllTaskName(tasknamelist); if(IsConn) { OutputDebugString("----------------isconn true------------------\n"); for(m_pItem = tasknamelist.begin(); m_pItem != tasknamelist.end(); m_pItem++) { std::string str = *m_pItem; if(strcmp(str.c_str(), addPlan.szName.c_str()) == 0) { IsSave = true; break; } } if(strcmp(chgstr.c_str(), "") == 0) { if(!IsSave) { OutputDebugString("----------------Issave false------------------\n"); OBJECT hTask = CreateTask(addPlan.szName); SetTaskValue("Type", m_FormShowText.szPlanTypeRel, hTask); char buf[256]; for(int i = 0; i < 7; i++) { itoa(i, buf, 10); std::string temp = m_pTasklist->m_pStart[i]->text(); std::string temp1 = "start"; temp1 += buf; SetTaskValue(temp1, temp, hTask); temp = m_pTasklist->m_pEnd[i]->text(); temp1 = "end"; temp1 += buf; SetTaskValue(temp1, temp, hTask); temp1 = "Allow"; temp1 += buf; std::string temp3 = m_pTasklist->m_pCombo[i]->currentText(); if(strcmp(temp3.c_str(), strAllown.c_str()) == 0) { SetTaskValue(temp1, m_FormShowText.szStatusAllow, hTask); } else { SetTaskValue(temp1, m_FormShowText.szStatusDeny, hTask); } } SetTaskValue("Description", textarea->text(), hTask); SubmitTask(hTask); //Jansion.zhou 2006-12-25 //m_pErrMsg->setText(""); //m_pErrMsg->hide(); addPlan.nIndex = m_nIndex; //插记录到UserOperateLog表 string strUserID = GetWebUserID(); TTime mNowTime = TTime::GetCurrentTimeEx(); OperateLog m_pOperateLog; m_pOperateLog.InsertOperateRecord("UserOperateLog",strUserID,mNowTime.Format(),strTypeAdd,strTimeTaskPlan,m_pName->text()); emit Successful(addPlan); } else { OutputDebugString("----------------Issave true------------------\n"); //Jansion.zhou 2006-12-25 //m_pErrMsg->setText(m_FormShowText.szErrorMsg1); //m_pErrMsg->show(); errorMsgList.push_back(m_FormShowText.szErrorMsg1); AddRangeTable->ShowErrorMsg(errorMsgList); } } else { std::string str; for(m_pItem = tasknamelist.begin(); m_pItem != tasknamelist.end(); m_pItem++) { str = *m_pItem; if(strcmp(str.c_str(), addPlan.szName.c_str()) == 0) { if(strcmp(str.c_str(), chgstr.c_str()) != 0) { IsSave = true; break; } else { IsSave = false; break; } } } if(!IsSave) { OutputDebugString("----------------Issave00 false------------------\n"); OBJECT hTask = GetTask(chgstr); SetTaskValue("Type", m_FormShowText.szPlanTypeRel, hTask); char buf[256]; for(int i = 0; i < 7; i++) { itoa(i, buf, 10); std::string temp = m_pTasklist->m_pStart[i]->text(); std::string temp1 = "start"; temp1 += buf; SetTaskValue(temp1, temp, hTask); temp = m_pTasklist->m_pEnd[i]->text(); temp1 = "end"; temp1 += buf; SetTaskValue(temp1, temp, hTask); temp1 = "Allow"; temp1 += buf; std::string temp3 = m_pTasklist->m_pCombo[i]->currentText(); if(strcmp(temp3.c_str(), strAllown.c_str()) == 0) { SetTaskValue(temp1, m_FormShowText.szStatusAllow, hTask); } else { SetTaskValue(temp1, m_FormShowText.szStatusDeny, hTask); } } SetTaskValue("Description", textarea->text(), hTask); EditTask(hTask,addPlan.szName); //Jansion.zhou 2006-12-25 //m_pErrMsg->setText(""); //m_pErrMsg->hide(); addPlan.nIndex = m_nIndex; //插记录到UserOperateLog表 string strUserID = GetWebUserID(); TTime mNowTime = TTime::GetCurrentTimeEx(); OperateLog m_pOperateLog; m_pOperateLog.InsertOperateRecord("UserOperateLog",strUserID,mNowTime.Format(),strTypeEdit,strTimeTaskPlan,m_pName->text()); chgstr = ""; emit Successful(addPlan); } else { OutputDebugString("----------------Issave000 true------------------\n"); //Jansion.zhou 2006-12-25 //m_pErrMsg->setText(m_FormShowText.szErrorMsg1); //m_pErrMsg->show(); errorMsgList.push_back(m_FormShowText.szErrorMsg1); AddRangeTable->ShowErrorMsg(errorMsgList); } } } else { } DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }