我有这样的记录:
empid title complaint_description complain_date status
1 jjn kkjjj 3/march/14 Solved
2 jjkjn jnkjnj 18/mar/14 pending
3 kjjk jkhjk 21/mar/14 Cancel
4 jkjh jhkj 22/mar/14 Solved
5 jkjj jkhjk 22/mar/14 pending
6 nkjn nkjnk 22/marc/14 pending
7 nkjn jnk 22/marc/14 cancel
我希望Linq查询显示当前日期的所有投诉,例如待处理,已解决,取消:
jkjh jhkj 22/mar/14 pending
jkjj jkhjk 22/mar/14 pending
nkjn nkjnk 22/marc/14 Solved
nkjn jnk 22/marc/14 cancel.
任何人都可以为我上面的问题提供Linq查询吗???
答案 0 :(得分:0)
您可以从列表中搜索对象并按站添加待处理,已解决并取消;;
var query = lstEmployee.FindAll(a=>a.complain_date=DateTime.Today & a.status="pending");
query.AddRange= lstEmployee.FindAll(a=>a.complain_date=DateTime.Today & a.status="Solved");
query.AddRange= lstEmployee.FindAll(a=>a.complain_date=DateTime.Today & a.status="cancel");