Ejemplo n.º 1
0
        private Creance GetCreances(IDataReader dr)
        {
            Creance cr = new Creance();



            return(cr);
        }
Ejemplo n.º 2
0
        public void Enregistrer(Creance cr)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "INSERT_CREANCE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@id", 5, DbType.Int32, cr.Id));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@montant", 10, DbType.Double, cr.Montant));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@date", 20, DbType.Date, cr.DatePaiement));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@refcli", 5, DbType.Int32, cr.RefClient));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@observation", 100, DbType.String, cr.Observation));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@code", 100, DbType.String, cr.Code));
                cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@refcre", 5, DbType.Int32, cr.RefEntete));

                cmd.ExecuteNonQuery();
            }
        }