public IEnumerable <WorkHourJson> GetSentWorkHours() { var userName = User.Identity.Name; UnitOfWork uow = new UnitOfWork(); TimeSheetManager timeSheetManager = new TimeSheetManager(uow); return(new WorkHourAssembler().ToJsons(timeSheetManager.GetSentWorkHours(userName).OrderBy(c => c.Date))); }
public IEnumerable <WorkHourJson> GetCurrentPeriodSentWorkHours(List <TimeSheetValueJson> workHourJsons) { UnitOfWork uow = new UnitOfWork(); UserManager userManager = new UserManager(uow); TimeSheetManager timeSheetManager = new TimeSheetManager(uow); User currUser = new UserHelper().GetCurrent(); DateTime fromDate = workHourJsons[0].Date; DateTime toDate = workHourJsons[workHourJsons.Count() - 1].Date; return(new WorkHourAssembler().ToJsons(timeSheetManager.GetSentWorkHours(currUser.UserName).Where(x => x.Date >= fromDate && x.Date <= toDate).OrderBy(c => c.Date))); }