LogikalGlass.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using InABox.Integration.Logikal;
  2. using System.Collections.Generic;
  3. namespace PRSDesktop.Integrations.Logikal
  4. {
  5. public class LogikalGlass : LogikalBOMItem, ILogikalGlass
  6. {
  7. public string Treatment { get; set; }
  8. public double Height { get; set; }
  9. public double Width { get; set; }
  10. public string Location { get; set; }
  11. public override void ValidateQuery(string sql, List<string> errors)
  12. {
  13. base.ValidateQuery(sql, errors);
  14. ValidateField(sql, nameof(Treatment), errors);
  15. ValidateField(sql, nameof(Height), errors);
  16. ValidateField(sql, nameof(Width), errors);
  17. ValidateField(sql, nameof(Location), errors);
  18. }
  19. public static string SQL = $@"
  20. select
  21. g.[Name] as {nameof(Code)},
  22. g.[Description] as {nameof(Description)},
  23. g.[width_output] as {nameof(Height)},
  24. g.[height_output] as {nameof(Width)},
  25. g.[Configuration] as {nameof(Treatment)},
  26. '' as {nameof(Location)},
  27. g.[Amount] as {nameof(Quantity)},
  28. g.[Price] as {nameof(Cost)}
  29. from
  30. glass g
  31. join
  32. insertions i on g.[insertionid] = i.[insertionid]
  33. join
  34. elevations e on i.[elevationid] = e.[elevationid]";
  35. }
  36. }