private string GetPoint()
    {
        string    type       = Request["type"];       //监测类别
        string    year       = Request["year"];       //年度
        string    searchType = Request["searchType"]; //查询类型
        string    half       = Request["half"];       //半年
        string    quarter    = Request["quarter"];    //季度
        string    month      = Request["month"];      //月度
        string    Select     = string.Empty;
        string    TableName  = string.Empty;
        string    Where      = string.Empty;
        string    MonthWhere = string.Empty;
        DataTable dt         = new DataTable();
        string    strDes     = string.Empty;

        string months = getMonths(searchType, half, quarter, month, ref strDes);

        switch (type)
        {
        case "EnvRiver":     //河流
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_RIVER a inner join T_ENV_P_RIVER_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDrinking":     //地下饮用水
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_DRINK_UNDER";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvReservoir":     //湖库
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_LAKE a inner join T_ENV_P_LAKE_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        default:
            dt.Columns.Add("CODE", typeof(String));
            dt.Columns.Add("NAME", typeof(String));
            break;
        }

        //加入全部
        DataRow dr = dt.NewRow();

        dr["NAME"] = "--全部--";
        dt.Rows.InsertAt(dr, 0);
        string json = DataTableToJson(dt);

        return(json);
    }
Beispiel #2
0
    private string GetPoint()
    {
        string StartDate = Request["startdate"];
        string EndDate   = Request["enddate"];

        string    Select    = string.Empty;
        string    TableName = string.Empty;
        string    Where     = "1=1";
        DataTable dt        = new DataTable();

        Select    = "distinct POINT_CODE CODE, POINT_NAME NAME";
        TableName = "T_ENV_P_AIR";

        if (StartDate.Length > 0 && EndDate.Length > 0)
        {
            StartDate = DateTime.Parse(StartDate).ToString("yyyy-MM-01");
            EndDate   = DateTime.Parse(EndDate).ToString("yyyy-MM-01");
            Where    += " and CAST(YEAR+'-'+MONTH+'-01' as DATETIME) between '" + StartDate + "' and '" + EndDate + "' and IS_DEL='0'";
        }
        else if (StartDate.Length > 0 && EndDate.Length == 0)
        {
            StartDate = DateTime.Parse(StartDate).ToString("yyyy-MM-01");
            Where    += " and CAST(YEAR+'-'+MONTH+'-01' as DATETIME) >='" + StartDate + "' and IS_DEL='0'";
        }
        else if (StartDate.Length == 0 && EndDate.Length > 0)
        {
            EndDate = DateTime.Parse(EndDate).ToString("yyyy-MM-01");
            Where  += " and CAST(YEAR+'-'+MONTH+'-01' as DATETIME) <='" + EndDate + "' and IS_DEL='0'";
        }

        dt = new FillQryLogic().GetPointInfo(Select, TableName, Where);

        //加入全部
        DataRow dr = dt.NewRow();

        dr["NAME"] = "--全部--";
        dt.Rows.InsertAt(dr, 0);
        string json = DataTableToJson(dt);

        return(json);
    }
Beispiel #3
0
    private string GetPoint()
    {
        string    type       = Request["type"];       //监测类别
        string    year       = Request["year"];       //年度
        string    searchType = Request["searchType"]; //查询类型
        string    half       = Request["half"];       //半年
        string    quarter    = Request["quarter"];    //季度
        string    month      = Request["month"];      //月度
        string    Select     = string.Empty;
        string    TableName  = string.Empty;
        string    Where      = string.Empty;
        string    MonthWhere = string.Empty;
        DataTable dt         = new DataTable();
        string    strDes     = string.Empty;

        string months = getMonths(searchType, half, quarter, month, ref strDes);

        switch (type)
        {
        case "EnvRiver":     //河流
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_RIVER a inner join T_ENV_P_RIVER_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "AreaNoise":     //区域环境噪声
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_NOISE_AREA";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvRoadNoise":     //道路交通噪声
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_NOISE_ROAD";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "FunctionNoise":     //功能区噪声
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_NOISE_FUNCTION";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvAir":       //环境空气
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_AIR";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDrinking":     //地下饮用水
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_DRINK_UNDER";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDrinkingSource":     //饮用水源地
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_DRINK_SRC a inner join T_ENV_P_DRINK_SRC_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDust":     //降尘
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_DUST";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDWAir":     //双三十废气
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_AIR30";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvDWWater":     //双三十废水
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_RIVER30 a inner join T_ENV_P_RIVER30_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvEstuaries":     //入海河口
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_ESTUARIES a inner join T_ENV_P_ESTUARIES_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvMudRiver":     //沉积物(河流)
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_MUD_RIVER a inner join T_ENV_P_MUD_RIVER_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvMudSea":     //沉积物(海水)
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_MUD_SEA a inner join T_ENV_P_MUD_SEA_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvSoil":     //土壤
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_SOIL";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvPSoild":     //固废
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_SOLID";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvRain":     //降水
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_RAIN";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvReservoir":     //湖库
            Select    = "distinct SECTION_CODE CODE,SECTION_NAME NAME";
            TableName = "T_ENV_P_LAKE a inner join T_ENV_P_LAKE_V b on(a.ID=b.SECTION_ID)";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvSeaBath":     //海水浴场
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_SEABATH";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvSear":     //近岸海域
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_SEA";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvSource":     //近岸直排
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_OFFSHORE";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvSpeed":     //盐酸盐化速率
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_ALKALI";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        case "EnvStbc":     //生态补偿
            Select    = "distinct POINT_CODE CODE,POINT_NAME NAME";
            TableName = "T_ENV_P_PAYFOR";
            Where     = "YEAR='" + year + "' " + (months == "" ? "" : "and MONTH in(" + months + ")") + " and IS_DEL='0'";
            dt        = new FillQryLogic().GetPointInfo(Select, TableName, Where);
            break;

        default:
            dt.Columns.Add("CODE", typeof(String));
            dt.Columns.Add("NAME", typeof(String));
            break;
        }

        //加入全部
        DataRow dr = dt.NewRow();

        dr["NAME"] = "--全部--";
        dt.Rows.InsertAt(dr, 0);
        string json = DataTableToJson(dt);

        return(json);
    }