Esempio n. 1
0
        public Marketer supprimer(Marketer u)
        {
            if (u == null)
            {
                u = new Marketer();
            }
            try
            {
                if (db.Marketers.First(x => x.codeMARKETER == u.codeMARKETER) != null)
                {
                    //sauvegarde des nouvelles informations

                    db.supprimerMarketer(u.codeMARKETER, u.codeU);
                }

                else
                {
                    u.adresse = "Cet enregistrement n'existe pas dans la base de donnees.";
                }
            }
            catch (Exception ex)
            {
                u.adresse = ex.StackTrace;
            }
            return(u);
        }
Esempio n. 2
0
        public Marketer rechercher(string code)
        {
            Marketer u = new Marketer();

            try
            {
                u = db.Marketers.First(x => x.codeMARKETER == code);

                //verification de l'existence de l'objet dans la bd
                if (u != null)
                {
                    return(u);
                }

                else
                {
                    u.adresse = "Aucun enregistrement trouve.";
                    return(null);
                }
            }
            catch (Exception ex)
            {
                u.adresse = ex.StackTrace;
            }

            return(u);
        }
Esempio n. 3
0
        public Marketer modifier(Marketer u)
        {
            if (u == null)
            {
                u = new Marketer();
            }
            try
            {
                //verification de l'existence de l'objet dans la bd
                if (db.Marketers.First(x => x.codeMARKETER == u.codeMARKETER) != null)
                {
                    //sauvegarde des nouvelles informations

                    db.modifierMarketer(u.codeMARKETER, u.adresse, u.email, u.nom, u.pays, u.telephone, u.ville, u.codeU);
                }

                else
                {
                    u.adresse = "Cet enregistrement n'existe pas dans la base de donnees.";
                }
            }
            catch (Exception ex)
            {
                u.adresse = ex.StackTrace;
            }


            return(u);
        }
Esempio n. 4
0
        public Marketer ajouter(Marketer u)
        {
            if (u == null)
            {
                u = new Marketer();
            }
            try
            {
                db.creerMarketer(u.adresse, u.email, u.nom, u.pays, u.telephone, u.ville, u.codeU);
            }
            catch (Exception ex)
            {
                u.adresse = ex.StackTrace;
            }

            return(u);
        }
Esempio n. 5
0
        public List <Marketer> rechercherTous()
        {
            List <Marketer> us = new List <Marketer>();

            try
            {
                us = db.Marketers.ToList();
            }
            catch (Exception ex)
            {
                Marketer p = new Marketer();
                p.adresse = ex.StackTrace;
                us.Add(p);
            }

            return(us);
        }
Esempio n. 6
0
        public Marketer rechercherUnique(Marketer m)
        {
            Marketer u = new Marketer();

            try
            {
                u = db.Marketers.First(x => x.adresse == m.adresse && x.email == m.email && x.nom == m.nom && x.pays == m.pays && x.telephone == m.telephone && x.ville == m.ville);
            }

            catch (Exception ex)
            {
                u.adresse = ex.StackTrace;
            }


            return(u);
        }
Esempio n. 7
0
        public List <Marketer> rechercherParMC(Func <Marketer, bool> predicate)
        {
            List <Marketer> us = new List <Marketer>();

            try
            {
                us = db.Marketers.Where(predicate).ToList();
            }
            catch (Exception ex)
            {
                Marketer p = new Marketer();
                p.adresse = ex.StackTrace;
                us.Add(p);
            }

            return(us);
        }