示例#1
0
        public void CreateUtilisateur()
        {
            UtilisateurDAO utilisateurDAO = new UtilisateurDAO();

            try
            {
                MD5    md5Hash = MD5.Create();
                string mdp     = GetMd5Hash(md5Hash, this.Mdp);
                this.Mdp = mdp;
                Utilisateur utilisateurExiste = utilisateurDAO.GetUtilisateurByIdentifiant(this.identifiants);
                if (utilisateurExiste.IdUtilisateur != null)
                {
                    throw new Exception("Cet utilisateur existe déjà");
                }
                else
                {
                    utilisateurDAO.CreateUtilisateur(this);
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }