Exemple #1
0
        private void cbxNomStand_SelectedIndexChanged(object sender, EventArgs e)
        {
            int    idStand = 0;
            string type    = "";
            string prix    = "";

            if (cbxNomStand.SelectedItem != null && cbxPartenaire.SelectedItem != null)
            {
                Stand      stand      = new Stand(cbxNomStand.SelectedItem.ToString());
                Partenaire partenaire = new Partenaire(cbxPartenaire.SelectedItem.ToString());

                for (int i = 0; i < mesStands.Count; i++)
                {
                    idStand = int.Parse(stand.getIdStand());
                }

                for (int i = 0; i < mesPartenaires.Count; i++)
                {
                    type = partenaire.getTypePartenaire();
                }

                if (type == "équipementier")
                {
                    Equipement equipement = new Equipement(idStand);
                    prix        = equipement.getPrixEquipementier();
                    lbPrix.Text = prix.ToString();
                }
                if (type == "clubOrganisateur")
                {
                    Equipement equipement = new Equipement(idStand);
                    prix        = equipement.getPrixClubOrganisateur();
                    lbPrix.Text = prix.ToString();
                }
            }
        }
Exemple #2
0
        // Crée dans la BDD l'objet CompteBancaire passé en paramètre
        public static void creerStand(Stand unStand)
        {
            string     requete = "INSERT stand (nomStand, numAlle, surface, numOrdre, nombreSiege, nombreTable) VALUES ('" + unStand.unNomStand + "','" + unStand.uneAlle + "','" + unStand.unOrder + "','" + unStand.unSurface + "','" + unStand.unNombreSiege + "','" + unStand.unNombreTable + "')";
            DAOFactory CS      = new DAOFactory();

            CS.connecter();
            CS.execSQLWrite(requete);
        }
Exemple #3
0
        private void remplirListeStand()
        {
            mesStands = Stand.listeStand();
            List <string> lesStands = new List <string>();

            for (int i = 0; i < mesStands.Count; i++)
            {
                lesStands.Add(mesStands.ElementAt(i).unNomStand);
            }

            cbxNomStand.DataSource          = lesStands;
            cbxGestionsNonStands.DataSource = lesStands;
        }
Exemple #4
0
        private void btnCreationStand_Click(object sender, EventArgs e)
        {
            Stand stand;

            int numAlle     = int.Parse(txbNumAlle.Text);
            int numOrdre    = int.Parse(txbNumOrdre.Text);
            int Surface     = int.Parse(txbSurfaceStand.Text);
            int nombreSiege = int.Parse(txbNombreSiege.Text);
            int nombreTable = int.Parse(txbNombreTables.Text);

            stand = new Stand(txbNomStand.Text, numAlle, numOrdre, Surface, nombreSiege, nombreTable);

            stand.ajouterStand();
            remplirListeStand();
        }
Exemple #5
0
        private void cbxGestionsNonStands_SelectedIndexChanged(object sender, EventArgs e)
        {
            string idStand = "";
            Stand  stand   = new Stand(cbxGestionsNonStands.SelectedItem.ToString());
            GestionEquipementStand g;

            for (int i = 0; i < mesStands.Count; i++)
            {
                idStand = stand.getIdStand();
                g       = new GestionEquipementStand(idStand);

                listeGestionEquipement.DataSource = null;
                listeGestionEquipement.DataSource = g.avoirEquipementStand();
            }
        }
Exemple #6
0
        public static string getIdStand(Stand s)
        {
            string     stand = "";
            string     req   = "Select idStand from stand where nomStand = '" + s.unNomStand + "'";
            DAOFactory db    = new DAOFactory();

            db.connecter();

            SqlDataReader reader = db.excecSQLRead(req);

            while (reader.Read())
            {
                stand = reader[0].ToString();
            }
            db.deconnecter();
            return(stand);
        }
Exemple #7
0
        public static List <Stand> getAllStand()
        {
            List <Stand> lesStand = new List <Stand>();
            string       req      = "Select * from stand where idStand not in (select idStand from partenaireStand)";
            DAOFactory   db       = new DAOFactory();

            db.connecter();

            SqlDataReader reader = db.excecSQLRead(req);


            while (reader.Read())
            {
                Stand stand = new Stand(reader[1].ToString(), int.Parse(reader[2].ToString()), int.Parse(reader[3].ToString()), int.Parse(reader[4].ToString()), int.Parse(reader[5].ToString()), int.Parse(reader[6].ToString()));
                lesStand.Add(stand);
            }
            db.deconnecter();
            return(lesStand);
        }
Exemple #8
0
        private void btnValiderGestionStands_Click(object sender, EventArgs e)
        {
            string     idStand      = "";
            string     idEquipement = "";
            Stand      stand        = new Stand(cbxGestionsNonStands.SelectedItem.ToString());
            Equipement equipement   = new Equipement(cbxGestionEquipement.SelectedItem.ToString());

            for (int i = 0; i < mesStands.Count; i++)
            {
                idStand = stand.getIdStand();
            }

            for (int i = 0; i < mesEquipement.Count; i++)
            {
                idEquipement = equipement.getIdEquipement();
            }
            GestionEquipementStand g = new GestionEquipementStand(idEquipement, idStand);

            g.ajouterEquipementstand();
            remplirListeStand();
        }
Exemple #9
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            int    idStand      = 0;
            string idPartenaire = "";
            string type         = "";
            string prix         = "";

            Stand      stand      = new Stand(cbxNomStand.SelectedItem.ToString());
            Partenaire partenaire = new Partenaire(cbxPartenaire.SelectedItem.ToString());

            for (int i = 0; i < mesStands.Count; i++)
            {
                idStand = int.Parse(stand.getIdStand());
            }

            for (int i = 0; i < mesPartenaires.Count; i++)
            {
                idPartenaire = partenaire.getIdPartenaire();
                type         = partenaire.getTypePartenaire();
            }

            if (type == "équipementier")
            {
                Equipement equipement = new Equipement(idStand);
                prix        = equipement.getPrixEquipementier();
                lbPrix.Text = prix.ToString();
            }
            if (type == "clubOrganisateur")
            {
                Equipement equipement = new Equipement(idStand);
                prix        = equipement.getPrixClubOrganisateur();
                lbPrix.Text = prix.ToString();
            }

            PartenaireStand p = new PartenaireStand(idPartenaire, Convert.ToString(idStand), prix);

            p.ajouterPartenaireStand();
        }