Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        // METHODS :

        public bool Equals(Taux cmp)
        {
            return(this.id == cmp.Id);
        }