示例#1
0
        public void UpdateHourCosts(string projectUId, RoleHourCost[] hourCosts)
        {
            // verifies permission
            authorizationService.VerifyPermissionAtProject(projectUId, PermissionSets.SCRUM_MASTER);
            authorizationService.VerifyCanSeeProposalValues();

            // save new costs
            proposalsRepository.SaveHourCosts(hourCosts);

            // updates the project proposals with new total price
            ICollection <BacklogItem> backlog   = backlogservice.GetCurrentBacklog(projectUId, (short)BacklogFiltersMode.ALL);
            ICollection <Proposal>    proposals = GetProjectProposals(projectUId);

            foreach (Proposal p in proposals.Where(p => p.ProposalStatus == (short)ProposalStatus.PROPOSAL_WAITING))
            {
                Proposal pWithItems = GetProjectProposal(projectUId, p.ProposalUId);
                pWithItems.SetBacklogItems(backlog);
                pWithItems.TotalValue = pWithItems.CalcTotalPrice(hourCosts);
                proposalsRepository.SaveProposal(pWithItems);
            }
        }