Esempio n. 1
0
        private UnitHour GetActualUnit(TimeArea t, IEnumerable <HourLog> logs)
        {
            var res = new UnitHour
            {
                Title = t.Title,
                Hours = 0.0
            };

            foreach (HourLog l in logs)
            {
                if (t.BeginDate <= l.LogDate && t.EndDate >= l.LogDate)
                {
                    res.Hours += l.LogHours;
                }
            }
            return(res);
        }
Esempio n. 2
0
        private UnitHour GetBudgetUnit(TimeArea t, IEnumerable <MonthBudget> budgets)
        {
            var res = new UnitHour
            {
                Title = t.Title,
                Hours = 0.0
            };

            foreach (MonthBudget b in budgets)
            {
                if (t.BeginDate <= b.Month && t.EndDate >= b.Month)
                {
                    res.Hours += b.Hours;
                }
            }
            return(res);
        }