예제 #1
0
        static void Main(string[] args)
        {
            using (var db = new ContextBDD())
            {
                var categories = db.Categories.Where(categorie => categorie.Nom.StartsWith("M"));
                foreach (var item in categories)
                {
                    System.Console.WriteLine(item.Nom);
                }

                var chaton = new Chaton()
                {
                    Categorie       = db.Categories.Find(1),
                    Nom             = "Minou",
                    Sterilise       = false,
                    DateDeNaissance = DateTime.Now,
                };

                var henry = new Proprietaire()
                {
                    Nom    = "Bartonnier",
                    Prenom = "Henry"
                };

                db.Chatons.Add(chaton);

                System.Console.ReadKey();
            }
        }
예제 #2
0
 static void Main(string[] args)
 {
     using (var db = new ContextBDD())
     {
         var jeuSouhaite = db.Jeux.Join(db.Reservations
                                     ,j => j.Stock
                                   
     }
 }
예제 #3
0
        static void Main(string[] args)
        {
            using (var db = new ContextBDD())
            {
                var dateNow = DateTime.Now;

                var intervenant = new Intervenant()
                {
                    Matricule = 123456,
                    Nom       = "Guégan",
                    Prenom    = "Eva",
                };

                var vehicule = new Vehicule()
                {
                    Immatriculation = "AB-123-CD",
                    Marque          = "Toyota",
                    Modele          = "azerty",
                    VolumeUtile     = 25,
                };

                var materiel = new Materiel()
                {
                    RefUnique   = 987,
                    Designation = "Tournevis plat",
                    Description = "Tournevis plat bosh ...",
                    DateAchat   = dateNow,
                };

                var intervention = new Intervention()
                {
                    AdresseClient     = "12 rue Saint Exupéry",
                    DebutIntervention = dateNow,
                    FinIntervention   = dateNow,
                };

                intervenant.Interventions.Add(intervention);
                intervenant.Vehicules.Add(vehicule);
                intervenant.Materiels.Add(materiel);

                db.Intervenants.Add(intervenant);
                db.Vehicules.Add(vehicule);
                db.Materiels.Add(materiel);
                db.Interventions.Add(intervention);
                db.SaveChanges();

                Console.WriteLine("Les informations ont bien été inséré dans la base de données");
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            using (var db = new ContextBDD())
            {
                var r1 = from c in db.Jeus
                         join o in db.LienJeuClients on c.IdJeu equals o.IdLienJeuClient
                         join u in db.Clients on o.IdLienJeuClient equals u.IdClient
                         where o.Aquisition = true
                                              select c;

                var r2 = from c in db.Jeus
                         join o in db.LienJeuClients on c.IdJeu equals o.IdLienJeuClient
                         join u in db.Clients on o.IdLienJeuClient equals u.IdClient
                         where o.Echange = true
                                           select c;
            }
        }
예제 #5
0
        static void Main(string[] args)
        {
            using (var db = new ContextBDD())
            {
                var r1 = db.Jeux.Select(o => new { o.Nom, o.Souhait });

                /*foreach (var item in r1)
                 * {
                 *  Console.WriteLine(item.Nom);
                 *  Console.WriteLine(item.Souhait);
                 * }*/

                //var r2 = db.Clients.Select(o => new { o.ClientID, o.Jeux.Nom});

                /*foreach (var item in r2)
                 * {
                 *  Console.WriteLine(item.ClientID);
                 *  Console.WriteLine(item.Nom);
                 * }*/
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            using (var db = new ContextBDD())
            {
                var intervenant = db.Intervenants.First(c => c.Matricule == 1);
                var véhicule    = db.Véhicules.First(c => c.VéhiculeID == 1);
                var tournevis   = db.Matériels.First(c => c.MatérielID == 1);
                var perceuse    = db.Matériels.First(c => c.MatérielID == 2);

                var intervention = new Intervention
                {
                    DateDebut   = DateTime.Now,
                    Intervenant = intervenant,
                    Véhicule    = véhicule,
                };

                intervention.Matériels.Add(tournevis);
                intervention.Matériels.Add(perceuse);

                db.SaveChanges();
            }
        }
예제 #7
0
 public VaccineTypesController(ContextBDD context)
 {
     _context = context;
 }
 public InjectionsController(ContextBDD context)
 {
     _context = context;
 }
예제 #9
0
 public ReminderAlertsController(ContextBDD context)
 {
     _context = context;
 }
예제 #10
0
 public VaccinatedPersonsController(ContextBDD context)
 {
     _context = context;
 }