Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            mydbal    = new Dbal("club_fromage");
            myPays    = new Pays();
            myDaoPays = new DaoPays(mydbal);

            //myDaoPays.Insert(myPays);
            //myDaoPays.InsertFromCSV("C:\\Users\\SIO2\\source\\repos\\ClubFromageTemplate\\ModelLayer\\import files\\pays.csv");
            //myFromage = new Fromage(2,"Reblochon",default,myPays,default);
            myDaoFromage = new DaoFromage(mydbal, myDaoPays);
            //myDaoFromage.Insert(myFromage);
            myDaoFromage.InsertFromCSV("C:\\Users\\SIO2\\source\\repos\\ClubFromageTemplate\\ModelLayer\\import files\\tableauNomDep.csv");
            //List<Fromage> myFromages = myDaoFromage.SelectAll();
            //foreach (Fromage f in myFromages)
            //{
            //    Console.WriteLine(f.Name);
            //}
            //List <Pays> listPays = myDaoPays.SelectAll();
            //foreach (Pays p in listPays)
            //{
            //    Console.WriteLine(p.Name);
            //}
            //string fromton = "Abondance";
            //Fromage myFromage = myDaoFromage.SelectByName(fromton);
            ////myFromage.Name = "Reblochon";
            ////myDaoFromage.Update(myFromage);
            //Console.WriteLine("L'ID du " + fromton + ": " + myFromage.Id);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            dbal    mydbal = new dbal();
            DaoPays Suisse = new DaoPays(mydbal);

            Suisse.insertfile("D:/SylvainLuiset/SLAM5/Club des fromages/Club des fromages/bin/Debug/netcoreapp3.1/pays.csv", ";");


            //mydbal.Delete("Pays WHERE id = '1'");
            //mydbal.Delete("Fromage WHERE id ='1'");
            //mydbal.Delete("Pays WHERE id='2'");
            //mydbal.ExecQuery("INSERT INTO Pays (id, nom) VALUES (1, 'FRANCE')");
            //mydbal.ExecQuery("INSERT INTO Fromage (id, pays_origine_id, nom, creation, image) VALUES (1, 1, 'Compté', '1843-02-10', 'pasimage')");
            //mydbal.Insert("Pays (id, nom) VALUES (2, 'Angleterre')");
            //mydbal.Update("Fromage SET pays_origine_id = '2' WHERE id ='1'");
            //mydbal.Select("* FROM Pays");
            //mydbal.Count("(*) FROM Pays");
            //mydbal.Delete("Pays WHERE id = '2'");

            ////InsertPays par DAO
            //Pays ar = new Pays(5, "Suisse");
            //Pays ad = new Pays(5, "Jordanie");
            //DaoPays Suisse = new DaoPays(mydbal);
            //Suisse.InsertPays(ar);

            ////UpdatePays par DAO
            //Suisse.UpdatePays(ad);

            ////DeletePays par DAO
            //Suisse.DeletePays(ar);

            ////Utilisation CSV
        }
Exemplo n.º 3
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            thedbal      = new Dbal("dsfootamericain");
            thedaopays   = new DaoPays(thedbal);
            thedaoposte  = new daoPoste(thedbal);
            thedaojoueur = new daoJoueur(thedbal, thedaopays, thedaoposte);
            thedaoequipe = new daoEquipe(thedbal);

            MainWindow wnd = new MainWindow(thedaopays, thedaojoueur, thedaoequipe, thedaoposte);

            wnd.Show();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            mydbal     = new Dbal("dsfootamericain");
            myPoste    = new Poste();
            myDaoPoste = new DaoPoste(mydbal);

            myPays    = new Pays();
            myDaoPays = new DaoPays(mydbal);

            myJoueur    = new Joueur();
            myDaoJoueur = new DaoJoueur(mydbal, myDaoPays, myDaoPoste);

            myEquipe    = new Equipe();
            myDaoEquipe = new DaoEquipe(mydbal, myDaoJoueur);


            List <Poste> listPost = myDaoPoste.SelectAll();

            foreach (Poste f in listPost)
            {
                Console.WriteLine(f.Nom);
            }

            Console.WriteLine("--------------------------");

            List <Joueur> listJoueur = myDaoJoueur.SelectAll();

            foreach (Joueur f in listJoueur)
            {
                Console.WriteLine(f.Nom);
            }


            Console.WriteLine("--------------------------");

            List <Equipe> ListEquipe = myDaoEquipe.SelectAll();

            foreach (Equipe f in ListEquipe)
            {
                Console.WriteLine(f.Nom);
            }

            Console.WriteLine("--------------------------");

            Poste unPoste = myDaoPoste.SelectById(1);

            Console.WriteLine(unPoste.Nom);

            Joueur unJoueur = myDaoJoueur.SelectById(1);

            Console.WriteLine(unJoueur.Nom);
        }
