Esempio n. 1
0
        private Semaine GetSemaineDetails(IDataReader rd)
        {
            Semaine s = new Semaine();

            s.Id         = Convert.ToInt32(rd["Id"].ToString());
            s.DateDebut  = Convert.ToDateTime(rd["Date_Debut"].ToString());
            s.DateFin    = Convert.ToDateTime(rd["Date_Fin"].ToString());
            s.RefDetail  = Convert.ToInt32(rd["IdDetail"].ToString());
            s.Montant    = Convert.ToDecimal(rd["Montant"].ToString());
            s.Devise     = rd["Devise"].ToString();
            s.RefInscrit = Convert.ToInt32(rd["IdInscrit"].ToString());
            s.IdRound    = Convert.ToInt32(rd["IdRound"].ToString());
            s.Matricule  = rd["Matricule"].ToString();
            s.Nom        = rd["Nom"].ToString();
            s.Postnom    = rd["Postnom"].ToString();
            s.Prenom     = rd["Prenom"].ToString();
            s.Sexe       = rd["Sexe"].ToString();

            return(s);
        }
Esempio n. 2
0
        public void Enregistrer(Semaine sem)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "INSERT_SEMAINE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@numero", 4, DbType.Int32, RefInscrit));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@refround", 4, DbType.Int32, InstantRound.GetInstance().Id));


                cmd.ExecuteNonQuery();

                //MessageBox.Show("Enregistrement reussie", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }