private void SetupCurrentWorkDay(WorkDay workDay) { CurrentDay = new WorkDay(workDay.WorkTime.DateOfWork); var tmp = dataManager.CurrentUser.AssignedWorkDays.FirstOrDefault(d => d.WorkTime.DateOfWork.Date.Equals(workDay.WorkTime.DateOfWork.Date)); if (tmp != null) { CurrentDay.Update(tmp); WorkItems = CurrentDay.AssignedWorkItems; return; } CurrentDay.WorkTime.Begin = dataManager.CurrentUser.UserSettings.DefaultBeginOfWork; CurrentDay.WorkTime.End = dataManager.CurrentUser.UserSettings.DefaultEndOfWork; CurrentDay.BreakTime = dataManager.CurrentUser.UserSettings.DefaultBreakTime; WorkItems = CurrentDay.AssignedWorkItems; hasChanged = true; }