AbstractLogikalPartsResponse.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using InABox.Integration.Awg;
  4. namespace InABox.Integration.Logikal
  5. {
  6. public interface ILogikalPartsResponse<TGroup, TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  7. : IAwgBOM<TGroup, TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  8. where TGroup : ILogikalProductGroup
  9. where TFinish : ILogikalFinish
  10. where TProfile : ILogikalProfile
  11. where TGasket : ILogikalGasket
  12. where TComponent : ILogikalComponent
  13. where TGlass : ILogikalGlass
  14. where TLabour : ILogikalLabour
  15. {
  16. byte[] ExcelData { get; set; }
  17. byte[] SQLiteData { get; set; }
  18. }
  19. public abstract class AbstractLogikalPartsResponse<TGroup, TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  20. : LogikalResponse, ILogikalPartsResponse<TGroup, TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  21. where TGroup : ILogikalProductGroup
  22. where TFinish : ILogikalFinish
  23. where TProfile : ILogikalProfile
  24. where TGasket : ILogikalGasket
  25. where TComponent : ILogikalComponent
  26. where TGlass : ILogikalGlass
  27. where TLabour : ILogikalLabour
  28. {
  29. public IEnumerable<TGroup> Groups { get; set; }
  30. public IEnumerable<TFinish> Finishes { get; set; }
  31. public IEnumerable<TProfile> Profiles { get; set; }
  32. public IEnumerable<TGasket> Gaskets { get; set; }
  33. public IEnumerable<TComponent> Components { get; set; }
  34. public IEnumerable<TGlass> Glass { get; set; }
  35. public IEnumerable<TLabour> Labour { get; set; }
  36. public byte[] ExcelData { get; set; }
  37. public byte[] SQLiteData { get; set; }
  38. public override string ToString() => $"{Finishes?.Count() ?? 0} Finishes / {Profiles?.Count() ?? 0} Profiles / {Gaskets?.Count() ?? 0} Gaskets / {Components?.Count() ?? 0} Components / {Glass?.Count() ?? 0} Glass/ {Labour?.Count() ?? 0} Activities found";
  39. }
  40. }