コード例 #1
0
        public viewModelEquipe(DaoEquipe thedaoequipe, DaoJoueur thedaojoueur, DAOPays thedaopays, DaoPoste thedaoposte)
        {
            vmDaoPays   = thedaopays;
            vmDaoJoueur = thedaojoueur;
            vmDaoPoste  = thedaoposte;
            vmDaoEquipe = thedaoequipe;

            listEquipe = new ObservableCollection <Equipe>(thedaoequipe.SelectAll());
            listJoueur = new ObservableCollection <Joueur>(thedaojoueur.SelectAll());
            listPays   = new ObservableCollection <Pays>(thedaopays.SelectAll());
            listPoste  = new ObservableCollection <Poste>(thedaoposte.SelectAll());

            foreach (Joueur J in ListJoueur)
            {
                int i = 0;
                while (J.Id != listPays[i].Id)
                {
                    i++;
                }
                J.LePays = listPays[i];
            }
            foreach (Joueur J in ListJoueur)
            {
                int i = 0;
                while (J.Id != listPays[i].Id)
                {
                    i++;
                }
                J.LePoste = listPoste[i];
            }
        }
コード例 #2
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);
        }
コード例 #3
0
        public MainWindow(DaoFacture daoFacture, DaoClient daoClient, DaoSite daosite, DaoSalle daosalle, DaoPartie daopartie, DaoHoraire daohoraire, DaoObstacle daoobstacle, DaoJoueur daojoeueur)
        {
            thedaoFacture  = daoFacture;
            thedaoClient   = daoClient;
            thedaoSite     = daosite;
            thedaoSalle    = daosalle;
            thedaoHoraire  = daohoraire;
            thedaoPartie   = daopartie;
            thedaoObstacle = daoobstacle;
            thedaoJoueur   = daojoeueur;

            InitializeComponent();
        }
コード例 #4
0
 public Planning(DaoFacture daoFacture, DaoClient daoClient, DaoSite daosite, DaoSalle daosalle, DaoPartie daopartie, DaoHoraire daohoraire, DaoObstacle daoobstacle, DaoJoueur daojoeueur)
 {
     thedaoFacture  = daoFacture;
     thedaoClient   = daoClient;
     thedaoSite     = daosite;
     thedaoSalle    = daosalle;
     thedaoHoraire  = daohoraire;
     thedaoPartie   = daopartie;
     thedaoObstacle = daoobstacle;
     thedaoJoueur   = daojoeueur;
     InitializeComponent();
     MainGrid.DataContext = new viewModel.viewModelPlanning(daoFacture, daoClient, daosite, daosalle, daopartie, daohoraire, daoobstacle, daojoeueur, this);
 }
コード例 #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();
        }
コード例 #6
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, 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();
        }
コード例 #7
0
 public Création_de_partie(DaoFacture daofacture, DaoClient daoclient, DaoSite daosite, DaoSalle daosalle, DaoPartie daopartie, DaoHoraire daohoraire,
                           DaoObstacle daoobstacle, DaoJoueur daojoueur, Partie partie, Client client)
 {
     InitializeComponent();
     thedaoFacture        = daofacture;
     thedaoClient         = daoclient;
     thedaoSite           = daosite;
     thedaoSalle          = daosalle;
     thedaoHoraire        = daohoraire;
     thedaoPartie         = daopartie;
     thedaoObstacle       = daoobstacle;
     thedaoJoueur         = daojoueur;
     _partie              = partie;
     _client              = client;
     MainGrid.DataContext = new viewModelPartie(daofacture, daoclient, daohoraire, daosite, daosalle, daopartie, daoobstacle, daojoueur, partie, client, this);
 }
