关于EasyUI里面DataGrid的问题就是总价汇总的问题后台怎么处理 40
publicstringSellProducts(intpage,introws){stringmoney="100.1";stringpagerJson="{{\"to...
public string SellProducts(int page, int rows)
{
string money = "100.1";
string pagerJson = "{{\"total\":\"{0}\",\"rows\":{1},\"footer\":{2}}}";
string sqlText = "select top " + rows + " Sid,Sname,Sprice,Stype,Scount,Stime,Sprice*Scount AS 'SZprice' from SellApplance where Sid not in(select top " +
(page - 1) * rows + " Sid from SellApplance)";
string sqlCount = "select count(*) from SellApplance";
using (SqlHelper helper = new SqlHelper())
{
return string.Format(pagerJson, helper.GetDataFromSqlText(sqlCount).Rows[0][0],
JsonConvert.SerializeObject(helper.GetDataFromSqlText(sqlText)), "[{\"SZprice\":\"" + money + "\",\"Scount\":\"总价汇总\"}]");
}
}
这是我写的代码,然后money是在服务端显示的总价汇总数据,怎么让我数据库的select sum(Aprice*Acount)as Money from InsertApplance执行的结果来替换掉money
谢谢了急用
我是用asp.net里面的MVC 写的 展开
{
string money = "100.1";
string pagerJson = "{{\"total\":\"{0}\",\"rows\":{1},\"footer\":{2}}}";
string sqlText = "select top " + rows + " Sid,Sname,Sprice,Stype,Scount,Stime,Sprice*Scount AS 'SZprice' from SellApplance where Sid not in(select top " +
(page - 1) * rows + " Sid from SellApplance)";
string sqlCount = "select count(*) from SellApplance";
using (SqlHelper helper = new SqlHelper())
{
return string.Format(pagerJson, helper.GetDataFromSqlText(sqlCount).Rows[0][0],
JsonConvert.SerializeObject(helper.GetDataFromSqlText(sqlText)), "[{\"SZprice\":\"" + money + "\",\"Scount\":\"总价汇总\"}]");
}
}
这是我写的代码,然后money是在服务端显示的总价汇总数据,怎么让我数据库的select sum(Aprice*Acount)as Money from InsertApplance执行的结果来替换掉money
谢谢了急用
我是用asp.net里面的MVC 写的 展开
提示该问答中所提及的号码未经验证,请注意甄别。
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏40(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询