Esempio n. 1
0
        static void Main(string[] args)
        {
            DBAL     MaBDD = new DBAL();//nouvel instance DBAL
            daoPays  daoPA = new daoPays(MaBDD);
            daoPoste daoPO = new daoPoste(MaBDD);

            Console.WriteLine("Bonjour !");


            //Joueur
            daoJoueur daoJ = new daoJoueur(MaBDD, daoPA, daoPO);

            daoJ.SelectAll();
            foreach (Joueur item in daoJ.SelectAll())
            {
                Console.WriteLine(item.Id + " " + item.Nom);
            }

            //Equipe

            /*daoEquipe daoE = new daoEquipe(MaBDD);
             *
             * daoE.SelectAll();
             * foreach (Equipe item in daoE.SelectAll())
             * {
             *  Console.WriteLine(item.Id+ " " + item.Nom);
             * }*/
        }
Esempio n. 2
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("dsfootamericain");

            thedaopays   = new daoPays(thedbal);
            thedaoposte  = new daoPoste(thedbal);
            thedaojoueur = new daoJoueur(thedbal, thedaopays, thedaoposte);
            thedaoequipe = new daoEquipe(thedbal);

            // Create the startup window

            //là, on lance la fenêtre souhaitée en instanciant la classe de notre fenêtre
            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();
        }
Esempio n. 3
0
 public daoFromage(DBAL unDBAL, daoPays unDaoPays)
 {
     _DBAL    = unDBAL;
     _daoPays = unDaoPays;
 }
 public MainWindow(daoEquipe thedaoequipe, daoJoueur thedaojoueur, daoPays thedaopays, daoPoste thedaoposte)
 {
     InitializeComponent();
     Globale.DataContext = new ClubfootApp.viewModel.viewModelJoueur(thedaoequipe, thedaojoueur, thedaopays, thedaoposte);
 }
Esempio n. 5
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);

            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 -------");
        }