| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections.Generic;
- using InABox.Core;
- namespace PRSDesktop.Integrations.V6
- {
- public class V6Elevation : V6Object
- {
- [IntegerEditor(Visible=Visible.Hidden)]
- [EditorSequence(1)]
- [RequiredColumn]
- public int ID { get; set; }
-
- [TextBoxEditor(Visible=Visible.Default)]
- [EditorSequence(2)]
- public string Description { get; set; }
-
- [IntegerEditor(Visible=Visible.Default)]
- [EditorSequence(3)]
- public int Quantity { get; set; }
-
- [IntegerEditor(Visible=Visible.Default)]
- [EditorSequence(4)]
- public int Drawings { get; set; }
-
- public override void ValidateQuery(string sql, List<string> errors)
- {
- ValidateField(sql, nameof(Description), errors);
- ValidateField(sql, nameof(Quantity), errors);
- ValidateField(sql, nameof(Drawings), errors);
- }
- public static string SQL = $@"
- select
- qi.quote_item_id as {nameof(ID)},
- qi.descr as {nameof(Description)},
- qi.quantity as {nameof(Quantity)},
- qid.drawings as {nameof(Drawings)}
- from
- Quote_item qi
- join
- (select quote_item_id, count(*) as Drawings from quote_item_drawings group by quote_item_id) qid on qid.quote_item_id = qi.quote_item_id
- join
- 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
- where
- 1=1
- and
- qi.quote_vers_start <= q.quote_vers and qi.quote_vers_stop >= q.quote_vers";
- }
- }
|