示例#1
0
 /// <summary>
 /// Charge les liste des sections disponibles.
 /// </summary>
 /// <returns>Liste de sections</returns>
 public static List<BO.Section> ChargerListeDeSection()
 {
     List<BO.Section> retVal = new List<BO.Section>();
     SqlConnection connection = Utilitaire.ObtenirConnexion();
     string requête =
         @"SELECT ID, LIBELLE
             from Section s";
     SqlCommand commande = new SqlCommand(requête, connection);
     try
     {
         connection.Open();
         SqlDataReader lecteur = commande.ExecuteReader();
         while (lecteur.Read())
         {
             int sectionId = int.Parse(lecteur["ID"].ToString());
             BO.Section section = new BO.Section(sectionId);
             section.Libellé = lecteur["LIBELLE"].ToString();
             retVal.Add(section);
         }
         lecteur.Close();
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     finally
     {
         connection.Close();
     }
     return retVal;
 }
 private void chargerÉlèveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.pnlElève.Hide();
     FichRechercher f = new FichRechercher();
     if (f.ShowDialog() == DialogResult.OK)
     {
         this.eleveCourant = f.EleveCourant;
         this.sectionCourante = f.SectionCourante;
         this.RafraîchirAffichages();
     }
 }
 public FichePrincipale()
 {
     InitializeComponent();
     this.eleveCourant = null;
     this.sectionCourante = null;
 }
示例#4
0
 private void terminerDialogue()
 {
     this.SectionCourante = (BO.Section)cbSection.SelectedItem;
     this.EleveCourant = (BO.Eleve)lbProp.SelectedItem;
     this.DialogResult = DialogResult.OK;
 }