AbstractLogikalPartsResponse.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using InABox.Integration.Awg;
  4. namespace InABox.Integration.Logikal
  5. {
  6. public interface ILogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  7. : IAwgBOM<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  8. where TFinish : ILogikalFinish
  9. where TProfile : ILogikalProfile
  10. where TGasket : ILogikalGasket
  11. where TComponent : ILogikalComponent
  12. where TGlass : ILogikalGlass
  13. where TLabour : ILogikalLabour
  14. {
  15. byte[] ExcelData { get; set; }
  16. byte[] SQLiteData { get; set; }
  17. }
  18. public abstract class AbstractLogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  19. : LogikalResponse, ILogikalPartsResponse<TFinish, TProfile, TGasket, TComponent, TGlass, TLabour>
  20. where TFinish : ILogikalFinish
  21. where TProfile : ILogikalProfile
  22. where TGasket : ILogikalGasket
  23. where TComponent : ILogikalComponent
  24. where TGlass : ILogikalGlass
  25. where TLabour : ILogikalLabour
  26. {
  27. public IEnumerable<TFinish> Finishes { get; set; }
  28. public IEnumerable<TProfile> Profiles { get; set; }
  29. public IEnumerable<TGasket> Gaskets { get; set; }
  30. public IEnumerable<TComponent> Components { get; set; }
  31. public IEnumerable<TGlass> Glass { get; set; }
  32. public IEnumerable<TLabour> Labour { get; set; }
  33. public byte[] ExcelData { get; set; }
  34. public byte[] SQLiteData { get; set; }
  35. 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";
  36. }
  37. }