示例#1
0
        public void SocieteUpdate
            (int no,
            string raisonSocial,
            string activite,
            string adresse,
            string codePostal,
            string ville,
            string pays,
            string numeroEmployeur,
            string cleEmployeur,
            string matriculFiscal,
            string matriculCle,
            string matriculCodeTva,
            string matriculCategorie,
            string matriculEtablissement,
            string codeBureau,
            string serverName,
            string databaseName,
            string user,
            string password,
            TypeAuthentification type,
            TypeMatriculCnss cnssTypeMatricule
            )
        {
            // checked if exist societe by same raison social
            Societe societe = _societeRepository.Get(no);

            if (societe == null)
            {
                throw new ApplicationException("Societe n'existe pas!");
            }
            societe.RaisonSocial          = raisonSocial;
            societe.CodePostal            = codePostal;
            societe.CodeBureau            = codeBureau;
            societe.Activite              = activite;
            societe.Adresse               = adresse;
            societe.CleEmployeur          = cleEmployeur;
            societe.MatriculCategorie     = matriculCategorie;
            societe.MatriculCodeTva       = matriculCodeTva;
            societe.MatriculEtablissement = matriculEtablissement;
            societe.NumeroEmployeur       = numeroEmployeur;
            societe.MatriculCle           = matriculCle;
            societe.MatriculFiscal        = matriculFiscal;
            societe.Pays              = pays;
            societe.Ville             = ville;
            societe.DatabaseName      = databaseName;
            societe.Password          = password;
            societe.ServerName        = serverName;
            societe.Type              = type;
            societe.User              = user;
            societe.CnssTypeMatricule = cnssTypeMatricule;

            _societeRepository.Update(societe);
            if (Societe.Id == no)
            {
                Societe = _societeRepository.Get(no);
            }
        }
示例#2
0
        public int SocieteCreate
            (string raisonSocial,
            string activite,
            string adresse,
            string codePostal,
            string ville,
            string pays,
            string numeroEmployeur,
            string cleEmployeur,
            string matriculFiscal,
            string matriculCle,
            string matriculCodeTva,
            string matriculCategorie,
            string matriculEtablissement,
            string codeBureau,
            string serverName,
            string databaseName,
            string user,
            string password,
            TypeAuthentification type,
            TypeMatriculCnss cnssTypeMatricule
            )
        {
            // checked raison social
            if (string.IsNullOrEmpty(raisonSocial))
            {
                throw new ApplicationException("Raison social invalide!");
            }
            // checked if exist societe by same raison social
            Societe exist = _societeRepository.Get(raisonSocial);

            if (exist != null)
            {
                throw new ApplicationException("Societe déja existe!");
            }
            var societe = new Societe
            {
                RaisonSocial          = raisonSocial,
                CodePostal            = codePostal ?? string.Empty,
                CodeBureau            = codeBureau ?? string.Empty,
                Activite              = activite ?? string.Empty,
                Adresse               = adresse ?? string.Empty,
                CleEmployeur          = cleEmployeur ?? string.Empty,
                MatriculCategorie     = matriculCategorie ?? string.Empty,
                MatriculEtablissement = matriculEtablissement ?? string.Empty,
                NumeroEmployeur       = numeroEmployeur ?? string.Empty,
                MatriculCle           = matriculCle ?? string.Empty,
                MatriculCodeTva       = matriculCodeTva ?? string.Empty,
                MatriculFiscal        = matriculFiscal ?? string.Empty,
                Pays              = pays ?? string.Empty,
                Ville             = ville ?? string.Empty,
                CurrentExerciceNo = Exercice.Id,
                DatabaseName      = databaseName,
                Password          = password,
                ServerName        = serverName,
                Type              = type,
                User              = user,
                CnssTypeMatricule = cnssTypeMatricule
            };

            return(_societeRepository.Create(societe));
        }