public SearchResultFormViewModel <OrgDto, OrgSearchRequest> CreateFormViewModel()
        {
            var searchRequest = new OrgSearchRequest {
                Agencies = _agencyManagementService.GetAll()
            };
            SearchResultFormViewModel <OrgDto, OrgSearchRequest> viewModel = Search(searchRequest);

            viewModel.SearchRequest = searchRequest;

            return(viewModel);
        }
Ejemplo n.º 2
0
        protected void LoadViewModel(RequestFormViewModel viewModel)
        {
            viewModel.BudgetLocations = _agencyManagementService.GetAll();

            viewModel.ExecutiveSponsors = (viewModel.Request != null &&
                                           viewModel.Request.ExecutiveSponsorPersonId.HasValue)
                                              ? _personManagementService.GetActiveStaffWithAgency(
                viewModel.Request.ExecutiveSponsorPersonId.Value)
                                              : _personManagementService.GetActiveStaffWithAgency();

            viewModel.ITDivisions = _orgManagementService.GetByAgency(13);

            viewModel.ProjectManagers = (viewModel.Request != null &&
                                         viewModel.Request.ProjectManagerId.HasValue)
                                            ? _personManagementService.GetActiveStaff(
                viewModel.Request.ProjectManagerId.Value)
                                            : _personManagementService.GetActiveStaff();

            viewModel.RequestStatuses = _requestStatusManagementService.GetAll();
            viewModel.RequestTypes    = _requestTypeManagementService.GetAll();
            viewModel.UserLeads       = (viewModel.Request != null &&
                                         viewModel.Request.UserLeadPersonId.HasValue)
                                      ? _personManagementService.GetActiveStaffWithAgency(
                viewModel.Request.UserLeadPersonId.Value)
                                      : _personManagementService.GetActiveStaffWithAgency();
            viewModel.WrmsSystems = _wrmsSystemManagementService.GetActiveSystems();

            if (viewModel.Request != null && viewModel.Request.Id > 0)
            {
                viewModel.TotalRequestHours = _timeEntryManagementService.GetTotalHours(viewModel.Request.Id);
            }
        }
Ejemplo n.º 3
0
        public OrgFormViewModel CreateFormViewModel()
        {
            var viewModel = new OrgFormViewModel {
                Agencies = _agencyManagementService.GetAll()
            };

            return(viewModel);
        }
Ejemplo n.º 4
0
        public void CanGetAllAgencies()
        {
            // Establish Context
            IList <Agency> agenciesToExpect = new List <Agency>();

            Agency agency =
                AgencyInstanceFactory.CreateValidTransientAgency();

            agenciesToExpect.Add(agency);

            _agencyRepository.Expect(r => r.GetAll())
            .Return(agenciesToExpect);

            // Act
            IList <Agency> agenciesRetrieved =
                _agencyManagementService.GetAll();

            // Assert
            agenciesRetrieved.ShouldNotBeNull();
            agenciesRetrieved.Count.ShouldEqual(1);
            agenciesRetrieved[0].ShouldNotBeNull();
            agenciesRetrieved[0].ShouldEqual(agency);
        }