Beispiel #1
0
 public void AddScarto(Cibo food)
 {
     if ( !Scartati.Contains(food))
     {
         Scartati.Add(food);
     }
 }
Beispiel #2
0
 public void AddToList(Cibo food)
 {
     if (List_of_Products.ContainsKey(food))
     {
         List_of_Products[food]++;
     }
     else
     {
         List_of_Products.Add(food, 1);
     }
 }
Beispiel #3
0
 public PassoMessage(bool doble, Cibo first, Cibo second)
 {
     this.doble = doble;
     this.first = first;
     this.second = second;
 }
Beispiel #4
0
 public AllergoloCiboMessage(Cibo ingredient)
 {
     this.ingredient = ingredient;
 }
Beispiel #5
0
 public WrongProductMessage(Cibo product, Allergia uno, Allergia due)
 {
     this.product = product;
     this.allergia_1 = uno;
     this.allergia_2 = due;
 }
Beispiel #6
0
        //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;
        }
Beispiel #7
0
 public void ReadedFood(Cibo food)
 {
     Readed_food = food;
 }
Beispiel #8
0
 public FoodInCashMessage(Cibo food)
 {
     this.food = food;
 }