12345678910111213141516171819202122232425262728293031323334 |
- using System.Windows;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop
- {
- internal class CustomerInvoiceLine : DynamicOneToManyGrid<Invoice, InvoiceLine>
- {
- public CustomerInvoiceLine()
- {
- AddButton("Calculate", null, CalculateInvoice);
- }
- private bool CalculateInvoice(Button arg1, CoreRow[] arg2)
- {
- var res = MessageBox.Show("Summarise Time and Materials?", "Confirm Action", MessageBoxButton.YesNoCancel, MessageBoxImage.Question,
- MessageBoxResult.Yes, MessageBoxOptions.None);
- if (res == MessageBoxResult.Cancel)
- return false;
- //EditorGrid
- var invoice = Item;
- if (invoice != null)
- {
- Utility.CalculateInvoice(invoice, res == MessageBoxResult.Yes);
- return true;
- }
- MessageBox.Show("Please Select or Create an Invoice First!");
- return false;
- }
- }
- }
|