LogikalProfile.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using InABox.Core;
  2. using InABox.Logikal;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Comal.Classes
  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 ElevationSQL =
  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.[Cost] 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. "where \n" +
  30. " 1=1";
  31. public static String BillOfMaterialsSQL =
  32. "select \n" +
  33. $" a.[ArticleCode_BaseNumber] as {nameof(Code)}, \n" +
  34. $" a.[description] as {nameof(Description)}, \n" +
  35. $" a.[length_output] as {nameof(Length)}, \n" +
  36. $" c.[PowderID] as {nameof(Finish)}, \n" +
  37. $" a.[Amount] as {nameof(Quantity)}, \n" +
  38. $" a.[Price] as {nameof(Cost)} \n" +
  39. "from \n" +
  40. " allprofiles a \n" +
  41. "left outer join \n" +
  42. " colors c on a.[lk_colorid] = c.[colorid] \n" +
  43. "where \n" +
  44. " 1=1";
  45. }
  46. }