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); }
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); }
public ActionResult <Contact> Edit([FromRoute] int Id, CreateEntrepriseCommand command) { _entrepriseService.Update(Id, command); return(Ok()); }
public ActionResult <Contact> EditSiegeSocialOrAddAdresses([FromRoute] int Id, CreateEntrepriseCommand command) { _entrepriseService.UpdateSiegeSocialAndAddAdress(Id, command); return(Ok()); }
public ActionResult <Contact> Create(CreateEntrepriseCommand command) { var contact = _entrepriseService.CreateEntreprise(command); return(Ok(contact)); }