コード例 #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
ファイル: ModelView.cs プロジェクト: Nichtgian/giancheeez
 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
ファイル: ModelView.cs プロジェクト: Nichtgian/giancheeez
 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
ファイル: ModelView.cs プロジェクト: Nichtgian/giancheeez
 public void addOrder(Model.CustomerOrder order)
 {
     this.CustomerOrders.Add(order);
     OnPropertyChanged("CustomerOrders");
 }