Exemple #1
0
void CSVReportSet::addPhoneListNew()
{

	std::list<string> sectionlist;
	std::list<string>::iterator m_sItem;
	GetIniFileSections(sectionlist, "reportset.ini");

	int numRow = 1;
	for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++)
	{
		m_pReportListTable->InitRow(numRow);

		std::string section = *m_sItem;

		string ret = "error";

		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(section);
		strlinkname ="<a href=/fcgi-bin/startsreportlist.exe?id="+hrefstr+">"+section+"</a>";
		WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter);

		std::string szPeriod = GetIniFileString(section, "Period", ret, "reportset.ini");
		if(strcmp(szPeriod.c_str(), "error") == 0)
		{
		}

		WText *pPeriod = new WText(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);   
		connect(pEdit, SIGNAL(clicked()), &m_signalMapper, SLOT(map()));
		m_signalMapper.setMapping(pEdit, section);

		REPORT_LIST list;

		list.pSelect = pCheck;
		list.pName = pName;
		list.pPeriod = pPeriod;
		list.pEdit = pEdit;
		m_pListReport.push_back(list);

		numRow++;
	}
}
Exemple #2
0
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 );
	}
	
}
Exemple #3
0
//add  list function
void CSVReportSet::addPhoneList(WTable * table)
{
    m_ptbPhone = new WTable((WContainerWidget*)table->elementAt(7,0));
	nullTable = new WTable((WContainerWidget*)table->elementAt(8, 0));

	m_ptbPhone -> setStyleClass("t3");
	nullTable -> setStyleClass("t3");

    if (m_ptbPhone)
    {
        m_ptbPhone -> setCellPadding(0);   
		m_ptbPhone->setCellSpaceing(0);
		new WText("", (WContainerWidget*)m_ptbPhone->elementAt(0,0));
		new WText(m_formText.szColName, (WContainerWidget*)m_ptbPhone->elementAt(0, 1));
		new WText(m_formText.szColPeriod, (WContainerWidget*)m_ptbPhone->elementAt(0, 2));
		new WText(m_formText.szColEdit, (WContainerWidget*)m_ptbPhone->elementAt(0, 3));
		
		m_ptbPhone->elementAt(0, 0)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 1)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 2)->setStyleClass("t3title");
		m_ptbPhone->elementAt(0, 3)->setStyleClass("t3title");
		
    }

	std::list<string> sectionlist;
	std::list<string>::iterator m_sItem;
	GetIniFileSections(sectionlist, "reportset.ini");

	for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++)
	{
		int numRow = m_ptbPhone->numRows();
		std::string section = *m_sItem;

		string ret = "error";

		WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_ptbPhone->elementAt(numRow, 0));
		// 名称
		std::string strlinkname;
		std::string hrefstr = RepHrefStr(section);
		strlinkname ="<a href=/fcgi-bin/startsreportlist.exe?id="+hrefstr+">"+section+"</a>";
		WText *pName = new WText(strlinkname, (WContainerWidget*)m_ptbPhone->elementAt(numRow , 1));

		std::string szPeriod = GetIniFileString(section, "Period", ret, "reportset.ini");
		if(strcmp(szPeriod.c_str(), "error") == 0)
		{
		}
		
		WText *pPeriod = new WText(szPeriod, (WContainerWidget*)m_ptbPhone->elementAt(numRow, 2));
		
		WImage *pEdit = new WImage("../icons/edit.gif", (WContainerWidget*)m_ptbPhone->elementAt(numRow ,3));
		pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer);   
	    connect(pEdit, SIGNAL(clicked()), &m_signalMapper, SLOT(map()));
		m_signalMapper.setMapping(pEdit, section);

		REPORT_LIST list;

		list.pSelect = pCheck;
		list.pName = pName;
		list.pPeriod = pPeriod;
		list.pEdit = pEdit;
		m_pListReport.push_back(list);
		
	}
	m_ptbPhone->adjustRowStyle("tr1","tr2");
	

	//m_pReportListTable->HideNullTip();
		
}
Exemple #4
0
void CSVReportSet::UpdatePhoneList()
{
	/*
	int nNum =m_ptbPhone->numRows();
	for(int i=1;i<nNum;i++)
	{
		m_ptbPhone->deleteRow(1);

	}
	*/
	PrintDebugString("Into UpdatePhoneList\n");

	m_pReportListTable->GeDataTable()->clear();

	m_pListReport.clear();

	std::list<string> sectionlist;
	std::list<string>::iterator m_sItem;
	GetIniFileSections(sectionlist, "reportset.ini");

	//if(sectionlist.size() == 0)
	//{
	//	WText * nText = new WText("[----------统计报告列表为空-----------]", (WContainerWidget*)m_pReportListTable->GeDataTable() -> elementAt(0, 0));
	//	nText ->decorationStyle().setForegroundColor(Wt::red);
	//	//nullTable -> elementAt(0, 0) -> setContentAlignment(AlignTop | AlignCenter);
	//}

	int numRow = 1;
	for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++)
	{
		std::string section = *m_sItem;

		std::list<string> keylist;
		std::list<string>::iterator m_pItem;
		
		bool bRet = false;
		bRet = GetIniFileKeys(section,keylist, "reportset.ini" );
		if(!bRet)
		{
		}

		m_pItem = keylist.begin();

		std::string str = *m_pItem;
		std::string ret = "error";


		REPORT_LIST list;

		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 ReportName = GetIniFileString(section, "Title", ret, "reportset.ini");
		std::string strlinkname;
		std::string hrefstr =  RepHrefStr(ReportName);
		strlinkname ="<a href=/fcgi-bin/statsreportlist.exe?id="+hrefstr+">"+ReportName+"</a>";

		OutputDebugString("----------------report link name include null----------------\n");
		OutputDebugString(strlinkname.c_str());
		OutputDebugString("\n");

		if(strcmp(ReportName.c_str(), "error") == 0)
		{
		}
		WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2));
		m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter);

		std::string ReportPeriod = GetIniFileString(section, "Period", ret, "reportset.ini");
		if(strcmp(ReportPeriod.c_str(), "error") == 0)
		{
		}
		WText *pPeriod = new WText(ReportPeriod, (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);
		if(!GetUserRight("m_reportlistEdit"))
			pEdit->hide();
		else
			pEdit->show();

		pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer);   
	    connect(pEdit, SIGNAL(clicked()),"showbar();", &m_signalMapper, SLOT(map()),
			WObject::ConnectionType::JAVASCRIPTDYNAMIC);

		m_signalMapper.setMapping(pEdit, section);

		list.pSelect = pCheck;
		list.pName = pName;
		list.pPeriod = pPeriod;
		list.pEdit = pEdit;
		m_pListReport.push_back(list);		

		numRow++;

		PrintDebugString("Into UpdatePhoneList loop\n");
	}	
}