V6Component.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Integration.V6;
  4. namespace PRSDesktop.Integations.V6
  5. {
  6. public class V6Component : V6BOMItem, IV6Component
  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 SQL =
  15. "select \n" +
  16. $" bc.Part_Code as {nameof(Code)}, \n" +
  17. $" c.descr as {nameof(Description)}, \n" +
  18. $" 1.0 as {nameof(PackSize)}, \n" +
  19. $" bc.comp_qty as {nameof(Quantity)}, \n" +
  20. $" bc.cost as {nameof(Cost)} \n" +
  21. "from \n" +
  22. " bom_comp bc \n" +
  23. "left outer join \n" +
  24. " quote_item qi on qi.quote_item_id = bc.quote_item_id \n" +
  25. "left outer join \n" +
  26. " quote q on q.quote_id = qi.quote_id \n" +
  27. "left outer join \n" +
  28. " componentry c on c.comp_lib_id = bc.comp_lib_id and c.comp_id = bc.comp_id \n" +
  29. "where \n" +
  30. " 1=1";
  31. }
  32. }