public void Save(IEmprunt emprunt) { if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed) { ImplementeConnexion.Instance.Conn.Open(); } using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand()) { cmd.CommandText = "INSERT_EMPRUNT"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@code", 5, DbType.Int32, Id)); cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@montant", 10, DbType.Double, Montant)); cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@date_remb", 20, DbType.Date, DateRembu)); cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@montant_remb", 20, DbType.Double, MontantRemb)); cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "@reftier", 20, DbType.Int32, Reftier)); cmd.ExecuteNonQuery(); MessageBox.Show("Saved Successfully !!!", "Message...", MessageBoxButtons.OK, MessageBoxIcon.Information); cmd.Dispose(); } }
void Load_Tier(IEmprunt empTier) { dataGridView2.DataSource = empTier.Get_TierNomId(); }
void Get_Emprunt_Rem(IEmprunt rembou) { dataGridView1.DataSource = rembou.AllEmprunt_Remb(); }
void Load_emprunt(IEmprunt emprunt) { dataGridView1.DataSource = emprunt.AllEmprunt(); }