using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using SysCore;
using SysCore.Control;

public partial class System_XReport_ViewReport_FastSearch : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FastSearh fs = new FastSearh();
        string xf_code = Request["xf_code"];
        string sql = "select xf_sql from System_XReportFilter where xf_code='" + xf_code + "'";
        SqlUtil su = new SqlUtil();
        string xf_sql = su.ExecuteScalar(sql, null).ToString();
        xf_sql = "select * from (" + xf_sql + ") t where 1=1 ";
        string keyword = Request.QueryString["searchTerm"];
        if (!keyword.Trim().Equals(""))
        {
            xf_sql += " and xf_name like '%" + keyword + "%'";
        }
        DataTable dt = su.GetDataTable(xf_sql, null);
        String s = fs.CreateSearchJSON(dt);
        Response.Write(s);
    }
}