日期:2014-05-20 浏览次数:20726 次
var datas = (from D in dbjy.dt_2_jiens
where (D.单位名称 == "办公室")
group D by D.类别 into dGroup
select new {tts=dGroup.Key,conts=dGroup.Count()}).OrderBy(D=>D.tts ) ;
// 开始
List<SelectListItem> xx = new List<SelectListItem>();
if ((datas != null) && (datas.Count() > 0))
{
foreach (var data in datas)
{
xx.Add(new SelectListItem { Text = tts , Value = conts.ToString() });
}
}
// 结束
ViewData["Chart"] = xx ;
return View();
var datas = (from D in dbjy.dt_2_jiens
where (D.单位名称 == "办公室")
group D by D.类别 into dGroup
select new {tts=dGroup.Key,conts=dGroup.Count()}).OrderBy(D=>D.tts ) ;
ViewData["Chart"] = getdata(datas) ;
return View();