コード例 #1
0
        /// <summary>
        /// Fonction permettant d'afficher les nuitées
        /// disponibles
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <param name="UnPanel">Panel concerné pour afficher les nuitées</param>
        /// <param name="UneConnexion">Connexion à la base de données</param>
        /// <param name="NomButton">Nom du bouton</param>
        public static void AfficheNuitee(object sender, EventArgs e, Panel UnPanel, Bdd UneConnexion, String NomButton)
        {
            if (((RadioButton)sender).Name == NomButton)
            {
                UnPanel.Visible = true;
                if (UnPanel.Controls.Count == 0) // on charge les nuites possibles possibles et on les affiche
                {
                    //DataTable LesDateNuites = UneConnexion.ObtenirDonnesOracle("VDATENUITE01");
                    //foreach(Dat
                    Dictionary<Int16, String> LesNuites = UneConnexion.ObtenirDatesNuites();
                    int i = 0;
                    foreach (KeyValuePair<Int16, String> UneNuite in LesNuites)
                    {
                        ComposantNuite.ResaNuite unResaNuit = new ResaNuite(UneConnexion.ObtenirDonnesOracle("VHOTEL01"), (UneConnexion.ObtenirDonnesOracle("VCATEGORIECHAMBRE01")), UneNuite.Value, UneNuite.Key);
                        unResaNuit.Left = 5;
                        unResaNuit.Top = 5 + (24 * i++);
                        unResaNuit.Visible = true;
                        //unResaNuit.click += new System.EventHandler(ComposantNuite_StateChanged);
                        UnPanel.Controls.Add(unResaNuit);
                    }

                }

            }
            else
            {
                UnPanel.Visible = false;

            }
        }