Beispiel #1
0
 public bool Compare(BestelItem bestelitem)
 {
     if (this.item.ToString() == bestelitem.item.ToString())
     {
         this.aantal = this.aantal + bestelitem.aantal;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #2
0
        public List<BestelItem> GetAllForID(int orderid)
        {
            // List
            List<BestelItem> items = new List<BestelItem>();

            // Connectie opzetten
            dbConnection.Open();
            SqlCommand command = new SqlCommand("SELECT * FROM Bestelling_item WHERE order_id = @Id", dbConnection);
            command.Parameters.AddWithValue("@Id", orderid);
            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Model.BestelItem item = Readitem(reader);
                items.Add(item);
            }

            reader.Close();
            dbConnection.Close();

            return items;
        }