private void DeleteOrderButton_Click(object sender, RoutedEventArgs e) { string s = OrderListBox.SelectedItem.ToString(); Order order = new Order(); foreach (Order o in orders) { if (o.compareTo(s)) { order = o; } } SQLiteDataAccess.deleteOrder(order.Order_ID); SQLiteDataAccess.deleteOrderDetailsByOrderID(order.Order_ID); LoadAll(); }
private void FinishOrder_Button_Click(object sender, RoutedEventArgs e) { List <Order> allOrders = SQLiteDataAccess.LoadOrders(); int i = 1; /* * if(allOrders.Count != 0) * { * i = allOrders.Last().Order_ID + 1; * } */ Order finishedOrder = new Order(i, customer.Customer_ID, System.DateTime.Today.ToString()); SQLiteDataAccess.SaveOrder(finishedOrder); allOrders = SQLiteDataAccess.LoadOrders(); OrderDetails od = new OrderDetails(); od.Order_ID = allOrders.Last().Order_ID; finishedOrder = allOrders.Last(); foreach (Product p in newOrder) { od.Product_ID = p.Product_ID; od.Product_Price = p.Product_Price; SQLiteDataAccess.SaveOrderDetails(od); } EmailManager emailManager = new EmailManager(customer, finishedOrder); emailManager.SendEmail(); CustomerInfoWindow customerInfoWindow = new CustomerInfoWindow(customer); customerInfoWindow.Show(); this.Close(); }
public void LoadCustomerList() { products = SQLiteDataAccess.LoadProducts(); WireUpProductList(products); }
public void Refresh() { products = SQLiteDataAccess.LoadProducts(); LoadCustomerList(); setTextBlank(); }
/// <summary> /// gets all customers from db and displays them in /// CustomerListBox using WireUpPeopleList method /// </summary> public void LoadCustomerList() { customers = SQLiteDataAccess.LoadCustomers(); WireUpPeopleList(customers); }
public void setItems() { items = SQLiteDataAccess.GetProductsByOrderID(Order_ID); }
public void LoadProductsList() { products = SQLiteDataAccess.LoadProducts(); productsList.ItemsSource = products; }
public void LoadOrderList() { orders = SQLiteDataAccess.GetOrderHistoryById(cust.Customer_ID); WireUpOrderList(orders); }