private void Confirm_Click(object sender, EventArgs e)
        {
            bool vrf; //Vrai si cases toutes cochées

            vrf = Verif(mme_arbitre_touche_1.Checked, m_arb_touche_1.Checked, mme_arbitre_touche_2.Checked, m_arbitre_touche_2.Checked, mme_arb_princ.Checked, m_arb_princ.Checked, mme_arb_remp.Checked, m_arb_remp.Checked);

            if (string.IsNullOrEmpty(stade.Text) || string.IsNullOrEmpty(dispositif_locaux.Text) || string.IsNullOrEmpty(dispositif_visiteurs.Text) || string.IsNullOrEmpty(equipe_locaux.Text) || string.IsNullOrEmpty(equipe_visiteurs.Text) || string.IsNullOrEmpty(nom_arbitre_prinicpal.Text) || string.IsNullOrEmpty(nom_arbitre_remplaçant.Text) || string.IsNullOrEmpty(nom_arbitre_touche_1.Text) || string.IsNullOrEmpty(nom_arbitre_touche_2.Text) || vrf == false || equipe_locaux.Text == equipe_visiteurs.Text)
            {
                MessageBox.Show("Erreur, vérifiez vos saisies", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            else
            {
                Program.Excel.FermerWoorkBook(false); //Fermeture du fichier "championnats.xlsx"
                fenetre2 f2 = new fenetre2(equipe_locaux.Text, equipe_visiteurs.Text, dispositif_locaux.Text, dispositif_visiteurs.Text);
                f2.Show();
                this.Hide();
                //On commence à récupérer les premières infos pour la feuille de match
                string   arb_princ   = GetCivilite(m_arb_princ, mme_arb_princ) + ". " + nom_arbitre_prinicpal.Text;
                string   arb_remp    = GetCivilite(m_arb_remp, mme_arb_remp) + ". " + nom_arbitre_remplaçant.Text;
                string   arb_touche1 = GetCivilite(m_arb_touche_1, mme_arbitre_touche_1) + ". " + nom_arbitre_touche_1.Text;
                string   arb_touche2 = GetCivilite(m_arbitre_touche_2, mme_arbitre_touche_2) + ". " + nom_arbitre_touche_2.Text;
                DateTime date        = calendrier_date.SelectionStart;
                Program.fdm = new FeuilleDeMatch(stade.Text, arb_princ, arb_remp, arb_touche1, arb_touche2, date, champ.Text); //Enregistrement des premières infos pour la feuille de match
            }
        }
Ejemplo n.º 2
0
        private void Confirm_Click(object sender, EventArgs e)
        {
            //A enlever une fois tests terminées
            Program.Excel.FermerWoorkBook(false); //Fermeture du fichier "championnats.xlsx"
            fenetre2 f = new fenetre2(equipe_locaux.Text, equipe_visiteurs.Text, dispositif_locaux.Text, dispositif_visiteurs.Text);

            f.Show();
            this.Hide();

            //DECOMMENTER UNE FOIS TESTS TERMINES

            /*
             * bool vrf; //Vrai si cases toutes cochées
             *
             * vrf = Verif(mme_arbitre_touche_1.Checked, m_arb_touche_1.Checked, mme_arbitre_touche_2.Checked, m_arbitre_touche_2.Checked, mme_arb_princ.Checked, m_arb_princ.Checked, mme_arb_remp.Checked, m_arb_remp.Checked);
             *
             *
             * if (string.IsNullOrEmpty(stade.Text) || string.IsNullOrEmpty(dispositif_locaux.Text) || string.IsNullOrEmpty(dispositif_visiteurs.Text) || string.IsNullOrEmpty(equipe_locaux.Text) || string.IsNullOrEmpty(equipe_visiteurs.Text) || string.IsNullOrEmpty(nom_arbitre_prinicpal.Text) || string.IsNullOrEmpty(nom_arbitre_remplaçant.Text) || string.IsNullOrEmpty(nom_arbitre_touche_1.Text) || string.IsNullOrEmpty(nom_arbitre_touche_2.Text) || vrf == false || equipe_locaux.Text==equipe_visiteurs.Text)
             * {
             *  MessageBox.Show("Erreur, vérifiez vos saisies", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
             * }
             *
             * else
             * {
             *  fenetre2 f = new fenetre2(equipe_locaux.Text, equipe_visiteurs.Text, dispositif_locaux.Text, dispositif_visiteurs.Text);
             *  f.Show();
             *  this.Hide();
             * }*/

            //On commence à récupérer les premières infos pour la feuille de match
            string   civilite_arb_princ   = GetCivilite(m_arb_princ, mme_arb_princ);
            string   civilite_arb_remp    = GetCivilite(m_arb_remp, mme_arb_remp);
            string   civilite_arb_touche1 = GetCivilite(m_arb_touche_1, mme_arbitre_touche_1);
            string   civilite_arb_touche2 = GetCivilite(m_arbitre_touche_2, mme_arbitre_touche_2);
            string   championnat          = champ.Text;
            DateTime date = calendrier_date.SelectionStart;

            Program.fdm = new FeuilleDeMatch(champ.Text, civilite_arb_princ, civilite_arb_remp, civilite_arb_touche1, civilite_arb_touche2, date, champ);
        }