//krijg alle producten uit DB public List<Product> GetAll() { List<Product> producten = new List<Product>(); using (OracleConnection conn = Database.Instance.GetConnection()) { conn.Open(); string query = string.Format("Select * from product"); using (OracleCommand cmd = new OracleCommand(query, conn)) { using (OracleDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { Product product = new Product(Convert.ToInt32(reader["ID"]), reader["productnaam"].ToString(), Convert.ToDecimal(reader["prijs"]), reader["sale"].ToString() , Convert.ToInt32(reader["categorie_Id"]), Convert.ToInt32(reader["voorraad"]), Convert.ToInt32(reader["Specificaties_ID"])); producten.Add(product); } } } } return producten; }
public Retourneeritem(Product product, int factuurnummerId) { Product = product; Factuurnummer_ID = factuurnummerId; }