Esempio n. 1
0
        private void Suivant_Click(object sender, EventArgs e)
        {
            try
            {
                if (listePoint.Count <= 2)
                {
                    throw new Exception("points insuffisants");
                }
                if (NomStade.Text.CompareTo("") == 0)
                {
                    throw new Exception("Ajoutez un nom au stade !");
                }
                // IGENERER-NA ID ILAY STADE
                Fonction  F        = new Fonction();
                DBConnect dbc      = new DBConnect();
                int       idStadee = F.getId(dbc, "stade");
                string    idStade  = "STADE" + idStadee;
                Stade     stade    = new Stade(idStade, NomStade.Text, 0, Fonction.convertString(listePoint.ToArray <Point>()));
                //   ETO N MI-INSERER ANLE STADE
                F.insertStade(dbc, stade);



                CreateZone cz = new CreateZone();
                cz.Stade = stade;
                cz.Show();
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        public AfficherStade()
        {
            InitializeComponent();
            panel1.BackColor = Color.White;
            //mtest ny database kely loa
            DBConnect dbc             = new DBConnect();
            Fonction  F               = new Fonction();
            int       nbSiegeactuelle = F.getId(dbc, "Siege");

            textBox1.Text = "" + nbSiegeactuelle;
        }
Esempio n. 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                //recuperation inputs formulaire

                if (NomZone.Text.CompareTo("") == 0 || comboBox1.Text.CompareTo("") == 0)
                {
                    throw new Exception("Completez tous les champs");
                }
                if (!Fonction.IsNumeric(textBox1.Text))
                {
                    throw new Exception("le numero de siege de depart doit etre un nombre");
                }
                if (!Fonction.IsNumeric(prixSiege.Text))
                {
                    throw new Exception("le prix de la siege doit etre un nombre");
                }
                string coord = Fonction.convertString(ListePointZone.ToArray <Point>());



                //Récuperer-na ny id anle stade misy anle zone
                String idStade = Stade.Id;
                // Tsy atao sequence ny id anle zone
                Fonction  f       = new Fonction();
                DBConnect dbc     = new DBConnect();
                int       idZonee = f.getId(dbc, "zone");
                string    idZone  = "Z" + idZonee;
                Zone      temp    = new Zone(idZone, NomZone.Text, comboBox1.Text, idStade, 0, coord, (Double)numericUpDown2.Value, (Double)numericUpDown1.Value, (Double)tailleSiege.Value, Int32.Parse(textBox1.Text), Double.Parse(prixSiege.Text));
                //ETO NO INSERER-NA NY ZONE
                f.insertZone(dbc, temp);


                string[] colorSelected = { comboBox1.Text };
                comboBox1.Text = "";
                comboBox1.Items.Clear();
                colors = Fonction.getColorNoSelected(colors, colorSelected);
                foreach (string c in colors)
                {
                    comboBox1.Items.Add(c);
                }
                Zone.Add(temp);
                NomZone.Text = "";
                Stade.Zone   = Zone.ToArray <Zone>();
                ListePointZone.Clear();
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }