using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EKETEAM.Data;
using EKETEAM.FrameWork;
using EKETEAM.UserControl;

public partial class Manage_layoutDataSelect : System.Web.UI.Page
{
    public string type = eParameters.QueryString("type");
    public string UserArea = "Manage";
    eUser user;
    protected void Page_Load(object sender, EventArgs e)
    {
        user = new eUser(eBase.getUserArea(UserArea));
        user.Check();

        if (type.Length == 0) type = "0";
        string sql = "";
        string s1 = eParameters.QueryString("s1");
        string s2 = eParameters.QueryString("s2");
        switch (type)
        {
            case "0"://模块
                sql = "select modelid,mc,sm from a_eke_sysModels where type=10 and deltag=0";
                if (s1.Length > 0) sql += " and mc like '%" + s1 + "%'";
                if (s2.Length > 0) sql += " and modelid like '%" + s2 + "%'";

                sql += " order by addtime desc";
                eBase.DataBase.getDataTable(sql, RepModels, ePageControl1);
                break;
            case "1"://图表
                sql = "select ReportID,mc,ControlType,sm from a_eke_sysReports where ModelID is null and deltag=0";
                if (s1.Length > 0) sql += " and mc like '%" + s1 + "%'";
                if (s2.Length > 0) sql += " and ReportID like '%" + s2 + "%'";
                sql += " order by addtime desc";
                eBase.DataBase.getDataTable(sql, RepReports, ePageControl1);
                break;
            case "2"://静态数据
                sql = "select DataContentID,mc,bz from a_eke_sysDataContents where deltag=0";
                if (s1.Length > 0) sql += " and mc like '%" + s1 + "%'";
                if (s2.Length > 0) sql += " and DataContentID like '%" + s2 + "%'";
                sql += " order by addtime desc";
                eBase.DataBase.getDataTable(sql, RepDataContents, ePageControl1);
                break;
            case "3"://动态数据
                sql = "select DataViewID,mc,sm from a_eke_sysDataViews where deltag=0";
                if (s1.Length > 0) sql += " and mc like '%" + s1 + "%'";
                if (s2.Length > 0) sql += " and DataViewID like '%" + s2 + "%'";
                sql += " order by addtime desc";
                eBase.DataBase.getDataTable(sql, RepViews, ePageControl1);
                break;
        }
    }
}