コード例 #8
0
ファイル: App.xaml.cs プロジェクト: SIO2-PPE/EGCManager
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Dbal        dbal        = new Dbal("ppe3_mmd", "localhost", "root", "5MichelAnnecy");
            DaoFacture  daoFacture  = new DaoFacture(dbal);
            DaoClient   daoClient   = new DaoClient(dbal);
            DaoSite     daoSite     = new DaoSite(dbal);
            DaoSalle    daoSalle    = new DaoSalle(dbal);
            DaoPartie   daoPartie   = new DaoPartie(dbal);
            DaoHoraire  daoHoraire  = new DaoHoraire(dbal);
            DaoObstacle daoObstacle = new DaoObstacle(dbal);
            DaoJoueur   daoJoueur   = new DaoJoueur(dbal);


            MainWindow Wnd = new MainWindow(daoFacture, daoClient, daoSite, daoSalle, daoPartie, daoHoraire, daoObstacle, daoJoueur);

            Wnd.Show();
        }
コード例 #9
0
ファイル: App.xaml.cs プロジェクト: hugoCOMBET/FootAmericain
        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);
            thedaoequipe = new DaoEquipe(thedbal);
            thedaoposte  = new DaoPoste(thedbal);
            thedaojoueur = new DaoJoueur(thedbal, thedaopays, thedaoposte, thedaoequipe);

            // 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();
        }
コード例 #10
0
ファイル: viewModelPlanning.cs プロジェクト: Mael-Ch/PPE3
        public viewModelPlanning(DaoFacture daoFacture, DaoClient daoClient, DaoSite daoSite, DaoSalle daoSalle, DaoPartie daoPartie, DaoHoraire daoHoraire,
                                 DaoObstacle daoObstacle, DaoJoueur daoJoueur, Planning planning)
        {
            _wnd = planning;

            _daoFacture  = daoFacture;
            _daoClient   = daoClient;
            _daoHoraire  = daoHoraire;
            _daoPartie   = daoPartie;
            _daoSalle    = daoSalle;
            _daoSite     = daoSite;
            _daoObstacle = daoObstacle;
            _daoJoueur   = daoJoueur;

            _listPlanning      = new ObservableCollection <Partie>();
            _listSalles        = new ObservableCollection <Salle>();
            ListSites          = new ObservableCollection <Site>(_daoSite.GetAllSite());
            _listClient        = new ObservableCollection <Client>(daoClient.GetAllClient());
            DatePlanning       = DateTime.Now;
            researchTextClient = "";
        }
コード例 #11
0
        static void Main(string[] args)
        {
            mondbal     = new Dbal("dsfootamericain");
            myDaoPays   = new DAOPays(mondbal);
            myDaoPoste  = new DaoPoste(mondbal);
            myDaoJoueur = new DaoJoueur(mondbal, myDaoPays, myDaoPoste, myDaoEquipe);

            #region testPays
            //afficher liste pays
            List <Pays> listPays = myDaoPays.SelectAll();
            foreach (Pays p in listPays)
            {
                Console.WriteLine(p.Nom);
            }

            //afficher nom pays par id

            //Pays myPays = myDaoPays.SelectById(1);
            //Console.WriteLine(myPays.Nom);

            //afficher nom pays par nom

            //Pays myPays = myDaoPays.SelectByName("France");
            //Console.WriteLine(myPays.Nom);

            //insert pays
            //Pays myPays = new Pays(4, "Allemagne");
            //myDaoPays.Insert(myPays);
            #endregion

            #region testJoueur
            List <Joueur> listeJoueur = myDaoJoueur.SelectAll();
            foreach (Joueur j in listeJoueur)
            {
                Console.WriteLine(j.Nom);
            }
            #endregion
        }
コード例 #12
0
        public viewModelPartie(DaoFacture daoFacture, DaoClient daoClient, DaoHoraire daoHoraire, DaoSite daoSite, DaoSalle daoSalle, DaoPartie daoPartie,
                               DaoObstacle daoObstacle, DaoJoueur daoJoueur, Partie activePartie, Client activeclient, Création_de_partie création_De_Partie)
        {
            _wnd = création_De_Partie;

            _daoFacture   = daoFacture;
            _daoClient    = daoClient;
            _daoHoraire   = daoHoraire;
            _daoSite      = daoSite;
            _daoSalle     = daoSalle;
            _daoPartie    = daoPartie;
            _daoObstacle  = daoObstacle;
            _daoJoueur    = daoJoueur;
            _activePartie = activePartie;
            _activeclient = activeclient;

            _listJoueur         = new ObservableCollection <Joueur>(daoJoueur.GetAllJoueur());
            _listObstacle       = new ObservableCollection <Obstacle>(daoObstacle.GetAllObstacle());
            _listJoueurPartie   = new ObservableCollection <Joueur>();
            _listObstaclePartie = new ObservableCollection <Obstacle>();
            researchText        = "";
            pseudoJoueur        = "";
            emailJoueur         = "";
        }
