Linq Asenumerable();


//总过夜天数
decimal counts = table.AsEnumerable().Where(n => n.Field<string>("analy_type") == "合计").Sum(n => n.Field<decimal>("counts"));

//培训率
decimal px_rate = table.AsEnumerable().Where(n => n.Field<string>("analy_type") == "合计").Sum(n => n.Field<decimal>("px_rate") * n.Field<decimal>("capNum_type"));
px_rate = Math.Round(capNum_type == 0 ? 0 : px_rate / capNum_type, 4);

posted on 2016-07-11 17:09  ningmou  阅读(372)  评论(0)    收藏  举报