码迷,mamicode.com
首页 > 其他好文 > 详细

表格下面动态添加合计

时间:2014-06-20 13:59:09      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:code   com   get   数据   string   os   

        var jqData = (from s in queryResult
                              select new
                              {
                                  id = s.ContractGuid,//定义当前行数据的一个传输识别名称,一般以主键为名称,可以省略()
                                  cell = new object[]
                                                 {
                                                     s.ContractGuid,
                                                     Convert.ToDateTime(s.CreateDate).ToString("yyyy-MM-dd"),
                                                    workFlowBLL.GetWorkFlowRuleCategoryByGuid((Guid)s.WorkFlowCategoryGuid),        //业务类型  
                                                 
                                                     s.CompanyName,  //公司名称
                                                     s.ContractCode,//合同编号
                                                     workFlowBLL.getPayMoney(s.ContractGuid, 1),
                                                      workFlowBLL.getPayMoney(s.ContractGuid, 2,true),
                                                      um.GetUserName (  s.SaleManagerGuid)

                                                  }
                              }).ToList();
                var sumObj = new
                {
                    id = new Guid(),
                    cell = new object[]{
                        "",
                        "合计",
                        "",
                        "",
                        "",
                        queryResultSum.Sum(p=> workFlowBLL.getPayMoney(p.ContractGuid, 1)),
                           queryResultSum.Sum(p=> workFlowBLL.getPayMoney(p.ContractGuid, 2,true)),
                           ""

              }
                };
                jqData.Add(sumObj);

                //以json格式传输,依次以”total/page/records/rows"封装,名称固定
                var jsonData = new
                {
                    total = PageCount,
                    page,
                    records = RecordCount,
                    rows = jqData
                };

表格下面动态添加合计,布布扣,bubuko.com

表格下面动态添加合计

标签:code   com   get   数据   string   os   

原文地址:http://www.cnblogs.com/520cc/p/3794997.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!