示例#1
0
        public static void Main(string[] args)
        {
            Bibliotheque bib1 = new Bibliotheque()
            {
                BibliothequeCode = 1,
                NbrDocument      = 9
            };

            IBibliothequeService Bs = new Bibliothequeservice();

            Bs.Add(bib1);
            Bs.Commit();
            Bs.GetnombreBibliotheque();

            Livre lv = new Livre()
            {
                BibliothequeFK = 1,
                NbrDePage      = 9
            };

            ILivreService lvs = new LivreService();

            lvs.Add(lv);
            lvs.GetAll();
            lvs.Commit();



            //BibContext Ctx = new BibContext();
            //Ctx.Bibliotheques.Add(bib1);
            //Ctx.SaveChanges();
            //System.Console.ReadKey();
            //System.Console.WriteLine("OK");
        }
        public ActionResult Search(string recherche)
        {
            var AS = new AdherentService();

            ViewData["id"] = AS.GetUserById((int)Session["UserId"]).Login;
            var LS = new LivreService();


            return(View("list", LS.ChercherLivre(recherche)));
        }