Example #1
0
        public TourParole RecupToursParole()
        {
            TourParole tourCurr;
            string     sel              = "select * from toursParole where num_Partie  = " + PA.Numero + " and num_main=" + PA.Numero_Main + " and NomEtape= '" + PA.Etape + "' and num_tour = " + PA.Num_Tour;
            DataSet    dsTours          = maBD.Recuperer(sel);
            DataTable  tableToursParole = dsTours.Tables[0];

            return(new TourParole(tableToursParole.Rows[0]));
        }
Example #2
0
        public ObservableCollection <Joueur> RecupJoueursDunTournoi(int numTourn)
        {
            ObservableCollection <Joueur> LstJoueurs = new ObservableCollection <Joueur>();
            string    sel          = "select j0, j1,j2, j3,j4,j5 from tournois where numero = " + numTourn;
            DataSet   dsJoueurs    = maBD.Recuperer(sel);
            DataTable tableJoueurs = dsJoueurs.Tables[0];

            foreach (DataRow rowJoueur in tableJoueurs.Rows)
            {
                //LstJoueurs.Add(new Joueur(rowJoueur));
            }
            return(LstJoueurs);
        }
        public int RecupUnJoueurPartie(string nom)
        {
            JoueurPartie JP           = new JoueurPartie();
            string       sel          = "select * from joueurPartie where numero_partie = " + 1 + " and Pokerman ='" + nom + "'";
            DataSet      dsJoueurs    = maBD.Recuperer(sel);
            DataTable    tableJoueurs = dsJoueurs.Tables[0];

            foreach (DataRow rowJoueur in tableJoueurs.Rows)
            {
                JP = new JoueurPartie(rowJoueur);
            }
            return(JP.Position);
        }
        public ObservableCollection <Partie> RecupPartiesDunTournoi(int numTourn)
        {
            ObservableCollection <Partie> LstParties = new ObservableCollection <Partie>();
            string    sel          = "select * from Partie where numero_tournoi = " + numTourn;
            DataSet   dsParties    = maBD.Recuperer(sel);
            DataTable tableParties = dsParties.Tables[0];

            foreach (DataRow rowPartie in tableParties.Rows)
            {
                LstParties.Add(new Partie(rowPartie));
            }
            return(LstParties);
        }
        public mainPartie RecupUneMain()
        {
            string    sel        = "select * from Main where num_partie = " + PA.Numero + " and num_main= " + PA.Numero_Main;
            DataSet   dsMains    = maBD.Recuperer(sel);
            DataTable tableMains = dsMains.Tables[0];

            return(new mainPartie(tableMains.Rows[0]));
        }
Example #6
0
        public Membre RecupUnMembre(string n)
        {
            Membre leMembre;

            string    sel          = "select * from membre where nom = '" + n + "'";
            DataSet   dsMembres    = maBD.Recuperer(sel);
            DataTable tableMembres = dsMembres.Tables[0];

            int cmp = tableMembres.Rows.Count;

            if (cmp > 1)
            {
                MessageBox.Show("Alerte il y a " + cmp + " membres " + n);
            }
            leMembre = new Membre(tableMembres.Rows[0]);

            return(leMembre);
        }
        //public void Inserer(Contact con_A_inserer)
        //{
        //    string insertion = "insert into Contact values(null, '" + con_A_inserer.Nom +
        //                                                   "', '" + con_A_inserer.Prenom +
        //                                                   "', '" + con_A_inserer.Adresse +
        //                                                   "', '" + con_A_inserer.Telephone +
        //                                                   "', '" + con_A_inserer.Fonction +
        //                                                   "', '" + con_A_inserer.Societe +
        //                                                   "', '" + con_A_inserer.Courriel + "')";
        //    maBD.Commande(insertion);
        //}

        //public Contact Recuperer(int id)
        //{
        //    string sel = "select * from Contact where id = " + id;
        //    DataSet dsContact = maBD.Recuperer(sel);
        //    DataTable dtContact = dsContact.Tables[0];

        //    return new Contact(dtContact.Rows[0]);
        //}

        public ObservableCollection <Tournoi> RecupTousTournois()
        {
            ObservableCollection <Tournoi> LstTourn = new ObservableCollection <Tournoi>();
            string    sel           = "select * from Tournois";
            DataSet   dsTournois    = maBD.Recuperer(sel);
            DataTable tableTournois = dsTournois.Tables[0];

            foreach (DataRow rowTournoi in tableTournois.Rows)
            {
                LstTourn.Add(new Tournoi(rowTournoi));
            }
            return(LstTourn);
        }
Example #8
0
        /*--------------------------------------------------------------
         * /
         * /---------------------------------------------------------------*/
        public Etape RecupEtapeDuneMain()
        {
            string sel = "select * from etapes where num_Partie  = " + PA.Numero + " and num_main=" + PA.Numero_Main + " and NomEtape= '";

            if (PA.Etape == "POST_RIVER")
            {
                sel += "MAIN_TERMINEE_TRAITEE_OUVERTE' or NomEtape = 'MAIN_TERMINEE_TRAITEE'";
            }
            else
            {
                sel += PA.Etape + "'";
            }
            DataSet   dsEtapes    = maBD.Recuperer(sel);
            DataTable tableEtapes = dsEtapes.Tables[0];

            return(new Etape(tableEtapes.Rows[0]));
        }
        public string RecupHistoriquePartie()
        {
            Historique HistoCurr;

            string    LHistorique      = "";
            string    sel              = "select * from historique where numeroPartie =" + PA.Numero + " order by numero_evenement desc";
            DataSet   dsHistoriques    = maBD.Recuperer(sel);
            DataTable tableHistoriques = dsHistoriques.Tables[0];

            int cmp = tableHistoriques.Rows.Count;

            foreach (DataRow rowHistorique in tableHistoriques.Rows)
            {
                HistoCurr    = new Historique(rowHistorique);
                LHistorique += cmp + ": " + HistoCurr.Description + "\n";
                cmp--;
            }
            return(LHistorique);
        }