V6Elevation.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections.Generic;
  2. using InABox.Core;
  3. namespace PRSDesktop.Integrations.V6
  4. {
  5. public class V6Elevation : V6Object
  6. {
  7. [IntegerEditor(Visible=Visible.Hidden)]
  8. [EditorSequence(1)]
  9. [RequiredColumn]
  10. public int ID { get; set; }
  11. [TextBoxEditor(Visible=Visible.Default)]
  12. [EditorSequence(2)]
  13. public string Description { get; set; }
  14. [IntegerEditor(Visible=Visible.Default)]
  15. [EditorSequence(3)]
  16. public int Quantity { get; set; }
  17. public override void ValidateQuery(string sql, List<string> errors)
  18. {
  19. ValidateField(sql, nameof(Description), errors);
  20. ValidateField(sql, nameof(Quantity), errors);
  21. }
  22. public static string SQL = $@"select
  23. qi.quote_item_id as {nameof(ID)},
  24. qi.descr as {nameof(Description)},
  25. qi.quantity as {nameof(Quantity)}
  26. from
  27. Quote_item qi
  28. left outer join
  29. quote q on qi.quote_id = q.quote_id and qi.quote_vers_start <= q.quote_vers and qi.quote_vers_stop >= q.quote_vers
  30. where
  31. 1=1";
  32. }
  33. }