示例#1
0
        /// <inheritdoc />
        public IEnumerable <ProgrammationDto> GetAllProgrammation()
        {
            this.Logger.Info(string.Format("Récupérer la liste des programmations"));
            IMapper <Programmations, ProgrammationDto> mapper = new ProgrammationDtoToProgrammationMapping();
            var listePge = this._uow.HidalgoRepository.GetAllProgrammation().Select(x => mapper.Map(x)).ToList();

            return(listePge);
        }
示例#2
0
        public ProgrammationDto GetProgrammationByNatureTypeAnnee(string natureTravaux, string typeOuvrage, int?anneeProgrammation)
        {
            ProgrammationDto programmation;

            this.Logger.Info(string.Format("Recuperation de la derniere programmation {0} {1} {2}", natureTravaux, typeOuvrage, anneeProgrammation));
            IMapper <Programmations, ProgrammationDto> mapper = new ProgrammationDtoToProgrammationMapping();

            programmation = mapper.Map(this._uow.HidalgoRepository.GetOneProgrammationByTypeNatureAnnee(typeOuvrage, natureTravaux, anneeProgrammation));
            this.Logger.Info(string.Format("Fin de la Suppression de la programmation {0}", programmation.Id));

            return(programmation);
        }
示例#3
0
        /// <inheritdoc />
        public void Save(ProgrammationDto newProgrammationsDto)
        {
            if (newProgrammationsDto == null)
            {
                throw new ArgumentNullException("newProgrammationsDto est null");
            }

            this.Logger.Info(string.Format("Début d'eregistrement d'une nouvelle programmation de l'année {0}", newProgrammationsDto.Anneeprogrammation));
            IMapper <ProgrammationDto, Programmations> mapper = new ProgrammationDtoToProgrammationMapping();

            this._uow.HidalgoRepository.SaveProgrammation(mapper.Map(newProgrammationsDto));
            this.Logger.Info(string.Format("Enregistrement est terminé"));
        }
示例#4
0
        /// <inheritdoc />
        public void UpdateProgrammation(ProgrammationDto programmationDto)
        {
            if (programmationDto == null)
            {
                this.Logger.Error(string.Format("UpdateProgrammation: l'objet de la programmation est vide"));
                new ArgumentNullException("l'objet de la programmation est vide.");
            }

            this.Logger.Info(string.Format("Update de la programmation: {0}", programmationDto.Id));
            var programmationMetier = this._uow.HidalgoRepository.GetOneProgrammation(programmationDto.Id);
            var mapper = new ProgrammationDtoToProgrammationMapping();

            mapper.Map(programmationDto, programmationMetier);
            this._uow.HidalgoRepository.UpdateProgrammation(programmationMetier);
            this.Logger.Info(string.Format("Fin de l'update de la programmation: {0}", programmationDto.Id));
        }