Exemplo n.º 5
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //Instancier DBAL ET DAO ICI
            mydbal       = new Dbal("dsfootamericain");
            theDaoEquipe = new DaoEquipe(mydbal);
            theDaoPays   = new DaoPays(mydbal);
            theDaoPoste  = new DaoPoste(mydbal);
            theDaoJoueur = new DaoJoueur(mydbal, theDaoPays, theDaoPoste, theDaoEquipe);

            MainWindow wnd = new MainWindow(theDaoEquipe, theDaoJoueur, theDaoPays, theDaoPoste);

            wnd.Show();
        }
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            thedbal      = new Dbal("dsfootamericain");
            theDaoPays   = new DaoPays(thedbal);
            theDaoPoste  = new DaoPoste(thedbal);
            theDaoJoueur = new DaoJoueur(thedbal, theDaoPays, theDaoPoste);
            theDaoEquipe = new DaoEquipe(thedbal, theDaoJoueur);
            MainWindow wnd = new MainWindow(theDaoEquipe, theDaoJoueur, theDaoPays, theDaoPoste);

            //et on utilise la méthode Show() de notre objet fenêtre pour afficher la fenêtre
            //exemple: MainWindow lafenetre = new MainWindow(); (et on y passe en paramètre Dbal et Dao au besoin)
            wnd.Show();
        }
