private IPrets GetAll(IDataReader dr) { IPrets prets = new Prets(); prets.Id = Convert.ToInt32(dr["Numéro"].ToString()); prets.Nom = dr["Nom"].ToString(); prets.Postnom = dr["Postnom"].ToString(); prets.Prenom = dr["Prénom"].ToString(); prets.Montant = float.Parse(dr["Montantpret"].ToString()); prets.Interet = float.Parse(dr["Intéret"].ToString()); prets.Montantpaye = float.Parse(dr["Montantpaye"].ToString()); prets.DatePret = Convert.ToDateTime(dr["Datepret"].ToString()); prets.DateRembour = Convert.ToDateTime(dr["DateRembu"].ToString()).Date; return(prets); }
private IPrets GetAll_Rembou(IDataReader dr) { IPrets prets = new Prets(); prets.Id = Convert.ToInt32(dr["Numéro"].ToString()); prets.Nom = dr["Nom"].ToString(); prets.Postnom = dr["Postnom"].ToString(); prets.Prenom = dr["Prénom"].ToString(); prets.Montant = float.Parse(dr["montant"].ToString()); prets.Montantpaye = float.Parse(dr["reste"].ToString()); prets.DatePret = Convert.ToDateTime(dr["DateRemb."].ToString()); prets.RefCli = Convert.ToInt32(dr["refcli"].ToString()); return(prets); }
public IPrets OneCredit(int id) { IPrets prets = new Prets(); if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed) { ImplementeConnexion.Instance.Conn.Open(); } using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand()) { cmd.CommandText = ""; cmd.CommandType = CommandType.StoredProcedure; IDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { prets = GetAll(dr); } dr.Close(); cmd.Dispose(); } ImplementeConnexion.Instance.Conn.Close(); return(prets); }