예제 #1
0
    public DataTable GetDT()
    {
        string filter = "1=1";

        SqlParameter[] sp = new SqlParameter[] { new SqlParameter("key", "%" + KeyWord + "%") };
        filter += " AND Title Like @key";
        filter  = filter + " And (Tablename like 'ZL_P_%' OR Tablename like 'ZL_U_%' OR Tablename like 'ZL_C_%' ) And status=99";
        if (NodeID > 0)
        {
            filter = filter + " And NodeID=" + NodeID;
        }
        //-----整合数据
        DataTable dt = bll.ContentSearch(filter, sp);//主站数据

        dt.Columns.Add(new DataColumn("PageUrl", typeof(string)));
        string sortstr = "";

        switch (Order)
        {
        case 0:
            sortstr = "CreateTime DESC";
            break;

        case 1:
            sortstr = "Hits DESC";
            break;
        }
        dt.DefaultView.Sort = sortstr;
        dt = dt.DefaultView.ToTable();
        return(dt);
    }