LogikalComponent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using InABox.Logikal;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Comal.Classes
  5. {
  6. public class LogikalComponent : LogikalBOMItem, ILogikalComponent
  7. {
  8. public double PackSize { get; set; }
  9. public override void ValidateQuery(string sql, List<string> errors)
  10. {
  11. base.ValidateQuery(sql, errors);
  12. ValidateField(sql, nameof(PackSize), errors);
  13. }
  14. public static String ElevationSQL =
  15. "select \n" +
  16. $" a.[ArticleCode_BaseNumber] as {nameof(Code)}, \n" +
  17. $" a.[description] as {nameof(Description)}, \n" +
  18. $" 1.0 as {nameof(PackSize)}, \n" +
  19. $" a.[units] as {nameof(Quantity)}, \n" +
  20. $" 0.0 as {nameof(Cost)} \n" +
  21. "from \n" +
  22. " articles a \n" +
  23. "left outer join \n" +
  24. " insertions i on a.[insertionid] = i.[insertionid] \n" +
  25. "left outer join \n" +
  26. " elevations e on i.[elevationid] = e.[elevationid] \n" +
  27. "where \n" +
  28. " 1=1";
  29. public static String BillOfMaterialsSQL =
  30. "select \n" +
  31. $" a.[ArticleCode_BaseNumber] as {nameof(Code)}, \n" +
  32. $" a.[description] as {nameof(Description)}, \n" +
  33. $" 1.0 as {nameof(PackSize)}, \n" +
  34. $" a.[units] as {nameof(Quantity)}, \n" +
  35. $" 0.0 as {nameof(Cost)} \n" +
  36. "from \n" +
  37. " allarticles a \n" +
  38. "left outer join \n" +
  39. " insertions i on a.[insertionid] = i.[insertionid] \n" +
  40. "left outer join \n" +
  41. " elevations e on i.[elevationid] = e.[elevationid] \n" +
  42. "where \n" +
  43. " 1=1";
  44. }
  45. }