Esempio n. 1
0
        private void btnDesordreSuivant_Click(object sender, EventArgs e)
        {
            btnValider_Click(sender, e);

            DataRow[] InfosExoSuivant = Babbel.Tables["Exercices"].Select($"numCours = '{InfosExo.ItemArray[1].ToString()}' AND numLecon = '{InfosExo.ItemArray[2].ToString()}' AND numExo = {(int)(InfosExo.ItemArray[0]) + 1}");
            if (InfosExoSuivant.Length != 0)
            {
                if ((int)(InfosExoSuivant[0].ItemArray[5]) == 0)
                {
                    LeconVocabulaire LeconVocabulaire = new LeconVocabulaire(InfosExoSuivant[0], Babbel, utilisateur, TableVerifExo);
                    LeconVocabulaire.Show();
                }
                else if ((bool)(InfosExoSuivant[0].ItemArray[6]))
                {
                    ExoDesordre ExoDesordre = new ExoDesordre(InfosExoSuivant[0], Babbel, utilisateur, TableVerifExo);
                    ExoDesordre.Show();
                }
                else
                {
                    ExoTrou ExoATrou = new ExoTrou(InfosExoSuivant[0], Babbel, utilisateur, TableVerifExo);
                    ExoATrou.Show();
                }
            }
            else
            {
                FormResultatLecon FormResultatLecon = new FormResultatLecon(TableVerifExo, Babbel);
                FormResultatLecon.Show();
            }
            this.Close();
        }
Esempio n. 2
0
        private void BtnExo_Click(object sender, EventArgs e)
        {
            bool   firstfalse  = false;
            int    i           = 0;
            int    numeroExo   = 0;
            string utilisateur = cbxAcceuilUtilisateur.SelectedItem.ToString();

            DataRow currentExo = null;

            while (!firstfalse && i < TableVerifExo.Rows.Count)
            {
                if ((int)TableVerifExo.Rows[i].ItemArray[1] == 0 || (int)TableVerifExo.Rows[i].ItemArray[1] == 2)
                {
                    numeroExo  = (int)TableVerifExo.Rows[i].ItemArray[0];
                    firstfalse = true;
                }
                i++;
            }
            if (numeroExo > 0)
            {
                currentExo = InfosExo[numeroExo - 1];
            }

            if (i == TableVerifExo.Rows.Count)
            {
                currentExo = Babbel.Tables["Exercices"].Select($"numCours = '{InfosCours.ItemArray[0].ToString()}' AND numLecon = '{(int)InfosLecons.ItemArray[0] + 1}'")[0];
                numeroExo  = (int)currentExo.ItemArray[0];
            }


            if ((int)(currentExo.ItemArray[5]) == 0)
            {
                LeconVocabulaire LeconVocabulaire = new LeconVocabulaire(currentExo, Babbel, utilisateur, TableVerifExo);
                LeconVocabulaire.ShowDialog();
            }
            else if ((bool)(currentExo.ItemArray[6]))
            {
                ExoDesordre ExoDesordre = new ExoDesordre(currentExo, Babbel, utilisateur, TableVerifExo);
                ExoDesordre.ShowDialog();
            }
            else
            {
                ExoTrou ExoATrou = new ExoTrou(currentExo, Babbel, utilisateur, TableVerifExo);
                ExoATrou.ShowDialog();
            }

            DialogResult = DialogResult.OK;
        }