Пример #1
0
 private async void acceptButton_ClickAsync(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0 && areAllTheSameStatus(Status.ReadyToDeliver))
     {
         setSelectedOrders();
         DialogResult dialogResult = MessageBox.Show("Biztos elfogadja?", "Megerősítés", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             foreach (Order order in selectedOrders)
             {
                 order.Status = Status.Delivery;
                 await db.AddOrder(order);
             }
         }
         else if (dialogResult == DialogResult.No)
         {
             //do something else
         }
     }
 }
Пример #2
0
 private async void setOrder()
 {
     await db.AddOrder(order);
 }
Пример #3
0
 private void doneButton_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0 && areAllTheSameStatus(Status.Ready) && areAllTakeAway())
     {
         List <Order> selectedOrders = setSelectedOrders();
         DialogResult dialogResult   = MessageBox.Show("Átadva ?", "Megerősítés", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             selectedOrders.ForEach(async order => { order.Status = Status.Completed; await db.AddOrder(order); });
         }
         else if (dialogResult == DialogResult.No)
         {
             //do something else
         }
     }
 }