LogikalProfile.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using InABox.Core;
  2. using InABox.Integration.Logikal;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace PRSDesktop.Integrations.Logikal
  6. {
  7. public class LogikalProfile : LogikalBOMItem, ILogikalProfile
  8. {
  9. public double Length { get; set; }
  10. public string? Finish { get; set; }
  11. public override void ValidateQuery(string sql, List<string> errors)
  12. {
  13. base.ValidateQuery(sql, errors);
  14. ValidateField(sql, nameof(Length), errors);
  15. ValidateField(sql, nameof(Finish), errors);
  16. }
  17. public static String DesignSQL =
  18. "select \n" +
  19. $" p.[ArticleCode_BaseNumber] as {nameof(Code)}, \n" +
  20. $" p.[description] as {nameof(Description)}, \n" +
  21. $" p.[length_output] as {nameof(Length)}, \n" +
  22. $" c.[PowderID] as {nameof(Finish)}, \n" +
  23. $" p.[Amount] as {nameof(Quantity)}, \n" +
  24. $" p.[Price] as {nameof(Cost)} \n" +
  25. "from \n" +
  26. " profiles p \n" +
  27. "left outer join \n" +
  28. " colors c on p.[lk_colorid] = c.[colorid] \n";
  29. public static String BillOfMaterialsSQL =
  30. "select \n" +
  31. $" a.[ArticleCode_BaseNumber] as {nameof(Code)}, \n" +
  32. $" a.[description] as {nameof(Description)}, \n" +
  33. $" a.[length_output] as {nameof(Length)}, \n" +
  34. $" c.[PowderID] as {nameof(Finish)}, \n" +
  35. $" a.[Amount] as {nameof(Quantity)}, \n" +
  36. $" a.[Price] as {nameof(Cost)} \n" +
  37. "from \n" +
  38. " allprofiles a \n" +
  39. "left outer join \n" +
  40. " colors c on a.[lk_colorid] = c.[colorid] \n";
  41. }
  42. }