public void AddScarto(Cibo food) { if ( !Scartati.Contains(food)) { Scartati.Add(food); } }
public void AddToList(Cibo food) { if (List_of_Products.ContainsKey(food)) { List_of_Products[food]++; } else { List_of_Products.Add(food, 1); } }
public PassoMessage(bool doble, Cibo first, Cibo second) { this.doble = doble; this.first = first; this.second = second; }
public AllergoloCiboMessage(Cibo ingredient) { this.ingredient = ingredient; }
public WrongProductMessage(Cibo product, Allergia uno, Allergia due) { this.product = product; this.allergia_1 = uno; this.allergia_2 = due; }
//Load Cibi from DataBase private List<Cibo> ReadCibi() { OleDbDataReader reader = null; List<Cibo> cibi = new List<Cibo>(); try { OleDbCommand cmd = new OleDbCommand("Select * FROM Cibi", conn); reader = cmd.ExecuteReader(); while (reader.Read()) { Cibo newItem = new Cibo(); newItem.id = (int)reader["ID"]; newItem.nome = reader["Nome"].ToString(); newItem.descrizione = reader["Descrizione"].ToString(); newItem.uovo = (bool)reader["Uovo"]; newItem.latte = (bool)reader["Latte"]; newItem.pesce = (bool)reader["Pesce"]; newItem.frutta = (bool)reader["Frutta"]; newItem.immagine = reader["Immagine"].ToString(); newItem.prezzo = (int)reader["Prezzo"]; cibi.Add(newItem); } } finally { if (reader != null) reader.Close(); } return cibi; }
public void ReadedFood(Cibo food) { Readed_food = food; }
public FoodInCashMessage(Cibo food) { this.food = food; }