Ejemplo n.º 1
0
        private List <PlanPosteUserForTrackingDto> GetPlanPosteUsersForTracking(PlanPosteForTrackingDto planPosteForTrackingDto, int idPlanPoste)
        {
            List <PlanPosteUser> planPosteUsers = _planPosteUserRepository.GetByIdPlanPoste(idPlanPoste);
            List <PlanPosteUserForTrackingDto> planPosteUsersForTracking = new List <PlanPosteUserForTrackingDto>();

            foreach (var planPosteUser in planPosteUsers)
            {
                if (planPosteUser.PercentagePart != 0)
                {
                    PlanPosteUserForTrackingDto planPosteUserForTrackingDto = new PlanPosteUserForTrackingDto
                    {
                        FirstName      = planPosteUser.PlanUser.User.FirstName,
                        PercentagePart = planPosteUser.PercentagePart,
                        AmountPreview  = Math.Round(planPosteUser.PercentagePart * planPosteForTrackingDto.AmountPreview / 100, 2),
                        AmountReal     = Math.Round(planPosteUser.PercentagePart * planPosteForTrackingDto.AmountReal / 100, 2)
                    };
                    planPosteUserForTrackingDto.GaugeValue = CalculatePercentage(planPosteUserForTrackingDto.AmountReal, planPosteUserForTrackingDto.AmountPreview);

                    planPosteUsersForTracking.Add(planPosteUserForTrackingDto);
                }
            }

            return(planPosteUsersForTracking);
        }
Ejemplo n.º 2
0
        public List <PlanPosteUser> GetBaseByIdPlanPoste(int idPlanPoste)
        {
            var planPosteUsers = _planPosteUserRepository.GetByIdPlanPoste(idPlanPoste);

            return(planPosteUsers);
        }