Beispiel #1
0
        public List <TaskItemViewmodel> ExtractEmptyItemTaskitems(List <TimeEntry> localtimeEntriesForThisWeek, DateTime startDate)
        {
            var rows = new List <TaskItemViewmodel>();

            foreach (var task in localtimeEntriesForThisWeek.Select(x => x.Task).Distinct())
            {
                var timeEntryType = _timeEntryTypeRepository.GetByCompany(task.Project.Company)
                                    .FirstOrDefault(tt => tt.IsDefault);
                var isBillable = false;
                if (timeEntryType != null)
                {
                    isBillable = timeEntryType.IsBillableByDefault;
                }
                rows.Add(new TaskItemViewmodel(task, new List <TimeEntry>(), startDate, isBillable));
            }
            return(rows);
        }
Beispiel #2
0
        private void LoadTimeEntryTypes()
        {
            List <TimeEntryType> timeEntryTypes;

            if (_timeEntry.Task == null)
            {
                TimeEntryTypes = null;
                timeEntryTypes = _timeEntryTypeRepository.GetGlobal();
            }
            else
            {
                var selectedCompany = _timeEntry.Task.Project.Company;
                timeEntryTypes = _timeEntryTypeRepository.GetByCompany(selectedCompany);
            }
            TimeEntryTypes = new ObservableCollection <TimeEntryType>(timeEntryTypes);
            SetSelectedTimeEntryType();
        }