| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using InABox.Integration.Logikal;
- using System.Collections.Generic;
- namespace PRSDesktop.Integrations.Logikal
- {
- public class LogikalGlass : LogikalBOMItem, ILogikalGlass
- {
- public string Group { get; set; }
- public string Supplier { get; set; }
- public string Treatment { get; set; }
- public double Height { get; set; }
- public double Width { get; set; }
- public string Location { get; set; }
- public override void ValidateQuery(string sql, List<string> errors)
- {
- base.ValidateQuery(sql, errors);
- ValidateField(sql, nameof(Treatment), errors);
- ValidateField(sql, nameof(Height), errors);
- ValidateField(sql, nameof(Width), errors);
- ValidateField(sql, nameof(Location), errors);
- ValidateField(sql, nameof(Group), errors);
- ValidateField(sql, nameof(Supplier), errors);
- }
-
- public static string SQL = $@"select
- g.[Name] as [{nameof(Code)}],
- g.[Description] as [{nameof(Description)}],
- g.[width_output] as [{nameof(Height)}],
- g.[height_output] as [{nameof(Width)}],
- g.[Configuration] as [{nameof(Treatment)}],
- '' as [{nameof(Location)}],
- 'Glass' as [{nameof(Group)}],
- coalesce(s.[CustomerNo],s.[ActiveTitle]) as [{nameof(Supplier)}],
- g.[Amount] as [{nameof(Quantity)}],
- g.[Price] as [{nameof(Cost)}]
- from
- glass g
- join
- insertions i on g.[insertionid] = i.[insertionid]
- join
- elevations e on i.[elevationid] = e.[elevationid]
- left outer join
- suppliers s on g.[LK_SupplierID] = s.[SupplierID]";
-
- /*
- select
- g.[Name] as [{nameof(Code)}],
- g.[Description] as [{nameof(Description)}],
- g.[width_output] as [{nameof(Height)}],
- g.[height_output] as [{nameof(Width)}],
- g.[Configuration] as [{nameof(Treatment)}],
- '' as [{nameof(Location)}],
- d.[DiscountGroup] as [{nameof(Group)}],
- coalesce(s.[CustomerNo],s.[ActiveTitle]) as [{nameof(Supplier)}],
- g.[Amount] as [{nameof(Quantity)}],
- g.[Price] as [{nameof(Cost)}]
- from
- glass g
- join
- insertions i on g.[insertionid] = i.[insertionid]
- join
- elevations e on i.[elevationid] = e.[elevationid]
- join
- estimationdiscounts d on g.[LK_DiscountID] = d.[EstimationDiscountID]
- left outer join
- suppliers s on g.[LK_SupplierID] = s.[SupplierID]
- */
- }
- }
|