Example #1
0
        public StaffGroupDetail CreateDetail(StaffGroup staffGroup, IPersistenceContext context)
        {
            StaffAssembler    staffAssembler    = new StaffAssembler();
            WorklistAssembler worklistAssembler = new WorklistAssembler();

            IList <Worklist> worklists = context.GetBroker <IWorklistBroker>().Find(staffGroup);

            return(new StaffGroupDetail(
                       staffGroup.GetRef(),
                       staffGroup.Name,
                       staffGroup.Description,
                       staffGroup.Elective,
                       CollectionUtils.Map <Staff, StaffSummary>(staffGroup.Members,
                                                                 delegate(Staff staff)
            {
                return staffAssembler.CreateStaffSummary(staff, context);
            }),
                       CollectionUtils.Map <Worklist, WorklistSummary>(worklists,
                                                                       delegate(Worklist worklist)
            {
                return worklistAssembler.GetWorklistSummary(worklist, context);
            }),
                       staffGroup.Deactivated
                       ));
        }
        public ListWorklistsForUserResponse ListWorklistsForUser(ListWorklistsForUserRequest request)
        {
            var assembler = new WorklistAssembler();

            return(new ListWorklistsForUserResponse(
                       CollectionUtils.Map <Worklist, WorklistSummary>(
                           PersistenceContext.GetBroker <IWorklistBroker>().Find(CurrentUserStaff, request.WorklistTokens),
                           worklist => assembler.GetWorklistSummary(worklist, PersistenceContext))));
        }