Exemplo n.º 1
0
 public ClientInformation GetClientInformation(string id)
 {
     database.Open();
     DataTable result = database.Select("SELECT * FROM client where client_id = @client_id", new Dictionary<string, object>
     {
         {"@client_id", id}
     });
     if (result.Rows.Count == 0) throw new ArgumentException("There is no client_id " + id, "id");
     ClientInformation c = new ClientInformation();
     c.Fill(result.Rows[0]);
     database.Close();
     return c;
 }
Exemplo n.º 2
0
        public List<ClientInformation> GetClientInformations()
        {
            database.Open();
            List<ClientInformation> r = new List<ClientInformation>();
            DataTable table = database.Select("select * from client");
            foreach (DataRow row in table.Rows)
            {
                ClientInformation c = new ClientInformation();
                c.Fill(row);
                r.Add(c);
            }

            database.Close();
            return r;
        }
Exemplo n.º 3
0
 public List<ClientInformation> GetClientsByName(string name)
 {
     List<ClientInformation> list = new List<ClientInformation>();
     var result = database.Select("SELECT * FROM Client WHERE name = @name", new Dictionary<string, object>()
     {
         {"@name", name}
     });
     foreach (DataRow row in result.Rows)
     {
         ClientInformation c = new ClientInformation();
         c.Fill(row);
         list.Add(c);
     }
     return list;
 }