DateTime End = Convert.ToDateTime(String.Format("{0}-{1}-{2} 23:59:59", KeyTime.Year, KeyTime.Month, KeyTime.Day));
var WorkList = _DbEntities.WorkOrder.Where(p => p.W_UserName == UserName && p.W_Time >= Begin && p.W_Time <= End).ToList();
if (WorkList.Count != 0)
{
foreach (var temp in WorkList)
{
DataRow NewRow = _Result.NewRow();
NewRow[0] = String.Format("{0:yyyy-MM-dd}", KeyTime);
NewRow[1] = temp.W_Type;
_Result.Rows.Add(NewRow);
}
}
else
{
var LeaveList = _DbEntities.Leave.Where(p => p.L_UserName == UserName && p.L_Time >= Begin && p.L_Time <= End).ToList();
if (LeaveList.Count != 0)
{
DataRow NewRow = _Result.NewRow();
NewRow[0] = String.Format("{0:yyyy-MM-dd}", KeyTime);
NewRow[1] = "请假";
_Result.Rows.Add(NewRow);
}
else
{
DataRow NewRow = _Result.NewRow();
NewRow[0] = String.Format("{0:yyyy-MM-dd}", KeyTime); C#公司考勤管理系统的设计实现+流程图+ER图(13):http://www.youerw.com/jisuanji/lunwen_195.html