public static List <AttendantSummary> Load(NurseryAssignerEntities db, DateTime startDate, DateTime endDate) { var schedule = db.AttendantSchedules.Include("Attendant").Include("Service").Where(s => s.Service.Date >= startDate && s.Service.Date <= endDate).OrderBy(s => s.AttendantID).ToList() .Select(s => new AttendantSummary(db) { //HARD CODING ALERT!! Have to manually put Boerman kids together because there are 2 families of them GroupID = (s.AttendantID == 179 || s.AttendantID == 192 ? "BoermanRS" : s.Attendant.LastName), Name = s.Attendant.FirstName + " " + s.Attendant.LastName, Day = s.Service.Date, AMPM = s.Service.AMPM }).ToList(); return(schedule); }
public ScheduleBuilder(NurseryAssignerEntities db, DateTime start, DateTime end) { _db = db; _start = start; _end = end; }
public static long MaxAttendantsPerDay(NurseryAssignerEntities db) { long count = db.AssignmentCounts.GroupBy(c => c.AMPM).Select(g => g.Sum(v => v.Amount)).Max(); return(Convert.ToInt32(count)); }
public AttendantSummary(NurseryAssignerEntities db) { _db = db; }