Example #1
0
        public ApplicationFormViewModel CreateFormViewModelFor(Application application)
        {
            ApplicationFormViewModel viewModel = new ApplicationFormViewModel();

            application.SetHostIdsFromHost();
            viewModel.Application = application;
            LoadViewModel(viewModel);
            if (application.SupportTeamId != null)
            {
                viewModel.SupportTeam = _supportTeamManagementService.Get(application.SupportTeamId.Value);
                if (viewModel.SupportTeam != null && viewModel.SupportTeam.SupervisorId.HasValue)
                {
                    viewModel.SupportTeamSupervisor = _personManagementService.Get(viewModel.SupportTeam.SupervisorId.Value);
                }
                if (viewModel.SupportTeamSupervisor != null && viewModel.SupportTeamSupervisor.SupervisorId.HasValue)
                {
                    viewModel.SupportTeamAdmin = _personManagementService.Get(viewModel.SupportTeamSupervisor.SupervisorId.Value);
                }
            }
            if (application.SubjectMatterExpertId != null)
            {
                viewModel.SubjectMatterExpert = _personManagementService.Get(application.SubjectMatterExpertId.Value);
            }
            return(viewModel);
        }
Example #2
0
        public void CanGetSupportTeam()
        {
            // Establish Context
            SupportTeam supportTeamToExpect =
                SupportTeamInstanceFactory.CreateValidTransientSupportTeam();

            supportTeamRepository.Expect(r => r.Get(1))
            .Return(supportTeamToExpect);

            // Act
            SupportTeam supportTeamRetrieved =
                supportTeamManagementService.Get(1);

            // Assert
            supportTeamRetrieved.ShouldNotBeNull();
            supportTeamRetrieved.ShouldEqual(supportTeamToExpect);
        }
Example #3
0
        public ActionResult Show(int id)
        {
            SupportTeam supportTeam = _supportTeamManagementService.Get(id);

            return(View(supportTeam));
        }