public Taux SelectOne(String condition) { Taux result = null; if (connexion.State == ConnectionState.Open) { connexion = new SqlConnection(connexion.ConnectionString + "Password=itu"); } connexion.Open(); using (SqlCommand cmd = connexion.CreateCommand()) { result = this.ExecuteSelectOne(cmd, condition); } connexion.Close(); return(result); }
private Taux ExecuteSelectOne(SqlCommand cmd, String condition) { Taux result = null; string cond = ""; if (condition != null) { cond = " " + condition; } cmd.CommandText = "SELECT * FROM Taux" + cond; using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { result = this.Map(reader); } } return(result); }
// METHODS : public bool Equals(Taux cmp) { return(this.id == cmp.Id); }