c#考勤统计

时间:2024-01-03 15:28:20

现在项目需求,需要从多张表中获取数据,组装到一个实体对象中,并通过计算统计出每个员工的考勤记录。(全凭自己思考做的,不足的地方希望各位大神指正!毕竟自己能力有限,思考不全

考勤统计列表:

c#考勤统计

明细列表:

c#考勤统计

如下代码:

  /// <summary>
/// 获取考勤列表
/// </summary>
/// <param name="dto"></param>
/// <param name="Page"></param>
/// <param name="PageSize"></param>
/// <returns></returns>
public ResultEntity<List<AttendCountDTO>> QueryAttendList(SearchAttendCountDTO dto, int Page, int PageSize)
{
#region 获取当前年月日
var FirstDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + " -01"); //当前月第一天
var NowDate = DateTime.Now;
#endregion var lists = new List<AttendCountDTO>();
DepartRepository departRepository = new DepartRepository();
AttendCountRepository attendCountRepository = new AttendCountRepository();
HolidayRepository holidayRepository = new HolidayRepository();
DPEAssRepository dpeAssRepository = new DPEAssRepository();
PostRepository postRepository = new PostRepository();
AttendEditorRepository attendEditorRepository = new AttendEditorRepository();
AttendancesRepository attendRepository = new AttendancesRepository();
GetWorkDays workDays = new GetWorkDays();
var allEmployees = attendCountRepository.QueryAllEmployee(dto); //所有员工
var allEmployeeIds = allEmployees.Select(f => f.Id).ToList(); //所有员工Id
var allAttendEntities = attendRepository.GetAllAttendancesById(allEmployeeIds); //所有员工的所有考勤
var allOffWorkEntities = attendRepository.GetAllOffWork(allEmployeeIds); //所有员工的所有考勤
var allDPEEntities = dpeAssRepository.GetAllDPEAssById(allEmployeeIds); //获得所有员工关联表
var allDPEIds = allDPEEntities.Select(f => f.PostId).ToList(); //获得所有员工关联表的岗位Id
var allPostEntities = postRepository.GetAllPostById(allDPEIds); //获得所有员工的岗位信息
var allDepartIds = allPostEntities.Select(f => f.DepartmentId).ToList(); //获得所有员工岗位的部门Id
var allDepartEntities = departRepository.QueryAllDepart(allDepartIds); //获得所有员工的部门信息
var allAttendConfigEntities = attendEditorRepository.GetAllAttendancesConfigById(allDepartIds); //获得所有员工的考勤配置信息 if (allEmployees.Count() > )
{
foreach (var Employee in allEmployees)
{
AttendCountDTO attendCountDTO = new AttendCountDTO(); #region 获得部门名称,和该部门的上班下班时间
string[] WorkDayNums = null;
int NoWorkDayNum = ;
var workStartTime = new DateTime(, , , , , );
var workEndTime = new DateTime(, , , , , );
var dpeass = allDPEEntities.Where(f => f.EmployeeId == Employee.Id).FirstOrDefault();
if (dpeass != null)
{
var post = allPostEntities.Where(f => f.Id == dpeass.PostId).FirstOrDefault();
if (post != null)
{
if (string.IsNullOrEmpty(dto.Position) || post.Name == dto.Position)
{
attendCountDTO.Position = post.Name;
var department = allDepartEntities.Where(f => f.Id == post.DepartmentId).FirstOrDefault(); //获取员工所属的部门
if (department != null)
{
if (string.IsNullOrEmpty(dto.DepartmentName) || department.Name.Contains(dto.DepartmentName))
{
attendCountDTO.DepartmentName = department.Name;
attendCountDTO.DepartmentId = department.Id;
var attendConfig = allAttendConfigEntities.Where(f => f.DepartmentId == department.Id).FirstOrDefault();
if (attendConfig != null)
{
workStartTime = DateTime.Parse(attendConfig.StartTime); //该部门的上班时间和下班时间
workEndTime = DateTime.Parse(attendConfig.EndTime); #region 工作日
string workDay = attendConfig.WorkDays;
string WorkDay = workDay.Substring(, workDay.Length - );
WorkDayNums = WorkDay.Split(',');
NoWorkDayNum = - WorkDayNums.Count(); //该员工所在部门的一周非工作天数
#endregion
}
}
else
{
continue;
}
}
}
else
{
continue;
}
}
}
#endregion #region 根据当天时刻修正次数
int Modify = ;
var time = DateTime.Parse(NowDate.ToString("HH:mm:ss"));
var startTime = DateTime.Parse(workStartTime.ToString("HH:mm:ss"));
var endTime = DateTime.Parse(workEndTime.ToString("HH:mm:ss"));
if (time <= startTime) //当前时间在第二天中午之前,为为一天,中午12点后计算结果为2天,则需要对考勤次数进行修正。
{
Modify = ;
}
else if (time >= startTime && time <= DateTime.Parse("12:00:00"))
{
Modify = -;
}
else if (time >= DateTime.Parse("12:00:00") && time < endTime)
{
Modify = ;
}
else if (time >= endTime)
{
Modify = ;
}
#endregion DateTime firstDate = FirstDate;
var applyTime = Employee.EntryDate; //员工入职时间
if (applyTime.HasValue && applyTime >= FirstDate) //如果员工是这个月内刚入职的,取入职时间
{
firstDate = DateTime.Parse(applyTime.Value.ToString("yyyy-MM-dd"));
}
var attendEntities = allAttendEntities.Where(f => f.CreaterId == Employee.Id && (f.CreateDate >= firstDate && f.CreateDate <= NowDate)).OrderBy(f =>f.CreateDate).ToList();
var attendCounts = attendEntities.Count(); //当前月实际打卡的次数 #region //实际打卡的天数
List<string> list = new List<string>();
foreach (var attend in attendEntities)
{
var attendDay = attend.CreateDate.ToLongDateString();
list.Add(attendDay);
}
attendCountDTO.ActualDays = list.Distinct().Count(); //实际打卡的天数
#endregion #region 应打卡的天数
int days = ;
int AllDay = ;
var nowTime = DateTime.Now; if (applyTime != null)
{
attendCountDTO.OutHiredate = applyTime == null ? "" : DateTime.Parse(applyTime.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
attendCountDTO.Hiredate = applyTime;
if (NoWorkDayNum == )
{
AllDay = workDays.GetNoHolidayWorkDay(firstDate,NowDate);
}
else
{
AllDay = workDays.GetDate(firstDate, NowDate, WorkDayNums); //获取到(设置的指定的工作日)所有天数
//AllDay = workDays.GetWorkDay(firstDate, NowDate, NoWorkDayNum); //获取工作天数(已去除设置的非工作日)
} var holidayDays = holidayRepository.GetHolidayByTime(firstDate, nowTime); //当月所有的节假日
if (holidayDays.Count() > )
{
holidayDays.ForEach(f =>
{
TimeSpan ts = f.EndTime - f.BeginTime;
days += ts.Days;
});
}
#region 请假的天数
int offWorkDay = ;
DateTime? validEndTime = null;
var OffWorkEntitys = allOffWorkEntities.Where(f => f.CreaterId == Employee.Id
&& f.StartTime >= firstDate && f.StartTime <= nowTime).ToList();
if (OffWorkEntitys.Count() > )
{
foreach (var item in OffWorkEntitys)
{
if (item.EndTime > nowTime) //如果请假的结束时间大于当前考勤的统计时间,取当前时间,
{
validEndTime = nowTime;
}
else
{
validEndTime = item.EndTime; //如果请假的结束时间小于等于当前考勤的统计时间,取请假的结束时间,
}
TimeSpan? t1 = validEndTime - item.StartTime;
offWorkDay += t1.Value.Days;
}
}
#endregion attendCountDTO.ShouldDays = AllDay - days - offWorkDay; //应打卡的天数(工作日天数-法定节假日天数 - 请假天数)
#endregion
attendCountDTO.AbsenteeismDays = attendCountDTO.ShouldDays - attendCountDTO.ActualDays; //应打天数-实打天数
attendCountDTO.ShouldAttendCounts = (attendCountDTO.ShouldDays * ) - Modify; //应打考勤的次数
attendCountDTO.NoAttendCounts = attendCountDTO.ShouldAttendCounts - attendCounts; //未打卡的次数(应打卡的次数-实际打卡的次数)
} #region 判断迟到还是早退,以及次数
//var entitys = GetResignInfo(Employee.Id); //所有考勤次数
int lateCount = ;
int earlyLeaveCount = ;
int AllCounts = attendEntities.Count();
for (int i = ; i < AllCounts; i++)
{
if (i == && i + == AllCounts) //只打卡了一次 (第一种情况) 只判断是否迟到
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
if (i == && i + < AllCounts) //打卡多次,这是第一次 (第二种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
else if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
}
if (i > && i + < AllCounts) //打卡多次,既不是第一次,也不是最后一次 (第三种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours <= workEndTime.TimeOfDay.TotalHours) earlyLeaveCount += ; //打卡了两次,这是下午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours > workStartTime.TimeOfDay.TotalHours) lateCount += ; //打卡了两次,这是上午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i - ].CreateDate.ToLongDateString() && attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ; //只打卡一次,大于上午上班时间,即迟到
}
}
if (i > && i + == AllCounts) //打卡多次,这是是最后一次 (第四种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours <= workEndTime.TimeOfDay.TotalHours) earlyLeaveCount += ; //打卡了两次,这是下午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
}
} attendCountDTO.LateCounts = lateCount;
attendCountDTO.EarlyLeaveCounts = earlyLeaveCount;
attendCountDTO.Id = Employee.Id;
attendCountDTO.Name = Employee.Name;
attendCountDTO.PhoneNumber = Employee.Phone; lists.Add(attendCountDTO);
#endregion
}
}
DateTime? EndTime = null;
if (dto.EndTime.HasValue)
{
EndTime = dto.EndTime.Value.AddDays();
}
var filterEmployees = lists.Where(f => (string.IsNullOrEmpty(dto.DepartmentName) || (!string.IsNullOrEmpty(f.DepartmentName) && f.DepartmentName.Contains(dto.DepartmentName)))
&& (string.IsNullOrEmpty(dto.Position) || f.Position == dto.Position)
&& (!dto.StartTime.HasValue || f.Hiredate >= dto.StartTime)
&& (!EndTime.HasValue || f.Hiredate <= EndTime)).ToList();
var filterEmployee = filterEmployees.OrderBy(f => f.Hiredate).Skip((Page - ) * PageSize).ToList();
var resultEntity = GetResultEntity(filterEmployee);
resultEntity.Count = filterEmployees.Count();
return resultEntity;
} /// <summary>
/// 获取考勤详情
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public ResultEntity<List<AttendCountDetailDTO>> QueryAttendDetailList(AttendDetailDTO param)
{
var lists = new List<AttendCountDetailDTO>();
AttendEditorRepository attendEditorRepository = new AttendEditorRepository();
AttendancesRepository attendRepositry = new AttendancesRepository();
AttendancesConfig attendConfig = new AttendancesConfig();
var attendEditor = attendEditorRepository.GetAttendancesConfigById(param.DepartmentId); //设置的规定考勤
if (attendEditor == null)
{
attendConfig.StartTime = "09:00:00";
attendConfig.EndTime = "18:00:00";
}
else
{
attendConfig.StartTime = attendEditor.StartTime;
attendConfig.EndTime = attendEditor.EndTime;
} var attends = attendRepositry.GetAttendancesById(param.Id); //实际员工打卡信息
var DetailCount = attends.Count(); //考勤次数
for (int i = ; i < attends.Count(); i++)
{
AttendCountDetailDTO dto = new AttendCountDetailDTO();
dto.AttendDate = attends[i].CreateDate.ToString("yyyy-MM-dd HH:mm:ss");
dto.ActualAttendTime = attends[i].CreateDate.ToLongTimeString().ToString();
if (DetailCount ==) //只打卡了一次
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
} if (i == && i + < DetailCount) //打卡多次,这是第一次 (第二种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i + ].CreateDate.ToLongDateString())
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
} else if (attends[i].CreateDate.ToLongDateString() != attends[i + ].CreateDate.ToLongDateString())
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
}
} if (i > && i + < DetailCount) //打卡多次,既不是第一次,也不是最后一次 (第三种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i - ].CreateDate.ToLongDateString()) //打卡了两次,这是下午一次
{
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.EndTime).TimeOfDay.TotalHours)
{
dto.IsRarlyLeave = true;
}
else
{
dto.IsRarlyLeave = false; }
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() == attends[i + ].CreateDate.ToLongDateString()) //打卡了两次,这是上午一次
{
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() != attends[i - ].CreateDate.ToLongDateString() && attends[i].CreateDate.ToLongDateString() != attends[i + ].CreateDate.ToLongDateString()) //一天只打卡了一次,
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
}
} if (i > && i + == DetailCount) //打卡多次,这是是最后一次 (第四种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i - ].CreateDate.ToLongDateString()) //打卡了两次,这是下午一次
{
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.EndTime).TimeOfDay.TotalHours)
{
dto.IsRarlyLeave = true;
}
else
{
dto.IsRarlyLeave = false; }
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() != attends[i - ].CreateDate.ToLongDateString()) //只打卡了一次
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true; }
}
}
dto.Address = attends[i].Addr;
dto.Picture = attends[i].GPS;
dto.AttendRemark = attends[i].Description;
lists.Add(dto);
}
var resultEntity = GetResultEntity(lists);
resultEntity.Count = lists.Count();
return resultEntity;
}

