Exemple #1
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);
            }
        }
Exemple #2
0
        protected void LoadViewModel(ApplicationFormViewModel viewModel)
        {
            viewModel.SubjectMatterExperts = (viewModel.Application != null &&
                                              viewModel.Application.SubjectMatterExpertId.HasValue)
                                        ? _personManagementService.GetActiveStaff(viewModel.Application.SubjectMatterExpertId.Value)
                                        : _personManagementService.GetActiveStaff();

            viewModel.Hosts        = _hostManagementService.GetAll();
            viewModel.SupportTeams = _supportTeamManagementService.GetAll();
        }
        public SearchResultFormViewModel <RequestDto, RequestSearchRequest> CreateFormViewModel()
        {
            var searchRequest = new RequestSearchRequest();

            //Set status to active by default
            searchRequest.RequestStatusId = 1;
            SearchResultFormViewModel <RequestDto, RequestSearchRequest> viewModel = Search(searchRequest);

            searchRequest.Systems         = _wrmsSystemManagementService.GetActiveSystems();
            searchRequest.ProjectManagers = _personManagementService.GetActiveStaff();
            searchRequest.RequestStatuses = _requestStatusManagementService.GetAll();
            viewModel.SearchRequest       = searchRequest;

            return(viewModel);
        }
Exemple #4
0
        public IList <TimeEntryAuditDto> GetIncompleteWeeklyTimeForAllUsers(DateTime weekEndingDate)
        {
            IList <Person> activeUsers = _personManagementService.GetActiveStaff();

            if (activeUsers == null)
            {
                return(new List <TimeEntryAuditDto>());
            }
            return((from activeUser in activeUsers
                    where _timeEntryAuditRepository.GetCount(activeUser.Id, weekEndingDate) == 0
                    let hours = GetHoursForWeek(weekEndingDate, activeUser.Id)
                                where hours < 40
                                select new TimeEntryAuditDto
            {
                AuditTimeStamp = DateTime.Now,
                Hours = hours.ToString(),
                UserId = activeUser.Id,
                WeekEndingDate = weekEndingDate
            }).ToList());
        }
Exemple #5
0
        protected void LoadViewModel(WrmsSystemFormViewModel viewModel)
        {
            viewModel.ManagerContacts = (viewModel.WrmsSystem != null && viewModel.WrmsSystem.ManagerContact.HasValue)
                                            ? _personManagementService.GetActiveStaff(
                viewModel.WrmsSystem.ManagerContact.Value)
                                            : _personManagementService.GetActiveStaff();

            viewModel.PrimaryContacts = (viewModel.WrmsSystem != null && viewModel.WrmsSystem.PrimaryContact.HasValue)
                                            ? _personManagementService.GetActiveStaff(
                viewModel.WrmsSystem.PrimaryContact.Value)
                                            : _personManagementService.GetActiveStaff();

            viewModel.SecondaryContacts = (viewModel.WrmsSystem != null &&
                                           viewModel.WrmsSystem.SecondaryContact.HasValue)
                                              ? _personManagementService.GetActiveStaff(
                viewModel.WrmsSystem.SecondaryContact.Value)
                                              : _personManagementService.GetActiveStaff();

            viewModel.ThirdContacts = (viewModel.WrmsSystem != null && viewModel.WrmsSystem.ThirdContact.HasValue)
                                          ? _personManagementService.GetActiveStaff(
                viewModel.WrmsSystem.ThirdContact.Value)
                                          : _personManagementService.GetActiveStaff();
        }