Esempio n. 1
0
        public Entreprise CreateEntreprise(CreateEntrepriseCommand command)
        {
            var entreprise = new Entreprise {
                Adresses    = command.Adresses,
                NumeroTva   = command.NumeroTva,
                SiegeSocial = command.SiegeSocial
            };

            _entrepriseRepository.Create(entreprise);
            _unitOfWork.SaveChanges();
            return(entreprise);
        }
Esempio n. 2
0
        public Entreprise UpdateSiegeSocialAndAddAdress(int Id, CreateEntrepriseCommand command)
        {
            var entreprise = _entrepriseRepository.FindOneById(Id);

            if (command.Adresses != null)
            {
                entreprise.Adresses = command.Adresses;
            }
            if (command.SiegeSocial != null)
            {
                entreprise.SiegeSocial = command.SiegeSocial;
            }


            _entrepriseRepository.UpdateSiegeSocialOrAdresses(entreprise);
            _unitOfWork.SaveChanges();

            return(entreprise);
        }
Esempio n. 3
0
 public ActionResult <Contact> Edit([FromRoute] int Id, CreateEntrepriseCommand command)
 {
     _entrepriseService.Update(Id, command);
     return(Ok());
 }
Esempio n. 4
0
 public ActionResult <Contact> EditSiegeSocialOrAddAdresses([FromRoute] int Id, CreateEntrepriseCommand command)
 {
     _entrepriseService.UpdateSiegeSocialAndAddAdress(Id, command);
     return(Ok());
 }
Esempio n. 5
0
        public ActionResult <Contact> Create(CreateEntrepriseCommand command)
        {
            var contact = _entrepriseService.CreateEntreprise(command);

            return(Ok(contact));
        }