Beispiel #1
0
        public static Droits findAdmin(string Admin)
        {
            Droits      droits = null;
            OdbcCommand cmd    = new OdbcCommand("select * from droits where admin=?", AccesBd.getConnection());

            cmd.Parameters.Add("@numero", OdbcType.VarChar).Value = Admin;
            OdbcDataReader dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                droits = new Droits {
                    Id = dr.GetInt32(0), admin = AdminDao.findByNumero(dr.GetString(1)), Table = dr.GetString(2), Consulter = dr.GetString(3), Ajouter = dr.GetString(4), Modifier = dr.GetString(5), Supprimer = dr.GetString(6)
                };
            }
            cmd.Dispose();
            return(droits);
        }
Beispiel #2
0
        public static Versement findByNumero(string numero)
        {
            Versement   versement = null;
            OdbcCommand cmd       = new OdbcCommand("select * from versement where Numero=?", AccesBd.getConnection());

            cmd.Parameters.Add("@numero", OdbcType.VarChar).Value = numero;
            OdbcDataReader dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                versement = new Versement {
                    Id = dr.GetInt32(0), Numero = dr.GetString(1), Montant = dr.GetDouble(3), Description = dr.GetString(2), Date = dr.GetDateTime(4), carte = CarteDao.findByNumero(dr.GetString(5)), admin = AdminDao.findByNumero(dr.GetString(6))
                };
            }
            cmd.Dispose();
            return(versement);
        }