注意:1、工作日不是周一到周五,而是系统配置,即周一到周日中任意某天都可能是工作日。

2、节假日也是由系统配置。

3、统计的是当月月初到查看的此刻的统计数据,(如果员工是新员工,即入职时间在当月月初之后,已新员工入职时间算起)

4、一天控制写入两次打卡记录,上午一次,下午一次(上午以最早打卡时间为准,下午以最晚打卡时间为准)

5、一天如果只打卡了一次,只判断是否迟到。

6、上下班时间由该员工所在部门的系统配置,配置了就按配置时间,否则按写死的默认值。

计算一个月中工作日天数的代码:(分别是计算传统的周一到周五的工作日,和指定时间的工作日天数(本人项目))

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace HYSMA.AppSrv.AttendManage.AttendCase
{
/// <summary>
/// 取工作日
/// </summary>
public class GetWorkDays
{
/// <summary>
/// 根据时间差,获取工作日天数(除去了周六周日)
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public int GetWorkDay(DateTime StartTime, DateTime EndTime)
{
DateTime start = StartTime;
DateTime end = EndTime;
TimeSpan span = end - start;
//int totleDay=span.Days;
//DateTime spanNu = DateTime.Now.Subtract(span);
int AllDays = Convert.ToInt32(span.TotalDays) + ;//差距的所有天数
int totleWeek = AllDays / ;//差别多少周
int yuDay = AllDays % ; //除了整个星期的天数
int lastDay = ;
if (yuDay == ) //正好整个周
{
lastDay = AllDays - (totleWeek * );
}
else
{
int weekDay = ;
int endWeekDay = ; //多余的天数有几天是周六或者周日
switch (start.DayOfWeek)
{
case DayOfWeek.Monday:
weekDay = ;
break;
case DayOfWeek.Tuesday:
weekDay = ;
break;
case DayOfWeek.Wednesday:
weekDay = ;
break;
case DayOfWeek.Thursday:
weekDay = ;
break;
case DayOfWeek.Friday:
weekDay = ;
break;
case DayOfWeek.Saturday:
weekDay = ;
break;
case DayOfWeek.Sunday:
weekDay = ;
break;
}
if ((weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ))
{
endWeekDay = ;
}
if ((weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ))
{
endWeekDay = ;
}
lastDay = AllDays - (totleWeek * ) - endWeekDay;
}
return lastDay;
} /// <summary>
/// 获取工作日天数(无节假日)
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public int GetNoHolidayWorkDay(DateTime StartTime, DateTime EndTime)
{
TimeSpan t = EndTime - StartTime;
var tatalDay = Convert.ToInt32(t.TotalDays); return tatalDay;
} /// <summary>
/// 获取一个时间段中(周一有几天,周二有几天,周三有几天。。。。到周日)(从而获取工作日天数)
/// </summary>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="workDay">从数据库中取得的设置的工作日时间(如:周一,周三,周五,周日)</param>
/// <returns></returns>
public int GetDate(DateTime startDate, DateTime endDate ,string[] workDay) //这里的workDay数组是我从数据库中取得的字符串(原始格式类似:"周一,周三,周六..."),通过split分割而成的。以便进行操作
{
int mondayCount = , tuesdayCount = , wednesdayCount = , thursdayCount = , fridayCount = , satursdayCount = , sundayCount = ;//每个星期日(星期一,星期二...)的总天数 int LastDay = ;
DateTime startDT = startDate; //开始时间
DateTime endDT = endDate; //结束时间
TimeSpan dt = endDT - startDT;
int dayCount = Convert.ToInt32(dt.TotalDays); //总天数 (后一个日期在中午12点之前,这天不算,超过12点,加上这一天)
for (int i = ; i < dayCount; i++)
{
switch (startDT.AddDays(i).DayOfWeek)
{
case DayOfWeek.Monday:
mondayCount += ;
break;
case DayOfWeek.Tuesday:
tuesdayCount += ;
break;
case DayOfWeek.Wednesday:
wednesdayCount += ;
break;
case DayOfWeek.Thursday:
thursdayCount += ;
break;
case DayOfWeek.Friday:
fridayCount += ;
break;
case DayOfWeek.Saturday:
satursdayCount += ;
break;
case DayOfWeek.Sunday:
sundayCount += ;
break;
}
} foreach (var item in workDay)
{
switch (item)
{
case "周一":
LastDay += mondayCount;
break;
case "周二":
LastDay += tuesdayCount;
break;
case "周三":
LastDay += wednesdayCount;
break;
case "周四":
LastDay += thursdayCount;
break;
case "周五":
LastDay += fridayCount;
break;
case "周六":
LastDay += satursdayCount;
break;
case "周日":
LastDay += sundayCount;
break;
}
}
//int lastDays = mondayCount + tuesdayCount + wednesdayCount + thursdayCount + fridayCount + satursdayCount + sundayCount;
return LastDay;
}
}
}