Beispiel #1
0
        private void CreateTimeReport()
        {
            WorkingTimeReport = new List <RIWorkingTime>();

            foreach (var employee in _params.Employees)
            {
                var schedual = new Schedual(new SchedualParams
                {
                    Name  = employee,
                    Start = _params.Start,
                    End   = _params.End
                }, _config);

                var item = new RIWorkingTime();

                item.EmployeeName = employee;

                item.SchedualeHours = schedual.Hours;

                item.DevOpsHours = ActivityReport.Where(x => x.AssigndTo == employee).Sum(x => x.CompletedWork);

                item.Diff = item.DevOpsHours - item.SchedualeHours;

                WorkingTimeReport.Add(item);
            }
        }
Beispiel #2
0
        private void CreateWorkingTimeDiffReport()
        {
            WorkingTimeDiffReport = new List <RIWorkingTimeDiff>();

            foreach (var employee in _params.Employees)
            {
                var schedual = new Schedual(new SchedualParams
                {
                    Name  = employee,
                    Start = _params.Start,
                    End   = _params.End
                }, _config);

                foreach (var day in schedual.Days)
                {
                    var item = new RIWorkingTimeDiff();

                    item.EmployeeName   = employee;
                    item.Day            = day.Date;
                    item.SchedualeHours = day.Hours;
                    item.Description    = day.Description;
                    item.DevOpsHours    = Activities
                                          .Where(x => x.AssigndTo == employee && x.TargetDate?.Date == item.Day).Sum(x => x.CompletedWork);
                    item.Diff = item.DevOpsHours - item.SchedualeHours;

                    var culture = new CultureInfo("ru-RU");
                    item.DayOfWeek = culture.DateTimeFormat.GetDayName(item.Day.DayOfWeek);

                    if (item.Diff != 0)
                    {
                        WorkingTimeDiffReport.Add(item);
                    }
                }
            }

            WorkingTimeDiffReport = WorkingTimeDiffReport
                                    .OrderBy(x => x.EmployeeName)
                                    .ThenByDescending(x => x.Day).ToList();
        }