private void GetData()
    {
        string strWhere = "1=1";
        string year     = Request["year"];

        //拼写条件语句(注:条件中的列名要与点位上的列名一致)
        if (year != "")
        {
            strWhere += " and YEAR='" + year + "'";
        }

        //填报表需要显示信息(注:这Table里面的第一列数据要与填报表的列名一致)
        DataTable dtShow = new DataTable();

        dtShow = new TEnvFillNoiseRoadLogic().CreateShowDT();

        CommonLogic com = new CommonLogic();
        DataTable   dt  = com.GetFillData(strWhere,
                                          dtShow,
                                          TEnvFillNoiseRoadSummaryVo.T_ENV_FILL_NOISE_ROAD_SUMMARY_TABLE,
                                          TEnvPNoiseRoadVo.T_ENV_P_NOISE_ROAD_TABLE,
                                          TEnvPNoiseRoadItemVo.T_ENV_P_NOISE_ROAD_ITEM_TABLE,
                                          TEnvFillNoiseRoadVo.T_ENV_FILL_NOISE_ROAD_TABLE,
                                          TEnvFillNoiseRoadItemVo.T_ENV_FILL_NOISE_ROAD_ITEM_TABLE,
                                          SerialType.T_ENV_FILL_NOISE_ROAD,
                                          SerialType.T_ENV_FILL_NOISE_ROAD_ITEM,
                                          SerialType.T_ENV_FILL_NOISE_ROAD_SUMMARY);

        string json = DataTableToJsonUnsureCol(dt);

        Response.ContentType = "application/json";
        Response.Write(json);
        Response.End();
    }
Beispiel #2
0
    //21,交通噪声汇总表
    //22,区域噪声汇总表
    //23,功能区噪声汇总表
    private void PrintLocal_EnvNoise(string strYear, string strMonth, string strPointID, string strSheetType)
    {
        DataTable dtSrcFill   = new DataTable();
        DataTable dtSrcResult = new DataTable();

        if (strSheetType == "21")
        {
            dtSrcFill   = new TEnvFillNoiseRoadLogic().SelectFill_ForSummary(strYear, strMonth, strPointID);
            dtSrcResult = new TEnvFillNoiseRoadLogic().SelectResult_ForSummary(strYear, strMonth, strPointID);
        }
        else if (strSheetType == "22")
        {
            dtSrcFill   = new TEnvFillNoiseAreaLogic().SelectFill_ForSummary(strYear, strMonth, strPointID);
            dtSrcResult = new TEnvFillNoiseAreaLogic().SelectResult_ForSummary(strYear, strMonth, strPointID);
        }
        else if (strSheetType == "23")
        {
            dtSrcFill   = new TEnvFillNoiseFunctionLogic().SelectFill_ForSummary(strYear, strMonth, strPointID);
            dtSrcResult = new TEnvFillNoiseFunctionLogic().SelectResult_ForSummary(strYear, strMonth, strPointID);
        }

        //标题数组
        ArrayList arrTitle = getPrintLocalTitle_EnvNoise(strYear, strMonth, strSheetType);
        //结尾数组
        ArrayList arrEnd = new ArrayList();

        DataTable dtNew = new DataTable();

        getPrintLocalColumn_EnvNoise(strSheetType, ref dtNew);

        getPrintLocalData_EnvNoise(dtSrcFill, dtSrcResult, strSheetType, ref dtNew);

        //项目列名数组
        ArrayList arrData = getPrintLocalData(dtNew);

        new ExcelHelper().RenderDataTableToExcel(dtNew, "监测数据汇总表.xls", "../../../../TempFile/DataTotal-EnvNoise.xls", "监测数据汇总表", 3, true, arrTitle, arrData, arrEnd);
    }