Ejemplo n.º 1
0
        public List <Models.Providers.PayrollGridItemVM> GetPayablesByPeriod(DateTime firstDayOfMonthOfPeriod, App.Providers.Models.PayrollFilter filter)
        {
            var domainList = new Data.Services.HoursService().GetPayrollHoursByPeriod(firstDayOfMonthOfPeriod, (int)filter);

            var list = new List <Models.Providers.PayrollGridItemVM>();

            foreach (var di in domainList)
            {
                var item = new Models.Providers.PayrollGridItemVM();
                item.ID        = di.ID;
                item.PayrollID = di.PayrollID;
                item.FirstName = di.FirstName;
                item.LastName  = di.LastName;
                item.Hours     = di.TotalHours;
                item.EntriesMissingCatalystData = di.EntriesMissingCatalystData;
                list.Add(item);
            }

            return(list);
        }
Ejemplo n.º 2
0
        public static PeriodMatrixByCase GetPeriodMatrix(int caseID, DateTime startDate, DateTime endDate)
        {
            List <Data.Models.Sprocs.PeriodHoursMatrixByCase> entities = new Data.Services.HoursService().PeriodHoursMatrix(caseID, startDate, endDate);

            var model = new PeriodMatrixByCase();

            model.CaseID = caseID;

            foreach (var e in entities)
            {
                Hours h;

                switch (e.HoursType)
                {
                case "AllHours":
                    h = model.AllHours;
                    break;

                case "BCBAHours":
                    h = model.BCBAHours;
                    break;

                case "AideHours":
                    h = model.AideHours;
                    break;

                default:
                    throw new InvalidOperationException("Hours Type is not registered");
                }

                h.Total    = e.TotalHours;
                h.Payable  = e.PayableHours;
                h.Billable = e.BillableHours;
            }

            return(model);
        }