예제 #1
0
 public IActionResult GetPlanPosteFrequencies(int idPlanPoste, bool isAnnualEstimation)
 {
     if (idPlanPoste != 0)
     {
         var toto = _planPosteFrequencyService.GetByIdPlanPoste(idPlanPoste);
         if ((toto.Count == 1 && !isAnnualEstimation) || (toto.Count > 1 && isAnnualEstimation))
         {
             return(Ok(_planPosteFrequencyService.InitForCreation(isAnnualEstimation)));
         }
         else
         {
             return(Ok(toto));
         }
     }
     return(Ok(_planPosteFrequencyService.InitForCreation(isAnnualEstimation)));
 }
        public PlanPosteForDetailDto GetForDetailById(int idUserGroup, int idPlanPoste)
        {
            var planPoste = _planPosteService.GetById(idPlanPoste);

            PlanPosteForDetailDto planPosteForDetailDto = _mapper.Map <PlanPosteForDetailDto>(planPoste);

            planPosteForDetailDto.Poste = _mapper.Map <SelectDto>(planPoste.Poste);

            var referenceTableList = _referenceTableService.GetAll();

            planPosteForDetailDto.ReferenceTable.List     = _mapper.Map <List <SelectDto> >(referenceTableList);
            planPosteForDetailDto.ReferenceTable.Selected = _mapper.Map <SelectDto>(planPoste.ReferenceTable);



            planPosteForDetailDto.PlanPosteUser = _planPosteUserService.GetByIdPlanPoste(planPoste.Id);

            planPosteForDetailDto.PlanPosteReference = _planPosteReferenceService.GetListForComboByIdPlanPoste(idUserGroup, planPoste.Id, planPoste.ReferenceTable.Id, planPoste.Poste.Id);

            planPosteForDetailDto.PlanPosteFrequencies = _planPosteFrequencyService.GetByIdPlanPoste(planPoste.Id);


            return(planPosteForDetailDto);
        }