123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Threading.Tasks;
- using System.Windows;
- using Comal.Classes;
- using InABox.Core;
- using InABox.Integration.Awg;
- using InABox.Integration.Logikal;
- using PRSDesktop.Integrations.Logikal;
- namespace PRSDesktop.Integrations.Common;
- public partial class AWGMappingWindow : Window
- {
- private readonly Action<ProductLink,ProductStyleLink?,IBaseDimensions,double,double>? _partsCallback;
- private readonly Action<ActivityLink,TimeSpan, double>? _labourCallback;
- private readonly Action<SupplierDiscountGroupLink, double>? _discountCallback;
- public AWGMappingWindow(
- IntegrationSourceType sourceType,
- IEnumerable<IAwgStyle> styles,
- IEnumerable<IAwgGroup> groups,
- IEnumerable<IAwgSupplier> suppliers,
- IEnumerable<IAwgDiscount> discounts,
- IEnumerable<IAwgProfile> profiles,
- IEnumerable<IAwgGasket> gaskets,
- IEnumerable<IAwgComponent> components,
- IEnumerable<IAwgGlass> glass,
- IEnumerable<IAwgLabour> labour,
- Action<SupplierDiscountGroupLink,double>? discountCallback,
- Action<ProductLink,ProductStyleLink?,IBaseDimensions,double,double>? partsCallback,
- Action<ActivityLink,TimeSpan, double>? labourCallback)
- {
- InitializeComponent();
- _discountCallback = discountCallback;
- _partsCallback = partsCallback;
- _labourCallback = labourCallback;
- ViewModel.SourceType = sourceType;
- ViewModel.Styles = styles;
- ViewModel.Groups = groups;
- ViewModel.Suppliers = suppliers;
- ViewModel.Discounts = discounts;
- ViewModel.Profiles = profiles;
- ViewModel.Gaskets = gaskets;
- ViewModel.Components = components;
- ViewModel.Glass = glass;
- ViewModel.Labour = labour;
- }
-
- private void CancelClick(object sender, RoutedEventArgs e)
- {
- DialogResult = false;
- }
- private void OKClick(object sender, RoutedEventArgs e)
- {
- ViewModel.CheckUpdates();
- ViewModel.GetDiscounts(_discountCallback);
- ViewModel.GetParts(_partsCallback,_labourCallback);
- DialogResult = true;
- }
- public void GetParts<TProfile, TGasket, TComponent, TGlass, TLabour>(
- IEnumerable<TProfile>? profiles,
- IEnumerable<TGasket>? gaskets,
- IEnumerable<TComponent>? components,
- IEnumerable<TGlass>? glasses,
- IEnumerable<TLabour>? labour,
- Action<ProductLink, ProductStyleLink?, IBaseDimensions, double, double>? productCallback,
- Action<ActivityLink, TimeSpan, double>? labourCallback)
- where TProfile : IAwgProfile
- where TGasket : IAwgGasket
- where TComponent : IAwgComponent
- where TGlass : IAwgGlass
- where TLabour : IAwgLabour
- {
- ViewModel.GetParts(profiles, gaskets, components, glasses, labour, productCallback, labourCallback);
- }
- private void BaseDynamicGrid_OnOnChanged(object? sender, EventArgs e)
- {
- ViewModel.CheckChanged();
- }
- }
|