Пример #1
0
        public IEmprunt GetNomId(IDataReader dr)
        {
            IEmprunt tier = new Emprunt();

            tier.Reftier = Convert.ToInt32(dr["code_tier"].ToString());
            tier.Tier    = dr["noms"].ToString();
            return(tier);
        }
Пример #2
0
        public IEmprunt GetEmprunt_Remb(IDataReader dr)
        {
            IEmprunt emprunt = new Emprunt();

            emprunt.Id          = Convert.ToInt32(dr["N°"].ToString());
            emprunt.Name        = dr["Noms"].ToString();
            emprunt.Montant     = float.Parse(dr["Emprunt"].ToString());
            emprunt.MontantRemb = float.Parse(dr["Montant"].ToString());
            emprunt.Reste       = float.Parse(dr["Reste"].ToString());
            emprunt.DateEmprunt = DateTime.Parse(dr["Date_op"].ToString());
            emprunt.Reftier     = Convert.ToInt32(dr["ref_emp"].ToString());
            return(emprunt);
        }
Пример #3
0
        public IEmprunt GetEmprunt(IDataReader dr)
        {
            IEmprunt emprunt = new Emprunt();

            emprunt.Id          = Convert.ToInt32(dr["code_emprunt"].ToString());
            emprunt.Name        = dr["nom_t"].ToString();
            emprunt.LastName    = dr["postnom_t"].ToString();
            emprunt.SurName     = dr["prenom_t"].ToString();
            emprunt.Montant     = float.Parse(dr["montant"].ToString());
            emprunt.DateEmprunt = DateTime.Parse(dr["date_emprunt"].ToString());
            emprunt.MontantRemb = float.Parse(dr["montant_remb"].ToString());
            emprunt.DateRembu   = DateTime.Parse(dr["date_rembu"].ToString());
            return(emprunt);
        }
Пример #4
0
        public IEmprunt OneEmprunt(int id)
        {
            IEmprunt tier = new Emprunt();

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(Parametres.Instance.AjouterParametre(cmd, "code_tier", 5, DbType.Int32, Id));
                IDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    tier = GetEmprunt(dr);
                }
                cmd.Dispose();
                dr.Dispose();
            }
            return(tier);
        }