Example #1
0
        private Domicile GetAllAdresse(IDataReader dr)
        {
            Domicile m = new Domicile();

            m.RefAdresse = Convert.ToInt32(dr["IdAdresse"].ToString());
            m.Pays       = dr["Pays"].ToString();
            m.Ville      = dr["Ville"].ToString();
            m.Commune    = dr["Commune"].ToString();
            m.Quartier   = dr["Quartier"].ToString();
            m.Avenue     = dr["Avenue"].ToString();

            return(m);
        }
Example #2
0
        public void Enregistrer(Domicile d)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "INSERT_DOMICILE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@avenue", 30, DbType.String, Avenue));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@numero", 30, DbType.String, Numero));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@ref_adresse", 4, DbType.Int32, RefAdresse));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@ref_membre", 30, DbType.String, RefMembre));

                cmd.ExecuteNonQuery();

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