12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System.Windows;
- using PRS.Shared;
- namespace PRSDesktop
- {
- public partial class InvoiceCalculationSelector : Window
- {
- public InvoiceTimeCalculation TimeCalculation
- {
- get => LabourDetails.IsChecked == true
- ? InvoiceTimeCalculation.Detailed
- : LabourActivity.IsChecked == true
- ? InvoiceTimeCalculation.Activity
- : InvoiceTimeCalculation.Collapsed;
-
- set
- {
- switch (value)
- {
- case InvoiceTimeCalculation.Detailed :
- LabourDetails.IsChecked = true;
- break;
- case InvoiceTimeCalculation.Activity :
- LabourActivity.IsChecked = true;
- break;
- case InvoiceTimeCalculation.Collapsed :
- LabourCollapsed.IsChecked = true;
- break;
- }
- }
- }
-
- public InvoiceMaterialCalculation MaterialCalculation
- {
- get => PartsDetails.IsChecked == true
- ? InvoiceMaterialCalculation.Detailed
- : PartsProduct.IsChecked == true
- ? InvoiceMaterialCalculation.Product
- : PartsCostCentre.IsChecked == true
- ? InvoiceMaterialCalculation.CostCentre
- : InvoiceMaterialCalculation.Collapsed;
-
- set
- {
- switch (value)
- {
- case InvoiceMaterialCalculation.Detailed :
- PartsDetails.IsChecked = true;
- break;
- case InvoiceMaterialCalculation.Product :
- PartsProduct.IsChecked = true;
- break;
- case InvoiceMaterialCalculation.CostCentre :
- PartsCostCentre.IsChecked = true;
- break;
- case InvoiceMaterialCalculation.Collapsed :
- PartsCollapsed.IsChecked = true;
- break;
- }
- }
- }
-
- public InvoiceCalculationSelector()
- {
- InitializeComponent();
- }
- private void OK_OnClick(object sender, RoutedEventArgs e)
- {
- DialogResult = true;
- }
- private void Cancel_OnClick(object sender, RoutedEventArgs e)
- {
- DialogResult = false;
- }
- }
- }
|