//删除了拓扑图 序号怎么变?---》是直接删除呢? 还是要加把其他的序号都整理一遍?---》或者把大于它的序号都减1即可。 void DelSortId(string strVsd) { //获取要删除 sortid 删除该记录 int nDelSortId = 0; #ifdef Tuopu nDelSortId = GetIniFileInt("sort", strVsd, -1, "tuopfile.ini"); DeleteIniFileKey("sort", strVsd, "tuopfile.ini"); #else nDelSortId = GetIniFileInt("sort", strVsd, -1, "maintainfile.ini"); DeleteIniFileKey("sort", strVsd, "maintainfile.ini"); #endif //删除了拓扑图 序号怎么变?---》是直接删除呢? 还是要加把其他的序号都整理一遍?---》或者把大于它的序号都减1即可。 std::list<string> keylist; std::list<string>::iterator itemkey; #ifdef Tuopu bool bret = GetIniFileKeys("sort", keylist, "tuopfile.ini"); #else bool bret = GetIniFileKeys("sort", keylist, "maintainfile.ini"); #endif if(bret) { std::string sVal = ""; int nSort = 0; for(itemkey = keylist.begin(); itemkey != keylist.end(); itemkey++) { sVal = *itemkey; #ifdef Tuopu nSort = GetIniFileInt("sort", sVal, -1, "tuopfile.ini"); #else nSort = GetIniFileInt("sort", sVal, -1, "maintainfile.ini"); #endif if(nSort > nDelSortId) { nSort--; #ifdef Tuopu WriteIniFileInt("sort", sVal, nSort, "tuopfile.ini"); #else WriteIniFileInt("sort", sVal, nSort, "maintainfile.ini"); #endif } } } }
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::ShowMainTable() { //strNullList = "空的列表"; m_pMainTable = new WSVMainTable(this,strMainTitle,false); //if(m_pMainTable->pHelpImg) //{ // connect(m_pMainTable->pHelpImg,SIGNAL(click()),this,SLOT(ShowHelp())); //} //拓扑列表界面 m_pTopologyListTable = new WSVFlexTable(m_pMainTable->GetContentTable()->elementAt(0,0),List, strTitle); if (m_pTopologyListTable->GetContentTable() != NULL) { m_pTopologyListTable->AppendColumn("",WLength(40,WLength::Pixel)); m_pTopologyListTable->SetDataRowStyle("table_data_grid_item_text"); m_pTopologyListTable->AppendColumn(strLoginLabel,WLength(70,WLength::Percentage)); m_pTopologyListTable->SetDataRowStyle("table_data_grid_item_text"); m_pTopologyListTable->AppendColumn(strNameUse,WLength(10,WLength::Percentage)); m_pTopologyListTable->SetDataRowStyle("table_data_grid_item_text"); m_pTopologyListTable->AppendColumn(strNameEdit,WLength(10,WLength::Percentage)); m_pTopologyListTable->SetDataRowStyle("table_data_grid_item_text"); } if (m_pTopologyListTable->GetActionTable() != NULL) { m_pTopologyListTable->AddStandardSelLink(strAllSel ,strAllNotSel,strFanSel); connect(m_pTopologyListTable->pSelAll, SIGNAL(clicked()), this, SLOT(SelAll())); connect(m_pTopologyListTable->pSelNone, SIGNAL(clicked()), this, SLOT(SelNone())); connect(m_pTopologyListTable->pSelReverse, SIGNAL(clicked()), this, SLOT(SelInvert())); WTable *pTbl; m_pTopologyListTable->GetActionTable()->elementAt(0,1)->setContentAlignment(AlignCenter); m_pTopologyListTable->GetActionTable()->elementAt(0,1)->setStyleClass("textbold"); pTbl = new WTable(m_pTopologyListTable->GetActionTable()->elementAt(0,1)); pTbl->setStyleClass("widthauto"); WSVButton * pDel = new WSVButton(pTbl->elementAt(0,1),strDelete, "button_bg_del.png", "", false); if (pDel) { connect(pDel, SIGNAL(clicked()), this, SLOT(BeforeDelUser())); } //新增 //WSVButton * pSort = new WSVButton(pTbl->elementAt(0,2), "排序", "button_bg_taxis.png", "", false); WSVButton * pSort = new WSVButton(pTbl->elementAt(0,2), strSort, "button_bg_taxis.png", "", false); if (pSort) { connect(pSort, SIGNAL(clicked()), this, SLOT(Sort())); } //WTable *pTbl2; m_pTopologyListTable->GetActionTable()->elementAt(0, 2)->setContentAlignment(AlignRight); strcpy(m_pTopologyListTable->GetActionTable()->elementAt(0, 2)->contextmenu_, "nowrap"); //Tuopu 发布插件下载 string strTuopPluginJs = "window.open('../TuopoClient.exe','newwindow')"; string szLink = "<a href='#'>" + szTuopDown + "</a> "; WText * pTuopPlugin = new WText(szLink, (WContainerWidget *)m_pTopologyListTable->GetActionTable()->elementAt(0, 2)); connect(pTuopPlugin, SIGNAL(clicked()),strTuopPluginJs.c_str() ,WObject::JAVASCRIPT); } m_pTopologyListTable->SetNullTipInfo(strNullList); //拓扑排序列表界面 //pSortTable = new WSVFlexTable(m_pMainTable->GetContentTable()->elementAt(1,0), List, "拓扑排序列表"); pSortTable = new WSVFlexTable(m_pMainTable->GetContentTable()->elementAt(1,0), List, strTuoPuSortList); if (pSortTable->GetContentTable() != NULL) { pSortTable->AppendColumn("",WLength(40,WLength::Pixel)); pSortTable->SetDataRowStyle("table_data_grid_item_text"); //pSortTable->AppendColumn("名称",WLength(50,WLength::Percentage)); pSortTable->AppendColumn(strName,WLength(50,WLength::Percentage)); pSortTable->SetDataRowStyle("table_data_grid_item_text"); //pSortTable->AppendColumn("序号",WLength(50,WLength::Percentage)); pSortTable->AppendColumn(strSequenceNo,WLength(50,WLength::Percentage)); pSortTable->SetDataRowStyle("table_data_grid_item_text"); } if (pSortTable->GetActionTable() != NULL) { WTable *pTbl1; pSortTable->GetActionTable()->elementAt(0,1)->setContentAlignment(AlignCenter); pSortTable->GetActionTable()->elementAt(0,1)->setStyleClass("textbold"); pTbl1 = new WTable(pSortTable->GetActionTable()->elementAt(0,1)); pTbl1->setStyleClass("widthauto"); //WSVButton * pSortOkBtn = new WSVButton(pTbl1->elementAt(0, 1), "确 定", "button_bg_m.png", "", false); WSVButton * pSortOkBtn = new WSVButton(pTbl1->elementAt(0, 1), strAffirm, "button_bg_m.png", "", false); if(pSortOkBtn) { connect(pSortOkBtn,SIGNAL(clicked()),this,SLOT(SortOk())); } } //编辑事件 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++; } //绑定编辑事件 connect(&m_userMapper, SIGNAL(mapped(const std::string)), this, SLOT(EditUserName(const std::string))); //显示列表 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(); //隐藏按钮 pHideBtn = new WPushButton("hide button",this); if(pHideBtn) { pHideBtn->setToolTip("Hide Button"); connect(pHideBtn,SIGNAL(clicked()),this,SLOT(DelUser())); pHideBtn->hide(); } pTranslateBtn = new WPushButton("Translate",this); pExChangeBtn = new WPushButton("Refresh",this); //翻译 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(); } }
//界面排序完毕 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 CSVReportSet::SavePhone(SAVE_REPORT_LIST * report) { //nullTable -> clear(); if(strcmp(chgstr.c_str(), "") != 0) { Edit_Phone(report); return; } //judge report name/(ini section) is right std::list<string> sectionlist; std::list<string>::iterator Item; GetIniFileSections(sectionlist, "reportset.ini"); bool bRe = false; for(Item = sectionlist.begin(); Item != sectionlist.end(); Item++) { std::string str = *Item; if(strcmp(str.c_str(), report->szTitle.c_str()) == 0) { bRe = true; break; } } if(bRe)//有重复 { std::list<string> errorMsgList; errorMsgList.push_back(m_formText.szConnErr); m_pReportListTable->ShowErrorMsg(errorMsgList); //show error msg //m_pConnErr ->setText(m_formText.szConnErr); //m_pConnErr ->show(); } else { //int numRow = m_ptbPhone->numRows(); int numRow = m_pReportListTable->GeDataTable()->numRows(); m_pReportListTable->InitRow(numRow); WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 0)); m_pReportListTable->GeDataTable()->elementAt(numRow, 0)->setContentAlignment(AlignCenter); std::string strlinkname; std::string hrefstr = RepHrefStr(report->szTitle); strlinkname ="<a href=/fcgi-bin/statsreportlist.exe?id="+hrefstr+">"+report->szTitle+"</a>"; WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2)); m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter); WText *pPeriod = new WText(report->szPeriod, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 4)); m_pReportListTable->GeDataTable()->elementAt(numRow, 4)->setContentAlignment(AlignCenter); WImage *pEdit = new WImage("/Images/edit.gif", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 6)); m_pReportListTable->GeDataTable()->elementAt(numRow, 6)->setContentAlignment(AlignCenter); pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer); //m_ptbPhone->adjustRowStyle("tr1","tr2"); m_signalMapper.setMapping(pEdit, report->szTitle); bool isWriteIni = false; isWriteIni = WriteIniFileString(report->szTitle, "Title", report->szTitle, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Descript", report->szDescript, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Plan", report->szPlan, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Period", report->szPeriod, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "StatusResult", report->szStatusresult, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ErrorResult", report->szErrorresult, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Graphic", report->szGraphic, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ComboGraphic", report->szComboGraphic, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListData", report->szListData, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListNormal", report->szListNormal, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListError", report->szListError, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListDanger", report->szListDanger, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListAlert", report->szListAlert, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "EmailSend", report->szEmailSend, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Parameter", report->szParameter, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Deny", report->szDeny, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Generate", report->szGenerate, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ClicketValue", report->szClicketValue, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListClicket", report->szListClicket, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "GroupRight", report->szGroupRight, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "StartTime", report->szStartTime, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "EndTime", report->szEndTime, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileInt(report->szTitle, "WeekEndTime", report->nWeekEndIndex, "reportset.ini"); if(!isWriteIni) { } //Ticket #123 start -------苏合 isWriteIni = WriteIniFileString(report->szTitle, "GenExcel", report->szExcel, "reportset.ini"); if(!isWriteIni) { } //Ticket #123 end -------苏合 m_pReportListTable->HideNullTip(); //REPORT_LIST list; REPORT_LIST list; list.pSelect = pCheck; list.pName = pName; list.pPeriod = pPeriod; list.pEdit = pEdit; m_pListReport.push_back(list); chgstr = ""; connect(pEdit, SIGNAL(clicked()), "showbar();",&m_signalMapper, SLOT(map()),WObject::ConnectionType::JAVASCRIPTDYNAMIC ); } }
void CSVReportSet::Edit_Phone(SAVE_REPORT_LIST * report) { bool isWriteIni = false; isWriteIni = EditIniFileSection(chgstr, report->szTitle, "reportset.ini"); if(!isWriteIni) { } 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; int pos = tempsection.find("$", 0); if(pos < 0) { continue; } std::string substr = tempsection.substr(0, pos); std::string rightstr = tempsection.substr(pos, tempsection.size() - pos); if(strcmp(substr.c_str(), chgstr.c_str()) == 0) { //bool EditIniFileSection(string oldsection,string newsection,string filename,string addr="localhost"); std::string nsec = report->szTitle; nsec += rightstr; EditIniFileSection(tempsection, nsec, "reportgenerate.ini"); } } isWriteIni = WriteIniFileString(report->szTitle, "Title", report->szTitle, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Descript", report->szDescript, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Plan", report->szPlan, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Period", report->szPeriod, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "StatusResult", report->szStatusresult, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ErrorResult", report->szErrorresult, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Graphic", report->szGraphic, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ComboGraphic", report->szComboGraphic, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListData", report->szListData, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListNormal", report->szListNormal, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListError", report->szListError, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListDanger", report->szListDanger, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListAlert", report->szListAlert, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "EmailSend", report->szEmailSend, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Parameter", report->szParameter, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Deny", report->szDeny, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "Generate", report->szGenerate, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ClicketValue", report->szClicketValue, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "ListClicket", report->szListClicket, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "GroupRight", report->szGroupRight, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "StartTime", report->szStartTime, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileString(report->szTitle, "EndTime", report->szEndTime, "reportset.ini"); if(!isWriteIni) { } isWriteIni = WriteIniFileInt(report->szTitle, "WeekEndTime", report->nWeekEndIndex, "reportset.ini"); if(!isWriteIni) { } //Ticket #123 start -------苏合 isWriteIni = WriteIniFileString(report->szTitle, "GenExcel", report->szExcel, "reportset.ini"); if(!isWriteIni) { } //Ticket #123 end -------苏合 for(m_pListItem = m_pListReport.begin(); m_pListItem != m_pListReport.end(); m_pListItem++) { if(strcmp(chgstr.c_str(), m_pListItem->pName->text().c_str()) == 0) { m_pListItem->pName->setText(report->szTitle); m_pListItem->pPeriod->setText(report->szPeriod); m_signalMapper.setMapping(m_pListItem->pEdit, report->szTitle); break; } } UpdatePhoneList(); chgstr = ""; }