Exemplo n.º 1
0
 public MainWindow()
 {
     using (var myDB = new DBCommandeContext())
     {
         myDB.Clients.Add(new Client {
             Nom = "Christophe", Telephone = "12345"
         });
         myDB.SaveChanges();
     }
     InitializeComponent();
 }
Exemplo n.º 2
0
        public static List <Client> GetAllClients()
        {
            var c = new List <Client>();

            using (var myDB = new DBCommandeContext())
            {
                var products = myDB.Produits.ToList();
                var orders   = myDB.Orders.ToList();
                c = myDB.Clients.ToList();
            }
            return(c);
        }
Exemplo n.º 3
0
        public static List <Produit> GetAllProduits()
        {
            var p = new List <Produit>();

            using (var myDB = new DBCommandeContext())
            {
                var clients = myDB.Clients.ToList();
                var orders  = myDB.Orders.ToList();
                p = myDB.Produits.ToList();
            }
            return(p);
        }
Exemplo n.º 4
0
        public static List <Order> GetAllOrders()
        {
            var o = new List <Order>();

            using (var myDB = new DBCommandeContext())
            {
                var products = myDB.Produits.ToList();

                var clients = myDB.Clients.ToList();

                o = myDB.Orders.ToList();
            }
            return(o);
        }