easyui datagrid中一部分显示一个数据库中的数据,一部分显示一个视图中的数据?
var rows_ = String.IsNullOrEmpty(rows) ? 20 : Convert.ToInt32(rows);
var page_ = String.IsNullOrEmpty(page) ? 1 : Convert.ToInt32(page);
if (!String.IsNullOrEmpty(rows))
{
rows_ = Convert.ToInt32(rows);
}
if (!String.IsNullOrEmpty(page))
{
page_ = Convert.ToInt32(page);
}
var strSql = new StringBuilder();
strSql.Append("select @total=count(1) from Archives where 1=1 " + strWhere + ';');
strSql.Append("select * from (");
strSql.Append(" select *, ROW_NUMBER() over(");
if (!string.IsNullOrEmpty(strOrder))
{
strSql.Append(" order by " + strOrder);
}
else
{
strSql.Append(" order by autoid");
}
strSql.Append(" ) row");
strSql.Append(" from Archives");
strSql.Append(" where 1=1 ");
strSql.Append(strWhere);
strSql.AppendFormat(") t where row between {0} and {1}", rows_ * (page_ - 1) + 1, rows_ * (page_));
SqlParameter[] parameters = { DbHelperSQL.CreateOutParam("@total", SqlDbType.Int, 0) };
var ds = DbHelperSQL.Query(strSql.ToString(), parameters);
total = Convert.ToInt32(parameters[0].Value);
return (from DataRow t&nbs