Exemple #1
0
        private void NomEntComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            CourseComboBox.Items.Clear();
            int    hip       = 0;
            string hipSelect = HippodromeComboBox.Text;
            List <PPEV2BO.Hippodrome> listeHippodrome = new List <PPEV2BO.Hippodrome>();

            listeHippodrome = GestionHippodrome.GetHippodrome();
            foreach (PPEV2BO.Hippodrome Hip in listeHippodrome)
            {
                if (Hip.Nom == hipSelect)
                {
                    hip = Hip.Id;
                }
            }


            List <PPEV2BO.Course> listeCou = new List <PPEV2BO.Course>();

            listeCou = GestionCourses.GetCourseDunHip(hip);

            foreach (PPEV2BO.Course Cou in listeCou)
            {
                CourseComboBox.Items.Add(Cou.Nom);
                CourseComboBox.MaxDropDownItems = listeCou.Count();
            }
        }
Exemple #2
0
        public listeResultats()
        {
            InitializeComponent();
            List <PPEV2BO.Hippodrome> listeHippodrome = new List <PPEV2BO.Hippodrome>();

            listeHippodrome            = GestionHippodrome.GetHippodrome();
            comboBoxHipp.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBoxch1.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxch2.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxch3.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxch4.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxch5.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxCou.DropDownStyle  = ComboBoxStyle.DropDownList;
            foreach (PPEV2BO.Hippodrome Hip in listeHippodrome)
            {
                comboBoxHipp.Items.Add(Hip.Nom);
                comboBoxHipp.MaxDropDownItems = listeHippodrome.Count();
            }
            // empecher la modification du datagridview
            dataGridViewResultat.ReadOnly = true;
        }
        public listeCourses()
        {
            InitializeComponent();
            // Création de la liste course
            List <PPEV2BO.Course> uneListe = new List <PPEV2BO.Course>();

            uneListe = GestionCourses.GetCourses();

            HippodromeComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

            // on définit le dataGridView comme étant une liste
            dataGridView1.DataSource = uneListe;


            this.dataGridView1.Columns[0].Visible  = false;
            this.dataGridView1.Columns[3].Visible  = false;
            this.dataGridView1.Columns[4].Visible  = false;
            this.dataGridView1.Columns[5].Visible  = false;
            this.dataGridView1.Columns[6].Visible  = false;
            this.dataGridView1.Columns[7].Visible  = false;
            this.dataGridView1.Columns[8].Visible  = false;
            this.dataGridView1.Columns[9].Visible  = false;
            this.dataGridView1.Columns[10].Visible = false;
            this.dataGridView1.Columns[11].Visible = false;
            this.dataGridView1.Columns[12].Visible = false;
            this.dataGridView1.Columns[13].Visible = false;

            List <PPEV2BO.Hippodrome> listeHip = new List <PPEV2BO.Hippodrome>();

            listeHip = GestionHippodrome.GetHippodrome();
            foreach (PPEV2BO.Hippodrome Hip in listeHip)
            {
                HippodromeComboBox.Items.Add(Hip.Nom);
                HippodromeComboBox.MaxDropDownItems = listeHip.Count();
            }
            // empecher la modification du datagridview
            dataGridView1.ReadOnly = true;
        }
