private void BtnPrint_Click(object sender, RoutedEventArgs e) { PrintDialog print = new PrintDialog(); if (print.ShowDialog() == true) { print.PrintVisual(spMain, "Invoice Test"); main.ClearOrderList(); main.ClearOrder(); main.GetCurrentDailyIncome(); main.Load_DailyTransactions(); MessageBox.Show("Invoice Printed!"); this.Close(); } }
private void BtnDelete_Click(object sender, RoutedEventArgs e) { MessageBoxResult mbResult = MessageBox.Show("Delete Confirmation", "Are you sure?", MessageBoxButton.YesNo); if (mbResult == MessageBoxResult.Yes) { mw.total.RemoveAt(index); mw.items.RemoveAt(index); OrderCounter(); mw.ClearOrder(); mw.Load_dgItemList(); mw.Cart_Total(); this.Close(); } }
// button to enter order item into List<Item> items private void BtnEnter_Click(object sender, RoutedEventArgs e) { ComputeItemTotal(); main.items.Add(new Item() { OrderNumber = main.orderCounter, Quantity = quantity, ItemName = row["Item"].ToString(), ItemTotal = itemTotal, Code = row["Code"].ToString(), Price = Convert.ToInt32(row["Price"]) }); main.total.Add(itemTotal); main.orderCounter++; main.ClearOrder(); main.Load_dgItemList(); main.Cart_Total(); this.Close(); }