예제 #1
0
        public void addWorkerTimeEntry(WorkerTimeEntry workerTimeEntry)
        {
            this.workerTimeEntries.Add(workerTimeEntry);

            var day = workerTimeEntry.getDay();

            if (!workedDaysMap.ContainsKey(day))
            {
                workedDaysMap[day] = new WorkedDay(day);
            }

            workedDaysMap[day].addLoggedTime(new Time(workerTimeEntry.getRoundedTime()));
        }
예제 #2
0
        private void writeWorkDay(WorkedDay workedDay)
        {
            periodsSheet.Cell("A" + currentRow).Value = workedDay.getDate();
            char lastColum = 'B';

            foreach (Time loggedTime in workedDay.getLoggedTimes())
            {
                //TODO:Search for a way to use last written column
                string loggedTimeCellIndex = lastColum.ToString() + currentRow;
                periodsSheet.Cell(loggedTimeCellIndex).Value = loggedTime.getTime();
                lastColum++;
            }

            periodsSheet.Cell("G" + currentRow).Value = workedDay.getMorningWorkedHours();
            periodsSheet.Cell("H" + currentRow).Value = workedDay.getAfternooWorkedHours();

            if (workedDay.hasInvalidLoggedTimes())
            {
                periodsSheet.Cell("G" + currentRow).Style.Fill.BackgroundColor = XLColor.Red;
                periodsSheet.Cell("H" + currentRow).Style.Fill.BackgroundColor = XLColor.Red;
            }
        }