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]; } }
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); }
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(); }
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(); }
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 }
public MainWindow(DaoEquipe ledaoequipe, DaoJoueur ledaojoueur, DAOPays ledaopays, DaoPoste ledaoposte) { InitializeComponent(); Globale.DataContext = new viewModel.viewModelEquipe(ledaoequipe, ledaojoueur, ledaopays, ledaoposte); }
public MainWindow(DaoEquipe thedaoEquipe, DaoJoueur theDaoJoueur, DaoPays theDaoPays, DaoPoste theDaoPoste) { InitializeComponent(); Globale.DataContext = new viewModel.ViewModelJoueur(thedaoEquipe, theDaoJoueur, theDaoPays, theDaoPoste); }