我有这样的记录:
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查询显示当前日期的所有投诉顺序,如Pending, Solved, Cancel:
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查询??
您可以在列表中搜索对象,并按待定、已解决和取消添加;;
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");