Esempio n. 1
0
 /// <summary>
 /// удаление блюда из внутреннего списка меню
 /// </summary>
 /// <param name="dish"></param>
 /// <param name="price"></param>
 public void removeDishFromOrder()
 {
     int index = findDishOrder(orderDiahNameCrutch);
     orderEnrty temp = new orderEnrty(currentOrder[index]);
     if (temp.Count == 1)
         currentOrder.Remove(temp);
     else
     {
         temp.decreament();
         currentOrder[index] = temp;
     }
     return;
 }
Esempio n. 2
0
 /// <summary>
 /// добавление блюда во внутренний список заказа
 /// </summary>
 /// <param name="dish"></param>
 /// <param name="price"></param>
 public void addDishToOrder()
 {
     int index = view.getIndexSelectedDish();
     bool nothing = true;
     foreach (int i in Enumerable.Range(0, currentOrder.Count))
     {
         if (currentOrder[i].id == currentMenu[dishindex].id)
         {
             orderEnrty temp = new orderEnrty(currentOrder[i]);
             temp.inreament();
             currentOrder[i] = temp;
             nothing = false; ;
         }
     }
     if (nothing)
         currentOrder.Add(currentMenu[dishindex].ToOrderEntry());
     updateDishPhoto();
     //void setDishPhoto(String path)
 }
Esempio n. 3
0
 //конструктор копии
 public orderEnrty(orderEnrty entry)
 {
     this.dish = entry.Dish;
     this.count = entry.Count;
     this.price = entry.price;
     this.id = entry.id;
     this.linkToPhoto = entry.linkToPhoto;
 }