public bool InsertRepertoire(Repertoire r)
        {
            try
            {
                if (DataContext == null)
                {
                    throw new Exception("DAL empty");
                }

                DataContext.Repertoire.InsertOnSubmit(r);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool UpdateRepertoire(Repertoire r)
        {
            try
            {
                Repertoire rep = DataContext.Repertoire.Where(p => p.IDUtilisateur == r.IDUtilisateur && p.IDContact == r.IDContact).SingleOrDefault();

                if (rep.Adresse != r.Adresse)
                {
                    rep.Adresse = r.Adresse;
                }
                if (rep.Email != r.Email)
                {
                    rep.Email = r.Email;
                }
                if (rep.Nom != r.Nom)
                {
                    rep.Nom = r.Nom;
                }
                if (rep.NTel != r.NTel)
                {
                    rep.NTel = r.NTel;
                }
                if (rep.Photo != r.Photo)
                {
                    rep.Photo = r.Photo;
                }
                if (rep.Prenom != r.Prenom)
                {
                    rep.Prenom = r.Prenom;
                }
                if (rep.Priorite != r.Priorite)
                {
                    rep.Priorite = r.Priorite;
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
示例#3
0
 private void detach_Repertoire(Repertoire entity)
 {
     this.SendPropertyChanging();
     entity.Utilisateurs = null;
 }
示例#4
0
 partial void DeleteRepertoire(Repertoire instance);
示例#5
0
 partial void UpdateRepertoire(Repertoire instance);
示例#6
0
 partial void InsertRepertoire(Repertoire instance);