Exemplo n.º 7
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //C'est ici, dans la méthode Application_Startup, qu'on instancie nos objets Dbal et Dao

            thedbal       = new Dbal("club_fromage");
            thedaopays    = new DaoPays(thedbal);
            thedaofromage = new DaoFromage(thedbal, thedaopays);

            // Create the startup window
            //là, on lance la fenêtre souhaitée en instanciant la classe de notre fenêtre
            GestionFromages wnd = new GestionFromages(thedaopays, thedaofromage);

            //et on utilise la méthode Show() de notre objet fenêtre pour afficher la fenêtre
            //exemple: MainWindow lafenetre = new MainWindow(); (et on y passe en paramètre Dbal et Dao au besoin)
            wnd.Show();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            mydbal    = new Dbal("clubfromage");
            myPays    = new Pays();
            myDaoPays = new DaoPays(mydbal);

            //myDaoPays.Insert(myPays);
            //myDaoPays.InsertFromCSV("C:\\Users\\ÉtienneBuffet\\Source\\Repos\\ClubFromage\\coucheModel\\pays.csv");
            //myFromage = new Fromage(2,"Reblochon",default,myPays,default);
            myDaoFromage = new DaoFromage(mydbal, myDaoPays);
            //myDaoPays.InsertFromCSV("D:\\Project Antoine Girard\\SLAM5\\ClubFromageFinal\\ModelLayer\\import files\\pays.csv");
            myDaoFromage.InsertFromCSV("D:\\Project Antoine Girard\\SLAM5\\ClubFromageFinal\\ModelLayer\\import files\\tableauNomDep.csv");

            //myDaoFromage.Insert(myFromage);
            //myDaoFromage.InsertFromCSV("C:\\Users\\ÉtienneBuffet\\Source\\Repos\\ClubFromage\\coucheModel\\tableauNomDep.csv");
            //List<Fromage> myFromages = myDaoFromage.SelectAll();
            //foreach (Fromage f in myFromages)
            //{
            //    Console.WriteLine(f.Name);
            //}

            /* List <Pays> listPays = myDaoPays.SelectAll();
             * foreach (Pays p in listPays)
             * {
             *   Console.WriteLine(p.Name);
             * }
             * //string fromton = "Abondance";
             * //Fromage myFromage = myDaoFromage.SelectByName(fromton);
             * ////myFromage.Name = "Reblochon";
             * ////myDaoFromage.Update(myFromage);
             * //Console.WriteLine("L'ID du " + fromton + ": " + myFromage.Id);
             *
             */
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            dbal NewDBal = new dbal();
            //Pays pays1 = new Pays(1, "france");
            DaoPays DaoPays1 = new DaoPays(NewDBal);
            //DaoPays1.delete(pays1);

            //DaoPays1.insert(pays1);
            //DaoPays1.update(pays1);
            //Fromage Fromage1 = new Fromage(1, 1, "Camenbert", 12, "cc");
            DaoFromage DaoFromage1 = new DaoFromage(NewDBal);

            //DaoFromage1.delete(Fromage1);

            //DaoFromage1.update(Fromage1);
            Console.WriteLine("test");
            //DaoPays1.update(pays1);
            //DaoPays1.update(pays1);

            //DaoPays1.insertfil();

            //Console.WriteLine("fin program");

            DataSet lespays = NewDBal.RQuery("select * from pays");

            /*
             * foreach (DataRow r in lespays.Tables[0].Rows)
             * {
             * Console.WriteLine(r["nom"]);
             *
             * }
             *
             * //selectALL
             * foreach (DataRow r in NewDBal.SelectAll("Pays").Rows)
             * {
             *  Console.WriteLine(r["id"] + "    " + r["nom"]);
             * }
             *
             * Console.WriteLine("SelectByFIeld :");
             *
             * //SelectByFIeld
             * foreach (DataRow r in NewDBal.SelectByField("pays", " nom like 'P%'").Rows)
             * {
             *  Console.WriteLine(r["id"] + "    " + r["nom"]);
             * }
             *
             * Console.WriteLine("SelectByld :");
             * DataRow id1 = NewDBal.SelectByld("pays", 1);
             * Console.WriteLine(id1["id"] + "    " + id1["nom"]);
             *
             */


            /*DaoPays1.selectAll();*/


            /*DaoPays1.SelectByName("France");
             *
             * DaoPays1.SelectById(50);*/
            //DaoFromage1.insertfil();
            DaoFromage1.selecAll();
        }
 public GestionFromages(DaoPays thedaopays, DaoFromage thedaofromage)
 {
     InitializeComponent();
     //on associe la grid principal mainGrid du XAML en initialisant son DataContext avec un objet viewModelFromage
     mainGrid.DataContext = new viewModel.viewModelFromage(thedaopays, thedaofromage);
 }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            DBAL MaBDD = new DBAL();//nouvel instance DBAL

            Console.WriteLine("Bonjour !");
            DaoPays    daoP = new DaoPays(MaBDD); // nouvel instance dao avec un DBAL
            DaoFromage daoF = new DaoFromage(MaBDD, daoP);

            //daoP.InsertFromCSV("D:\\SylvainLuiset\\ClubFromage_APP\\ModelLayer\\File\\pays.csv");
            daoF.InsertFromCSV("D:\\SylvainLuiset\\ClubFromage_APP\\ModelLayer\\File\\fromages.csv");
            // daoF.MainCSV();

            //------------------------------------------------------------
            //selectbyID dao fromage
            //Console.WriteLine(daoF.SelectByID(1).Nom);
            //-----------------------------------------------------------
            //SelectByName dao fromage
            //Console.WriteLine(daoF.SelectByName("fromage de chèvre").Id);
            //-----------------------------------------------------------
            //list Fromage selectALl
            daoF.SelectAll();
            foreach (Fromage item in daoF.SelectAll())
            {
                Console.WriteLine(item.Nom);
            }
            //----------------------------------------------------
            //selectByID
            //Console.WriteLine(daoP.selectByID(110).Nom);
            //---------------------------------------------------------------------------
            //selectbyname
            //Console.WriteLine(daoP.selectByName("vietnam").Nom);
            //-----------------------------------------------------------------------
            //list Pays selectALL
            //foreach (Pays unpays in daoP.SelectAll())
            //{
            // Console.WriteLine(unpays.Nom);
            //}

            //Datarow SelectbyID
            // DataRow DataR = MaBDD.SelectByID("pays", 165);
            //  Console.WriteLine(DataR["nom"]);

            //--------------------------------------------------------------------------
            //DataTable Selectbyfield
            //foreach (DataRow dataR in MaBDD.SelectByField("pays", "id = 10").Rows)
            //{
            //    Console.WriteLine(dataR["nom"] + " " + dataR["id"]);
            //}
            //--------------------------------------------------------------------------
            //DataTable selectAll
            //foreach  (DataRow dataR in MaBDD.SelectALL("pays").Rows)
            //{
            //    Console.WriteLine(dataR["nom"]+" "+ dataR["id"]);
            //}
            //--------------------------------------------------------------------------
            //DataSet RQUERY
            //DataSet dataS = MaBDD.RQuery("Select * from pays ;"); //instancie un objet dataset (bdd) grace a ma MaBDD.query
            //foreach (DataRow Undata in dataS.Tables[0].Rows)
            //{
            //    //pour un objet datarow qui sera dans Undata dans la tables dataS a chaque ligne

            //        Console.WriteLine(Undata["id"]+ " "+ Undata["nom"]);



            //}



            //daoP.MainCSV();


            // Pays p3 = new Pays(3,"Chine");
            // Fromage fromage1 = new Fromage(1, p3, "tome", "2010-03-19", "ttt");

            //daoF.Insert(fromage1);

            //daoP.Insert(p3);
            //daoP.Update(p3);
            //daoP.Delete(p3);

            Console.WriteLine("------- FIN -------");
        }
 public MainWindow(DaoEquipe thedaoEquipe, DaoJoueur theDaoJoueur, DaoPays theDaoPays, DaoPoste theDaoPoste)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.ViewModelJoueur(thedaoEquipe, theDaoJoueur, theDaoPays, theDaoPoste);
 }
Exemplo n.º 13
0
 public MainWindow(DaoPays unDaoPays, daoJoueur unDaoJoueur, daoEquipe unDaoEquipe, daoPoste unDaoPoste)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.viewModelFoot(unDaoPays, unDaoEquipe, unDaoJoueur, unDaoPoste);
 }