コード例 #13
0
 public MainWindow(DaoEquipe ledaoequipe, DaoJoueur ledaojoueur, DAOPays ledaopays, DaoPoste ledaoposte)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.viewModelEquipe(ledaoequipe, ledaojoueur, ledaopays, ledaoposte);
 }
コード例 #14
0
ファイル: Program.cs プロジェクト: SIO2-PPE/EGCManager
        static void Hydrate(DateTime debut, DateTime fin)
        {
            Dbal dbal = new Dbal("ppe3_mmd");

            dbal.DBinit();
            dbal.DBhydrate();
            DaoClient   daoClient   = new DaoClient(dbal);
            DaoSalle    daoSalle    = new DaoSalle(dbal);
            DaoHoraire  daoHoraire  = new DaoHoraire(dbal);
            DaoJoueur   daoJoueur   = new DaoJoueur(dbal);
            DaoPartie   daoPartie   = new DaoPartie(dbal);
            DaoObstacle daoObstacle = new DaoObstacle(dbal);
            DaoAvis     daoAvis     = new DaoAvis(dbal);

            var randNb        = new Random();
            var randFirstName = RandomizerFactory.GetRandomizer(new FieldOptionsFirstName());
            var randLastName  = RandomizerFactory.GetRandomizer(new FieldOptionsLastName());
            var randNaissance = RandomizerFactory.GetRandomizer(new FieldOptionsDateTime
            {
                From = new DateTime(1970, 1, 1), To = DateTime.Today.AddYears(-18), IncludeTime = false
            });
            var randComm = RandomizerFactory.GetRandomizer(new FieldOptionsTextLipsum());

            for (int i = 0; i < 100; i++)
            {
                string nom = randFirstName.Generate();
                daoClient.NouveauClient(new Client(randLastName.Generate(), nom, randNaissance.Generate().Value,
                                                   nom + "@gmail.com", "0600000000", "une adresse", 100));
            }

            for (DateTime j = debut; j < fin; j = j.AddDays(1))
            {
                foreach (Salle salle in daoSalle.GetAll())
                {
                    foreach (Horaire horaire in daoHoraire.GetHorairesForSite(salle.Site))
                    {
                        if (randNb.Next(4) != 0) // 75 %
                        {
                            Partie partie   = new Partie(salle, horaire, j);
                            int    nbJoueur = randNb.Next(2, 8);
                            for (int i = 0; i < nbJoueur; i++)
                            {
                                string name   = randFirstName.Generate();
                                Joueur joueur = new Joueur(name, name + "@gmail.com");
                                daoJoueur.AddJoueur(ref joueur);
                                partie.LstJoueur.Add(joueur);

                                if (randNb.Next(2) != 0) // 50 %
                                {
                                    daoAvis.Add(joueur, j, randComm.Generate());
                                }
                            }
                            // int nbObstacle = randNb.Next(6, 13);
                            // for (int i = 0; i < nbObstacle; i++)
                            // {
                            //
                            // }
                            partie.LstObstacle = daoObstacle.GetAllObstacle(); // temporaire (rajouter des obstacle dans la bdd
                            daoPartie.NouvellePartie(partie);
                        }
                    }
                }
            }
        }
コード例 #15
0
 public MainWindow(DaoEquipe thedaoEquipe, DaoJoueur theDaoJoueur, DaoPays theDaoPays, DaoPoste theDaoPoste)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.ViewModelJoueur(thedaoEquipe, theDaoJoueur, theDaoPays, theDaoPoste);
 }