-2
var req = (from k in dc.operations.ToList()
group k by k.id_employee into g
select new { id_emp = g.Key , nbr = g.Count(), }
).Take(1).SingleOrDefault();
double mint=0;
for (int i = 0; i < req.nbr; i++)
{
var r = (from l in dc.operations
where l.id_employee == req.id_emp
select l).Take(1).ToList();
var r2 = (from l in dc.operations
where l.id_employee == req.id_emp
&& l.date_operation.Value > r[i].date_operation.Value
select l).Take(1).ToList();
double nbr_minut = (r[i].date_operation.Value - r2[i].date_operation.Value).TotalMinutes;
mint = +nbr_minut;
nbr_minut = 0;
}
TimeSpan span = TimeSpan.FromMinutes(mint);
string nbr_houre = span.ToString(@"hh\:mm");
label1.Text = nbr_houre.ToString();
什么是贴有码的问题,究竟是不是满意? – har07