public void Enregistrer(Remboursement remb) { if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed) { ImplementeConnexion.Instance.Conn.Open(); } using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand()) { cmd.CommandText = "INSERT_REMBOURSEMENT"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id)); cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@ref_semaine", 4, DbType.Int32, RefSemaine)); cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@usersession", 50, DbType.String, UserSession.GetInstance().UserName)); cmd.ExecuteNonQuery(); MessageBox.Show("Enregistrement reussie", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private Remboursement GetDetailsRemboursement(IDataReader rd) { Remboursement r = new Remboursement(); i = i + 1; r.Num = i; r.Id = Convert.ToInt32(rd["Id"].ToString()); r.RefInscription = Convert.ToInt32(rd["IdInscription"].ToString()); r.IdRound = Convert.ToInt32(rd["IdRound"].ToString()); r.Matricule = rd["Matricule"].ToString(); r.Noms = rd["Nom_Complet"].ToString(); r.Montant = rd["Montant"].ToString(); r.Sexe = rd["Sexe"].ToString(); r.RefSemaine = Convert.ToInt32(rd["IdSemaine"].ToString()); r.Date_Debut = Convert.ToDateTime(rd["Date_Debut"].ToString()); r.Date_Fin = Convert.ToDateTime(rd["Date_Fin"].ToString()); r.Date_Remboursement = Convert.ToDateTime(rd["Date_Remboursement"].ToString()); return(r); }