public void Export(ExcelWorksheet excelWorksheet, ITimesheet timesheet)
        {
            _worksheet = excelWorksheet;

            MoveRight();
            for (var i = 1; i <= 7; i++)
            {
                Value(Enum.GetName(typeof(DayOfWeek), i == 7 ? 0 : i))
                .FontBold()
                .MoveRight();
            }

            Value("Totals");

            NewLine();
            foreach (var week in timesheet.Weeks)
            {
                _timesheetWeekExporter.Export(this, week);
            }

            var rowIndex = CurrentRow;

            NewLine(3).MoveRight(7)
            .Value("Total:")
            .MoveRight()
            .Formula($"SUM(I2:I{rowIndex})", true)
            .Format(Constants.TimeFormat)
            .FontBold();

            _worksheet.Cells[1, 1, CurrentRow, CurrentColumn].AutoFitColumns();
        }
Ejemplo n.º 2
0
 public void AdjustTimesheet(ITimesheet timesheet)
 {
     Parallel.ForEach(timesheet.Weeks,
                      timesheetWeek => Parallel.ForEach(timesheetWeek.WorkDays,
                                                        workDay =>
     {
         _workedHoursCalculator.AdjustTimes(workDay);
         _workedHoursCalculator.VerifyTimes(workDay);
     }));
 }
        public TimesheetController(
            IConfiguration configuration,
            IRestClient <Timesheet> restClient,
            ITimesheet timesheet,
            UserManager <ApplicationUser> userManagerService)
        {
            _configuration      = configuration;
            _restClient         = restClient;
            _timesheet          = timesheet;
            _userManagerService = userManagerService;

            _restClient.Host = _configuration.GetSection("TimesheetService")["Host"];
            _restClient.Path = _configuration.GetSection("TimesheetService")["RegisterPath"];
        }
Ejemplo n.º 4
0
 public EmployeesController(ITimesheet repo)
 {
     this.repo = repo;
 }
Ejemplo n.º 5
0
 public TimesheetController(ITimesheet timesheet, IUserSettings userSettings, XatarisContext xatarisContext) : base(xatarisContext)
 {
     _timesheet    = timesheet;
     _userSettings = userSettings;
 }