public ParentCalendarVM GetChildsSchedule(int id) { var childsSchedule = context.Schedules .Select(x => x.ChildrenId == id); ParentCalendarVM parentCalendar = new ParentCalendarVM { FirstName = GetChildNameFromID(id), ChildId = id, AllTimes = Utils.GetAllTimes(), Weekdays = Utils.GetWeekdays(), DropOffTimes = GetDropOffTimes(id), PickupTimes = GetPickUpTimes(id) }; return(parentCalendar); }
public static ParentCalendarVM GetTestParentCalendarVM(int id) { if (pickUps[0].Hours == 0) { pickUps[0] = pickUp1; pickUps[1] = pickUp2; pickUps[2] = pickUp3; pickUps[3] = pickUp4; pickUps[4] = pickUp5; dropOffs[0] = dropOff1; dropOffs[1] = dropOff2; dropOffs[2] = dropOff3; dropOffs[3] = dropOff4; dropOffs[4] = dropOff5; } string[] weekDays = new string[5]; weekDays[0] = "Måndag"; weekDays[1] = "Tisdag"; weekDays[2] = "Onsdag"; weekDays[3] = "Torsdag"; weekDays[4] = "Fredag"; ParentCalendarVM parentCalendarVM = new ParentCalendarVM(); parentCalendarVM.DropOffTimes = dropOffs; parentCalendarVM.PickupTimes = pickUps; parentCalendarVM.Weekdays = weekDays; parentCalendarVM.FirstName = "Kalle"; parentCalendarVM.ChildId = 10; parentCalendarVM.AllTimes = GetAllTimes(); return(parentCalendarVM); }