Esempio n. 1
0
 public DayActivity(DateTime day, User user, RedmineUserProject project, WorkPeriod period,
                    WorkableDayType workableDayType) : this()
 {
     _user           = user;
     _project        = project;
     _period         = period;
     Day             = day;
     WorkableDayType = workableDayType;
 }
        public IEnumerable <TimeEntry> GetTimeEntries(WorkPeriod period)
        {
            var parameters = new NameValueCollection
            {
                { RedmineKeys.SPENT_ON, $"><{period.StartDate.AsRedmineDate()}|{period.EndDate.AsRedmineDate()}" },
                { RedmineKeys.USER_ID, $"{_user.Id}" },
                { RedmineKeys.INCLUDE, "issues" },
                { RedmineKeys.LIMIT, "9999" }
            };

            var timeEntries = _manager.GetObjects <TimeEntry>(parameters);

            foreach (var timeEntry in timeEntries)
            {
                timeEntry.Issue.Name =
                    Issues.FirstOrDefault(issue => issue.IssueInfo.Id == timeEntry.Issue.Id)?.IssueInfo?.Subject;
            }
            return(timeEntries);
        }