Пример #1
0
 private void removeCustomerOrder(object sender, SelectionChangedEventArgs args)
 {
     Model.CustomerOrder selectedCustomerOrder = ListViewCustomerOrders.SelectedItem as Model.CustomerOrder;
     if (selectedCustomerOrder != null)
     {
         modelView.removeCustomerOrder(selectedCustomerOrder);
     }
 }
Пример #2
0
 private void selectedOrderComplete(object sender, RoutedEventArgs e)
 {
     Model.CustomerOrder selectedCustomerOrder = ListViewCustomerOrders.SelectedItem as Model.CustomerOrder;
     if (selectedCustomerOrder != null)
     {
         modelView.selectedOrderComplete(selectedCustomerOrder);
     }
 }
Пример #3
0
 public void selectedOrderComplete(Model.CustomerOrder selectedCustomerOrder)
 {
     for (int i = 0; i < this.CustomerOrders.Count; i++)
     {
         Model.CustomerOrder customerOrder = this.CustomerOrders[i];
         if (customerOrder == selectedCustomerOrder)
         {
             this.CustomerOrders.RemoveAt(i);
             this.CompleteCustomerOrders.Add(selectedCustomerOrder);
         }
     }
 }
Пример #4
0
 public void safeOrder(Model.CustomerOrder order)
 {
     try
     {
         string       query = "INSERT INTO orders (id, date) VALUES (?id, ?date)";
         MySqlCommand cmd   = new MySqlCommand(query, database.Connection);
         cmd.Parameters.AddWithValue("?id", order.ID);
         cmd.Parameters.AddWithValue("?date", DateTime.Now);
         database.Connection.Open();
         cmd.ExecuteNonQuery();
         database.Connection.Close();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Пример #5
0
 public void clearOrder()
 {
     Model.CustomerOrder order = new Model.CustomerOrder();
     this.Order = order;
 }
Пример #6
0
 public void addOrder(Model.CustomerOrder order)
 {
     this.CustomerOrders.Add(order);
     OnPropertyChanged("CustomerOrders");
 }