| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections.Generic;
- using InABox.Integration.Logikal;
- namespace PRSDesktop.Integrations.Logikal;
- public class LogikalGroup : LogikalItem, ILogikalGroup
- {
- public string Code { get; set; }
- public string Description { get; set; }
- public string Parent { get; set; }
-
- public override void ValidateQuery(string sql, List<string> errors)
- {
- ValidateField(sql, nameof(Code), errors);
- ValidateField(sql, nameof(Description), errors);
- ValidateField(sql, nameof(Parent), errors);
- }
-
- public static string SQL =
- $@"select distinct
- upper([group]) as [{nameof(Code)}],
- [group] as [{nameof(Description)}],
- '' as [{nameof(Parent)}]
- from (
- select case [ArticleType] when 2 then 'Profiles' when 5 then 'Gasket' when 8 then 'Components' when 30 then 'Fills' else '???' end as 'group' from articles
- union
- select case [ArticleType] when 2 then 'Profiles' when 5 then 'Gasket' when 8 then 'Components' when 30 then 'Fills' else '???' end as 'group' from profilebars
- union
- select 'Glass' as 'group' from glass
- )";
-
- /*
- select distinct
- cast(d.[DiscountGroup] as text) as [{nameof(Code)}],
- d.[name] as [{nameof(Description)}]
- from
- EstimationDiscounts d
- where
- coalesce(d.[DiscountGroup],'') <> ''
- */
- }
|