示例#1
0
        public bool Supprimer(int idutilisateur, int idrole)
        {
            Commande com = new Commande("utilisateurrole_eff");

            com.AjouterParametre("idutilisateur", idutilisateur);
            com.AjouterParametre("idrole", idrole);
            return((int)_connexion.ExecuterNonRequete(com) == 1);
        }
        public bool SupprimerEnfant(int id, int idEnfant)
        {
            Commande com = new Commande("enfant_eff", true);

            com.AjouterParametre("id", id);
            com.AjouterParametre("idenfant", idEnfant);
            return(_connexion.ExecuterNonRequete(com) > 0);

            throw new NotImplementedException();
        }
示例#3
0
        public bool Supprimer(int id1, int id2)
        {
            Commande com = new Commande("couple_eff", true);

            com.AjouterParametre("idpersonne", id1);
            com.AjouterParametre("idpartenaire", id2);
            return((int)_connexion.ExecuterNonRequete(com) > 0);

            throw new NotImplementedException();
        }
示例#4
0
        public bool Modifier(int id, Arbre e)
        {
            Commande com = new Commande("Arbre_mod", true);

            com.AjouterParametre("id", id);
            com.AjouterParametre("nom", e.nom);
            com.AjouterParametre("description", e.description);

            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
示例#5
0
        public bool Modifier(int id, Theme e)
        {
            Commande com = new Commande("Theme_mod", true);

            com.AjouterParametre("id", e.id);
            com.AjouterParametre("titre", e.titre);
            com.AjouterParametre("description", e.description);

            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
示例#6
0
        public MessageDestination Donner(int idConversation, int idDestinataire)
        {
            Commande com = new Commande($"{CONST_MESSAGEDESTINATION_REQ} where idconversation = @idconversation and iddestinataire = @iddestinataire");

            com.AjouterParametre("iddestinataire", idDestinataire);
            com.AjouterParametre("idconversation", idConversation);
            return(_connexion.ExecuterLecteur(com, j => j.VersMessageDestination()).SingleOrDefault());

            throw new NotImplementedException();
        }
示例#7
0
        public bool Modifier(int idutilisateur, int idrole, UtilisateurRole e)
        {
            Commande com = new Commande("utilisateurrole_mod");

            com.AjouterParametre("idutilisateur", idutilisateur);
            com.AjouterParametre("idrole", idrole);
            return((int)_connexion.ExecuterNonRequete(com) == 1);

            throw new NotImplementedException();
        }
示例#8
0
        public UtilisateurRole Donner(int idutilisateur, int idrole)
        {
            Commande com = new Commande($"{CONST_UTILISATEURROLE_REQ} where idutilisateur = @idutilisateur and idrole = @idrole");

            com.AjouterParametre("idutilisateur", idutilisateur);
            com.AjouterParametre("idrole", idrole);
            return(_connexion.ExecuterLecteur(com, j => j.VersUtilisateurRole()).SingleOrDefault());

            throw new NotImplementedException();
        }
示例#9
0
        public IEnumerable <VMessageRecu> Donner(int idConversation, int idDestinataire)
        {
            Commande com = new Commande($"{CONST_VMESSAGERECU_REQ} where idconversation = @idconversation and iddestinataire = @iddestinataire");

            com.AjouterParametre("idconversation", idConversation);
            com.AjouterParametre("iddestinataire", idDestinataire);
            return(_connexion.ExecuterLecteur(com, j => j.VersVMessageRecu()));

            throw new NotImplementedException();
        }
        public Utilisateur Donner(string login, string motDePasse)
        {
            Commande com = new Commande($"{CONST_UTILISATEUR_REQ} where login = @login and dbo.ConstruireHMotdepasse(@motdepasse, presel,postsel) = motdepasse");

            com.AjouterParametre("login", login);
            com.AjouterParametre("motdepasse", motDePasse);
            return(_connexion.ExecuterLecteur(com, j => j.VersUtilisateur()).SingleOrDefault());

            throw new NotImplementedException();
        }
示例#11
0
        public bool Lire(int idConversation, int idDestinataire)
        {
            Commande com = new Commande("messagedestination_lu", true);

            com.AjouterParametre("idconversation", idConversation);
            com.AjouterParametre("iddestinataire", idDestinataire);
            return(_connexion.ExecuterNonRequete(com) >= 0);

            throw new NotImplementedException();
        }
示例#12
0
        public bool EstEnCouple(int id1, int id2)
        {
            Commande com = new Commande($"select count(*) from couple where idpersonne = @idpersonne and idpartenaire = @idpartenaire");

            com.AjouterParametre("idpersonne", id1);
            com.AjouterParametre("idpartenaire", id2);
            return((int)_connexion.ExecuterScalaire(com) > 0);

            throw new NotImplementedException();
        }
示例#13
0
        public bool EstLu(int idConversation, int idDestinataire)
        {
            Commande com = new Commande($"select count (*) from ({CONST_MESSAGEDESTINATION_REQ} where idconversation = @idconversation and iddestinataire = @iddestinataire and datelecture is not null) x");

            com.AjouterParametre("idconversation", idConversation);
            com.AjouterParametre("iddestinataire", idDestinataire);
            return((int)_connexion.ExecuterScalaire(com) == 1);

            throw new NotImplementedException();
        }
        public int Creer(Blocage e)
        {
            Commande com = new Commande("Blocage_cre", true);

            com.AjouterParametre("id", 0, true);
            com.AjouterParametre("nom", e.nom);
            com.AjouterParametre("description", e.description);

            _connexion.ExecuterNonRequete(com);
            return((int)com.Parametres["id"].Valeur);
        }
        public IEnumerable <Personne> DonnerEnfants(int idPere, int idMere)
        {
            Commande com = new Commande($"{CONST_PERSONNE_REQ} where idpere = @idpere and idmere = @idmere");

            com.AjouterParametre("idmere", idMere);
            com.AjouterParametre("idpere", idPere);
            return(_connexion.ExecuterLecteur(com, j => j.VersPersonne()) //??new List<Personne>()
                   );

            throw new NotImplementedException();
        }
        public bool Modifier(int id, Nouvelle e)
        {
            Commande com = new Commande("nouvelle_mod", true);

            com.AjouterParametre("id", e.id);
            com.AjouterParametre("titre", e.titre);
            com.AjouterParametre("description", e.description);
            com.AjouterParametre("idcreateur", e.idcreateur);
            com.AjouterParametre("datecreation", e.datecreation);
            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
        public int Creer(Conversation e)
        {
            Commande com = new Commande("Conversation_cre", true);

            com.AjouterParametre("id", 0, true);
            com.AjouterParametre("sujet", e.sujet);
            com.AjouterParametre("texte", e.texte);
            com.AjouterParametre("idemetteur", e.idemetteur);

            _connexion.ExecuterNonRequete(com);
            return((int)com.Parametres["id"].Valeur);
        }
        public int Creer(Nouvelle e)
        {
            Commande com = new Commande("nouvelle_cre", true);

            com.AjouterParametre("id", 0, true);
            com.AjouterParametre("titre", e.titre);
            com.AjouterParametre("description", e.description);
            com.AjouterParametre("idcreateur", e.idcreateur);
            com.AjouterParametre("datecreation", e.datecreation);
            _connexion.ExecuterNonRequete(com);
            return((int)com.Parametres["id"].Valeur);
        }
示例#19
0
        public int Creer(Chat e)
        {
            Commande com = new Commande("Chat_cre", true);

            com.AjouterParametre("id", 0, true);
            com.AjouterParametre("idutilisateur", e.idutilisateur);
            com.AjouterParametre("message", e.message);
            com.AjouterParametre("date", e.date);
            com.AjouterParametre("actif", e.actif);
            _connexion.ExecuterNonRequete(com);
            return((int)com.Parametres["id"].Valeur);
        }
示例#20
0
        public bool Bloquer(BlocageArbre e)
        {
            Commande com = new Commande("arbre_bloquer", true);

            com.AjouterParametre("id", e.id);
            com.AjouterParametre("idbloqueur", e.idBloqueur);
            com.AjouterParametre("idblocage", e.idBlocage);
            com.AjouterParametre("dateblocage", DateTime.Now);
            return(_connexion.ExecuterNonRequete(com) > 0);

            throw new NotImplementedException();
        }
示例#21
0
        public int Creer(Arbre e)
        {
            Commande com = new Commande("Arbre_cre", true);

            com.AjouterParametre("id", 0, true);
            com.AjouterParametre("nom", e.nom);
            com.AjouterParametre("description", e.description);
            com.AjouterParametre("idcreateur", e.idcreateur);
            com.AjouterParametre("datecreation", DateTime.Now);

            _connexion.ExecuterNonRequete(com);
            return((int)com.Parametres["id"].Valeur);
        }
示例#22
0
        public int?DonnerParNom(string nom, int idcreateur)
        {
            if (nom == null)
            {
                return(null);
            }
            Commande com = new Commande($"{CONST_ARBRE_REQ} where nom = @nom and idcreateur = @idcreateur");

            com.AjouterParametre("nom", nom);
            com.AjouterParametre("idcreateur", idcreateur);
            Arbre e = _connexion.ExecuterLecteur(com, j => j.VersArbre()).SingleOrDefault();

            return((e == null) ? (int?)null : (int?)e.id);
        }
示例#23
0
        public IEnumerable <Arbre> Donner(IEnumerable <int> ie, string[] options = null)
        {
            string requete = $"{CONST_ARBRE_REQ} where actif = 1";
            string clause  = "";
            int    c       = 0;
            Dictionary <string, int> dp = new Dictionary <string, int>();

            if (ie != null)
            {
                foreach (int i in ie)
                {
                    c++;
                    clause += clause == "" ? "" : " or ";
                    clause += $"id = @i{c}";
                    dp.Add($"i{c}", i);
                }
            }
            if (c > 0)
            {
                clause = $"or ({clause})";
            }
            Commande com = new Commande($"{requete} {clause}");

            foreach (KeyValuePair <string, int> k in dp)
            {
                com.AjouterParametre(k.Key, k.Value);
            }
            return(_connexion.ExecuterLecteur(com, j => j.VersArbre()));

            throw new NotImplementedException();
        }
示例#24
0
        public Arbre Donner(int id)
        {
            Commande com = new Commande($"{CONST_ARBRE_REQ} where id=@id");

            com.AjouterParametre("id", id);
            return(_connexion.ExecuterLecteur(com, x => x.VersArbre()).SingleOrDefault());
        }
示例#25
0
        public bool Desactiver(int id)
        {
            Commande com = new Commande("Arbre_desact", true);

            com.AjouterParametre("id", id);
            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
        public bool Activer(int id)
        {
            Commande com = new Commande("Utilisateur_act", true);

            com.AjouterParametre("id", id);
            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
        public Utilisateur Donner(int id)
        {
            Commande com = new Commande($"{CONST_UTILISATEUR_REQ} where id=@id");

            com.AjouterParametre("id", id);
            return(_connexion.ExecuterLecteur(com, x => x.VersUtilisateur()).SingleOrDefault());
        }
        public bool Supprimer(int id)
        {
            Commande com = new Commande("Blocage_eff", true);

            com.AjouterParametre("id", id);
            return((int)_connexion.ExecuterNonRequete(com) > 0);
        }
示例#29
0
        public IEnumerable <int> Donner(int id1)
        {
            Commande com = new Commande($"{CONST_COUPLE_REQ} where idpersonne = @id");

            com.AjouterParametre("id", id1);
            return(_connexion.ExecuterLecteur(com, j => (int)j["idpartenaire"]));
        }
        public Conversation Donner(int id)
        {
            Commande com = new Commande($"{CONST_CONVERSATION_REQ} where id=@id");

            com.AjouterParametre("id", id);
            return(_connexion.ExecuterLecteur(com, x => x.VersConversation()).SingleOrDefault());
        }