Exemple #1
0
        public Client Add(Client client)
        {
            Client     result     = new Client();
            Parametres parametres = _parametresService.GetAll();



            if (!parametres.INCCLI)
            {
                if (!(CheckUnicCodification(client.Numero)))
                {
                    _ClientRepository.Add(client);
                    result = client;
                }
                else
                {
                    result = null;
                }
            }
            else
            {
                client.Numero = parametres.NUMCLI;
                while (CheckUnicCodification(client.Numero))
                {
                    client.Numero = client.Numero.IncrementCode();
                }

                result            = _ClientRepository.Add(client);
                parametres.NUMCLI = client.Numero;
                _parametresService.Update(parametres);
            }
            return(result);
        }
Exemple #2
0
        public Tiers Add(Tiers Tiers)
        {
            Tiers      result     = new Tiers();
            Parametres parametres = _parametresService.GetAll();



            if (!parametres.INCCLI)
            {
                if (!(CheckUnicCodification(Tiers.Numero)))
                {
                    Tiers.Type = 0;
                    _clientRepository.Add(Tiers);
                    result = Tiers;
                }
                else
                {
                    result = null;
                }
            }
            else
            {
                Tiers.Numero = parametres.NUMCLI;
                while (CheckUnicCodification(Tiers.Numero))
                {
                    Tiers.Numero = Tiers.Numero.IncrementCode();
                }
                Tiers.Type        = 0;
                result            = _clientRepository.Add(Tiers);
                parametres.NUMCLI = Tiers.Numero;
                _parametresService.Update(parametres);
            }
            return(result);
        }
Exemple #3
0
 public Parametres Put([FromBody] Parametres parametre)
 {
     if (ModelState.IsValid)
     {
         _ParametresService.Update(parametre);
     }
     return(parametre);
 }