예제 #1
0
        private void btn_ValiderEntrainement_Click(object sender, EventArgs e)
        {
            try
            {
                if (lentrainement.lesTours.Count > 0 || String.IsNullOrEmpty(txt_NomEntrainement.Text) || Convert.ToInt32(cbx_nbTours.SelectedItem.ToString()) > 0)
                {
                    lentrainement.Id     = tbx_Id.Text;
                    lentrainement.Nom    = txt_NomEntrainement.Text;
                    lentrainement.NbTour = Convert.ToInt32(cbx_nbTours.SelectedItem.ToString());

                    DAL.Instance.AjouterEntrainementDB(lentrainement);

                    tbx_Id.Text = Guid.NewGuid().ToString();
                    txt_NomEntrainement.Text           = "";
                    cbx_nbTours.SelectedIndex          = -1;
                    cbx_TypeEntrainement.SelectedIndex = -1;
                    numeroTour = 0;

                    lbl_numeroTour.Text = numeroTour.ToString();
                    SuppCbxExercice(lesExercicesCbx);

                    Entrainement_Form ef = new Entrainement_Form();
                    ef.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Il manque des valeurs..");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        private void btn_Entrainements_Click(object sender, EventArgs e)
        {
            Entrainement_Form ef = new Entrainement_Form();

            ef.Show();
        }