private ExcelReport <PayPeriodReportCriteria> GetPayPeriodReportViewModel(bool isCurrentUserAdmin)
        {
            var vm2 = new PayPeriodReportCriteria();

            vm2.PayPeriodEnd  = WeekDTO.CreateWithWeekContaining(DateTime.Now).WeekEnd;
            vm2.PayPeriodList = PayPeriodRepository.GetPPRange(rangeSize: 25);
            var rpt = new ExcelReport <PayPeriodReportCriteria>(PayPeriodReportCriteria.PAY_PERIOD_REPORT_NAME, vm2, isCurrentUserAdmin);

            return(rpt);
        }
Ejemplo n.º 2
0
        public IActionResult Get([FromQuery] string startDateIdentifier = null, [FromQuery] int pageSize = 15)
        {
            var midDatePoint = DateTime.Now;
            var allEntries   = new List <PayPeriodDTO>();

            if (!string.IsNullOrWhiteSpace(startDateIdentifier))
            {
                var expr  = @"(?<year>[0-9]{4})\.(?<month>[0-9]{2})\.(?<day>[0-9]{2})";
                var parts = Regex.Match(startDateIdentifier, expr);
                midDatePoint = new DateTime(int.Parse(parts.Groups["year"].Value), int.Parse(parts.Groups["month"].Value), int.Parse(parts.Groups["day"].Value));
            }
            var all = PayPeriodRepository.GetPPRange(midDatePoint, pageSize);

            return(Json(all));
        }