示例#1
0
文件: Dal.cs 项目: guard2205/eBibli
        public int AjouteurAuteur(string nom, string prenom)
        {
            Auteur AuteurAdd = bdd.Auteurs.Add(new Auteur {
                Nom = nom, Prenom = prenom
            });

            bdd.SaveChanges();
            return(AuteurAdd.IdAuteur);
        }
示例#2
0
文件: Dal.cs 项目: guard2205/eBibli
        //Livre
        public int AjouterLivre(string titre, DateTime dateParution, Auteur auteur)
        {
            Livre LivreAdd = bdd.Livres.Add(new Livre {
                Titre = titre, DateParution = dateParution, Auteur = auteur
            });

            bdd.SaveChanges();
            return(LivreAdd.IdLivre);
        }
示例#3
0
文件: Dal.cs 项目: guard2205/eBibli
        public void ModifierAuteur(int id, string nom, string prenom)
        {
            Auteur auteurTrouve = bdd.Auteurs.FirstOrDefault(auteur => auteur.IdAuteur == id);

            if (auteurTrouve != null)
            {
                auteurTrouve.Nom    = nom;
                auteurTrouve.Prenom = prenom;
                bdd.SaveChanges();
            }
        }
示例#4
0
文件: Dal.cs 项目: guard2205/eBibli
        public bool AuteurExiste(int idAuteur)
        {
            Auteur auteurTrouve = bdd.Auteurs.FirstOrDefault(auteur => auteur.IdAuteur == idAuteur);

            if (auteurTrouve != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#5
0
文件: Dal.cs 项目: guard2205/eBibli
        public bool AuteurExiste(string nom)
        {
            Auteur auteurTrouve = bdd.Auteurs.FirstOrDefault(auteur => auteur.Nom == nom);

            if (auteurTrouve != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#6
0
文件: Dal.cs 项目: guard2205/eBibli
        public Auteur ObtenirAuteur(int id)
        {
            Auteur auteurTrouve = bdd.Auteurs.FirstOrDefault(auteur => auteur.IdAuteur == id);

            return(auteurTrouve);
        }