Exemple #4
0
        public gestioncourses()
        {
            InitializeComponent();

            HippodromeComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            CourseComboBox.DropDownStyle     = ComboBoxStyle.DropDownList;
            comboBox1.DropDownStyle          = ComboBoxStyle.DropDownList;
            comboBox2.DropDownStyle          = ComboBoxStyle.DropDownList;

            List <PPEV2BO.Hippodrome> listeHip = new List <PPEV2BO.Hippodrome>();

            listeHip = GestionHippodrome.GetHippodrome();
            foreach (PPEV2BO.Hippodrome Hip in listeHip)
            {
                HippodromeComboBox.Items.Add(Hip.Nom);
                HippodromeComboBox.MaxDropDownItems = listeHip.Count();
            }

            List <PPEV2BO.Cheval> uneListeDeChevaux = new List <PPEV2BO.Cheval>();

            uneListeDeChevaux = GestionChevaux.GetChevaux();
            foreach (PPEV2BO.Cheval Che in uneListeDeChevaux)
            {
                comboBox1.Items.Add(Che.Nom);
                comboBox1.MaxDropDownItems = uneListeDeChevaux.Count();
            }

            List <PPEV2BO.Jockey> uneListeJockey = new List <PPEV2BO.Jockey>();

            uneListeJockey = GestionJockeys.GetJockeys();
            foreach (PPEV2BO.Jockey Jck in uneListeJockey)
            {
                comboBox2.Items.Add(Jck.Nom);
                comboBox2.MaxDropDownItems = uneListeJockey.Count();
            }
            dataGridView1.ReadOnly = true;
        }
        private void btnajout_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("êtes vous sur de vouloir ajouter la course selectionné ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                int idSelected = 0;
                idSelected = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value);

                string sexe = "X";

                if (HOMMEradio.Checked == true)
                {
                    sexe = "M";
                }
                else if (FEMMERadio.Checked == true)
                {
                    sexe = "F";
                }
                else if (radioButton1.Checked == true)
                {
                    sexe = "X";
                }

                int NbrChevauxMax = 0;
                Int32.TryParse(NbrChevauxMaxListBox.Text, out NbrChevauxMax);
                int AllocationComp = 0;
                Int32.TryParse(AllocationLabel.Text, out AllocationComp);
                int CrsFirst = 0;
                Int32.TryParse(textBox2.Text, out CrsFirst);
                int CrsSecond = 0;
                Int32.TryParse(textBox3.Text, out CrsSecond);
                int CrsThird = 0;
                Int32.TryParse(textBox4.Text, out CrsThird);
                int CrsFourth = 0;
                Int32.TryParse(textBox5.Text, out CrsFourth);
                int CrsFifth = 0;
                Int32.TryParse(textBox6.Text, out CrsFifth);
                int AgeMin = 0;
                Int32.TryParse(AGEMINTextBox.Text, out AgeMin);
                int AgeMax = 0;
                Int32.TryParse(AGEMAXtextboc.Text, out AgeMax);
                string uneDate = monthCalendar1.SelectionRange.Start.ToShortDateString();

                int totalPrix = 0;
                totalPrix = CrsFirst + CrsSecond + CrsThird + CrsFourth + CrsFifth;


                // CHOPER ID DE HIPPODROME DEPUIS COURSE
                int    hip       = 0;
                string hipSelect = HippodromeComboBox.Text;
                List <PPEV2BO.Hippodrome> listeHippodrome = new List <PPEV2BO.Hippodrome>();
                listeHippodrome = GestionHippodrome.GetHippodrome();
                foreach (PPEV2BO.Hippodrome Hip in listeHippodrome)
                {
                    if (Hip.Nom == hipSelect)
                    {
                        hip = Hip.Id;
                    }
                }


                GestionCourses.CreerCourse(NOMTextBox.Text, HippodromeComboBox.Text, NbrChevauxMax, totalPrix, CrsFirst, CrsSecond, CrsThird, CrsFourth, CrsFifth, hip, AgeMin, AgeMax, sexe, uneDate);
                MessageBox.Show("La Course" + NOMTextBox.Text + " a bien été crée", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dataGridView1.Update();
                dataGridView1.Refresh();
                // Création de la liste course
                List <PPEV2BO.Course> uneListe = new List <PPEV2BO.Course>();
                uneListe = GestionCourses.GetCourses();
                // on définit le dataGridView comme étant une liste
                dataGridView1.DataSource = uneListe;
                AllocationLabel.Text     = Convert.ToString(totalPrix);
                this.dataGridView1.Columns[0].Visible  = false;
                this.dataGridView1.Columns[3].Visible  = false;
                this.dataGridView1.Columns[4].Visible  = false;
                this.dataGridView1.Columns[5].Visible  = false;
                this.dataGridView1.Columns[6].Visible  = false;
                this.dataGridView1.Columns[7].Visible  = false;
                this.dataGridView1.Columns[8].Visible  = false;
                this.dataGridView1.Columns[9].Visible  = false;
                this.dataGridView1.Columns[10].Visible = false;
                this.dataGridView1.Columns[11].Visible = false;
                this.dataGridView1.Columns[12].Visible = false;
                this.dataGridView1.Columns[13].Visible = false;
            }
        }