예제 #1
0
        public IList<Client> RetrieveAll()
        {
            IList<Client> result = new List<Client>();
            try
            {
                connexion = new MySqlConnexion();

                string requete = "SELECT * FROM Clients INNER JOIN Personnes ON Clients.idClient = Personnes.idPersonne";

                DataSet dataset = connexion.Query(requete);
                DataTable table = dataset.Tables[0];

                foreach (DataRow client in table.Rows)
                {
                    result.Add(ConstructClient(client));
                }

            }
            catch (MySqlException)
            {
                throw;
            }

            return result;
        }
예제 #2
0
        public Client Retrieve(RetrieveClientArgs args)
        {
            try
            {
                connexion = new MySqlConnexion();

                string requete = String.Format("SELECT * FROM Clients INNER JOIN Personnes ON Clients.idClient = Personnes.idPersonne WHERE idClient = {0}", args.IdClient);
                DataSet dataset = connexion.Query(requete);

                return ConstructClient(dataset.Tables[0].Rows[0]);

            }
            catch (MySqlException)
            {
                throw;
            }
        }