Example #1
0
 private void buttonUpdateDisponibilite_Click(object sender, EventArgs e)
 {
     if (periodeRow != null)
     {
         if (periodeRow.debut_periode <= periodeRow.fin_periode)
         {
             int value;
             Int32.TryParse(dataGridViewPeriode.SelectedCells[0].Value.ToString(), out value);
             var Result = MessageBox.Show("Etes-vous sûr de vouloir modifier la période n°" + value.ToString() + "?", "Veuillez confirmer:", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
             if (Result == DialogResult.OK)
             {
                 EtudiantManager.SavePeriode(periodeRow);
                 PopulateAndBind();
             }
         }
         else
         {
             MessageBox.Show("La date de début de période doit se situer avant la date de fin de période", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         var Result = MessageBox.Show("Veuillez sélectionner une ligne", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }