Example #1
0
        private void OneSemaine(int id)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }

            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT_DETAILS_SEMAINE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, id));

                IDataReader dr = cmd.ExecuteReader();

                if (dr.Read())
                {
                    DateTime dateco, datefin = new DateTime();
                    dateco  = Convert.ToDateTime(dr["Date_Debut"].ToString());
                    datefin = Convert.ToDateTime(dr["Date_Fin"].ToString());

                    InstantSemaine.GetInstance().IdSemaine  = Convert.ToInt32(dr["Id"].ToString());
                    InstantSemaine.GetInstance().DateDebut  = Convert.ToDateTime(dr["Date_Debut"].ToString());
                    InstantSemaine.GetInstance().DateFin    = Convert.ToDateTime(dr["Date_Fin"].ToString());
                    InstantSemaine.GetInstance().NomComplet = dr["Nom_Complet"].ToString();

                    lblDebut.Text = string.Format("{0}", dateco.ToString("dd/MM/yyyy"));
                    lblFin.Text   = string.Format("{0}", datefin.ToString("dd/MM/yyyy"));
                    lblNom.Text   = dr["Nom_Complet"].ToString();
                }

                dr.Dispose();
            }
            OneInfoSemaine();
            dn.retreivePhoto2("Photo", "Affichage_Details_Semaine", "Id", InstantSemaine.GetInstance().IdSemaine.ToString(), pictureBox3);

            //return semaine;
        }