int count = ;
this.page = DTRequest.GetQueryInt("page", );
//查询字符串拼接
string searchparams = DTRequest.GetQueryString("jsonstring");
fooddetail model = jss.Deserialize<fooddetail>(searchparams);
StringBuilder searchsql = new StringBuilder();
//判断名字是否为空
if (!string.IsNullOrEmpty(model.dishesName))
{
searchsql.Append(" and dishesName like '%" + model.dishesName + "%'");
}
BLL.restaurant bll = new BLL.restaurant();
try
{
var dt = bll.GetList(, , "dishesId>0" + searchsql.ToString(), "sort_id asc,add_time desc,dishesId desc", out count).Tables[];
string strjson = Dtb2Json(dt);
context.Response.Write("{\"retcode\": 1,\"retmsg\": \"Success\", \"foodlist\":" + strjson + "}");
}
catch (Exception e)
{
context.Response.Write("{\"retcode\": 2,\"retmsg\": \"" + e.Message + "\"}");
}
finally
{
context.Response.End(); }
05-19 07:45