From 548a5adc67813fca949764889161d2fdb5a77961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Thu, 13 Feb 2020 09:31:31 +0100 Subject: [PATCH 01/21] =?UTF-8?q?Przeniesienie=20logiki=20z=20przyk=C5=82a?= =?UTF-8?q?du=201=20(=20Soneta.Examples/Example1=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Punktacja/Punktacja/Punktacja.csproj | 3 + src/Samples/Samples/Config/Extender/Menu.cs | 20 +++ .../Config/Extender/SamplesConfigExtender.cs | 82 ++++++++++++ .../Config.SamplesConfigExtender.pageform.xml | 8 ++ .../TowaryUlubioneKontaktuViewInfo.cs | 121 ++++++++++++++++++ .../UI/TowaryUlubioneKontaktu.viewform.xml | 11 ++ src/Samples/Samples/Samples.csproj | 9 ++ src/Samples/Samples/Ultis/examples.ico | Bin 0 -> 9062 bytes 8 files changed, 254 insertions(+) create mode 100644 src/Samples/Samples/Config/Extender/Menu.cs create mode 100644 src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs create mode 100644 src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml create mode 100644 src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs create mode 100644 src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml create mode 100644 src/Samples/Samples/Ultis/examples.ico diff --git a/src/Punktacja/Punktacja/Punktacja.csproj b/src/Punktacja/Punktacja/Punktacja.csproj index aaf2dcb..58bcce8 100644 --- a/src/Punktacja/Punktacja/Punktacja.csproj +++ b/src/Punktacja/Punktacja/Punktacja.csproj @@ -3,4 +3,7 @@ net46 + + C:\Program Files (x86)\Common Files\Soneta\Assemblies\ + \ No newline at end of file diff --git a/src/Samples/Samples/Config/Extender/Menu.cs b/src/Samples/Samples/Config/Extender/Menu.cs new file mode 100644 index 0000000..4931126 --- /dev/null +++ b/src/Samples/Samples/Config/Extender/Menu.cs @@ -0,0 +1,20 @@ + +using Soneta.Business.Licence; +using Soneta.Business.UI; +using Samples.Lists.Extender; + + +[assembly: FolderView("Samples", + Priority = 10, + Description = "Przykłady implementacji enova365", + BrickColor = FolderViewAttribute.BlueBrick, + Icon = "Samples.Utils.examples.ico;Samples", + Contexts = new object[] { LicencjeModułu.All } +)] + +[assembly: FolderView("Samples/Towary własne", + Priority = 11, + Description = "Towary ulubione osoby kontaktowej", + TableName = "Towary", + ViewType = typeof(TowaryUlubioneKontaktuViewInfo) +)] \ No newline at end of file diff --git a/src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs b/src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs new file mode 100644 index 0000000..9e8b874 --- /dev/null +++ b/src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs @@ -0,0 +1,82 @@ +using System; +using Soneta.Business; +using Soneta.Config; +using Samples.Config.Extender; + +[assembly: Worker(typeof(SamplesConfigExtender))] + +namespace Samples.Config.Extender +{ + /// + /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples + /// + public class SamplesConfigExtender + { + [Context] + public Session Session { get; set; } + + public bool AktywneZakladkaSamples + { + get { return GetValue("AktywneZakladkaSamples", false); } + set { SetValue("AktywneZakladkaSamples", value, AttributeType._boolean); } + } + + // Pobranie wartości parametru "AktywneZakladkaSamples" + public static bool IsAktywneZakladkaSamples(Session session) + { + return GetValue(session, "AktywneZakladkaSamples", false); + } + + // Pobranie wartości parametrów konfiguracyjnych + private T GetValue(string name, T defaultValue) + { + return GetValue(Session, name, defaultValue); + } + + // Zapisanie wartośći parametrów konfiguracyjnych + private void SetValue(string name, T value, AttributeType type) + { + SetValue(Session, name, value, type); + } + + // Pobranie wartości parametrów konfiguracyjnych + private static T GetValue(Session session, string name, T defaultValue) + { + var cfgManager = new CfgManager(session); + var node = cfgManager.Root.FindSubNode("Samples", false); + if (node == null) return defaultValue; + + var nodeLeaf = node.FindSubNode("Konfiguracja", false); + if (nodeLeaf == null) return defaultValue; + + var attr = nodeLeaf.FindAttribute(name, false); + if (attr == null) return defaultValue; + + if (attr.Value == null) return defaultValue; + + return (T)attr.Value; + } + + // Ustawianie wartości parametrów konfiguracyjnych + private static void SetValue(Session session, string name, T value, AttributeType type) + { + using (var t = session.Logout(true)) + { + var cfgManager = new CfgManager(session); + var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? + cfgManager.Root.AddNode("Samples", CfgNodeType.Node); + + var node2 = node1.FindSubNode("Konfiguracja", false) ?? + node1.AddNode("Konfiguracja", CfgNodeType.Leaf); + + var attr = node2.FindAttribute(name, false); + if (attr == null) + node2.AddAttribute(name, type, value); + else + attr.Value = value; + + t.CommitUI(); + } + } + } +} \ No newline at end of file diff --git a/src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml b/src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml new file mode 100644 index 0000000..0a5e4d0 --- /dev/null +++ b/src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs new file mode 100644 index 0000000..f3be49e --- /dev/null +++ b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs @@ -0,0 +1,121 @@ +using Soneta.Business; +using Soneta.CRM; +using Samples.Config.Extender; +using Soneta.Towary; + +namespace Samples.Lists.Extender +{ + /// + /// Lista oparta na przykładzie pochodzącym z repozytorium Soneta.Examples - https://github.com/soneta/Examples (Example 1) + /// + /// + public class TowaryUlubioneKontaktuViewInfo : ViewInfo + { + + public TowaryUlubioneKontaktuViewInfo() + { + // View wiążemy z odpowiednią definicją viewform.xml poprzez property ResourceName + ResourceName = "TowaryUlubioneKontaktu"; + + // Inicjowanie contextu + InitContext += (sender, args) => { args.Context.TryAdd(() => new WParams(args.Context)); }; + + // Tworzenie view zawierającego konkretne dane + CreateView += TowaryWlasneViewInfo_CreateView; + } + + void TowaryWlasneViewInfo_CreateView(object sender, CreateViewEventArgs args) + { + WParams parameters; + if (!args.Context.Get(out parameters)) + return; + args.View = ViewCreate(parameters); + args.View.AllowNew = false; + } + + protected View ViewCreate(WParams pars) + { + + var condUlubione = RowCondition.Empty; + var rc = RowCondition.Empty; + var tm = TowaryModule.GetInstance(pars.Context.Session); + var view = tm.Towary.CreateView(); + + if (pars.KontaktOsoba == null) + condUlubione &= new FieldCondition.Null("Zapis", true); + else + condUlubione &= new FieldCondition.Equal("Zapis", pars.KontaktOsoba); + + rc &= new FieldCondition.Equal("Blokada", false); + rc &= new FieldCondition.Exists("TowaryUlubione", "Towar", condUlubione); + view.Condition &= rc; + + return view; + } + + #region Widoczność zakładki + + /// + /// Metoda pozwalająca na sterowanie widocznościa zakładki. + /// + /// + /// + /// true - widoczność zakładki, + /// false - zakładka niewidoczna + /// + public static bool IsVisible(Context context) + { + bool result; + using (var session = context.Login.CreateSession(true, true)) + { + result = SamplesConfigExtender.IsAktywneZakladkaSamples(session); + } + return result; + } + + #endregion Widoczność zakładki + } + + public class WParams : ContextBase + { + private const string Key = "Soneta.Examples.TowaryUlubione"; + + public WParams(Context context) : base(context) + { + Load(); + } + + public KontaktOsoba KontaktOsoba + { + get + { + if (Context.Contains(typeof(KontaktOsoba))) + return (KontaktOsoba)Context[typeof(KontaktOsoba)]; + return null; + } + set + { + Context[typeof(KontaktOsoba)] = value; + Save(); + } + } + + /// + /// Ładowanie parametrów z kontekstu login'a + /// + protected void Load() + { + var property = Context.LoadProperty(this, "KontaktOsoba", Key); + SetContext(typeof(KontaktOsoba), property); + } + + /// + /// Zapisywanie parametrów w kontekście login'a + /// + protected void Save() + { + Context.SaveProperty(this, "KontaktOsoba", Key); + } + } + +} diff --git a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml new file mode 100644 index 0000000..d56a1d5 --- /dev/null +++ b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/Samples/Samples/Samples.csproj b/src/Samples/Samples/Samples.csproj index 9b548a1..7a2106a 100644 --- a/src/Samples/Samples/Samples.csproj +++ b/src/Samples/Samples/Samples.csproj @@ -3,4 +3,13 @@ $(SonetaTargetFramework) + + C:\Program Files (x86)\Common Files\Soneta\Assemblies\ + + + + + + + diff --git a/src/Samples/Samples/Ultis/examples.ico b/src/Samples/Samples/Ultis/examples.ico new file mode 100644 index 0000000000000000000000000000000000000000..54045d6ea0551a6bf95d6087cfe3ed123e15cbe2 GIT binary patch literal 9062 zcmeI1e`r-@7{}jpcXgY)>8Kz=bE7C^`3tlqZ0?8K!as~8l!*R_q*4iWk>OvpO9&E} zf~7=676u9iWr)AY9~CW%6f}QEE;X_OHBFs4clvzKdC%RsclU1h+$los9nX2*_j#W0 z^L?N9{J8HqGsZD-Q(0-ym1aY^F^?Hz$0cS%i81G}l_T=ciyO1%-e6o}<_$5X`#xjF z2!k{riu0OP{$TJp&=qKFYm3dEJ-cY2d7|Q{O`CR4eSLi`a=fmtu5;?tsZY_bjGCv= zcsRE^@MKuv zpByz$q4DrO2;am^nK5I=utIa@i-U6}(w({f_8MH3Z=OQq;9hFE_OlKHh%mqjg5^DXY++^)KZRIMv`H>`m)(N zw`KBcY<*e}eieIKZEfv%Y!`S=zSLvQ-6Qr@=G#TSM}sJA4cPvcJsY=d_>R~)EDCVb zr%x}&{+&eqz}}B`h~JF-1aCs;0{ydc=i(0RV7iFCOwCo|V7y9W^tgUF)7+e^3NY@+zzld%}e@Ly`Qs!)0ua=gUG6jIySSUZ(Gs*#HiE2?lY6H7^ z0Q^Uy@+lt91oE!tO$`g}TE3IH#(j+~=40g}htB(0_4{kYK7t%X{?t8euZw>epYMw= z>?5|_^3Q@dj_8`xGqqLYTywzpGT2V!OSm5j;uwFReCYLIo?Lw!doZ}~^qWHNB>1by z&gSOk5kc;-#`hkwNbzAi`;EJ>pRhG;&&3PJQsf45k=S0pL)dG{vrGHuaQ=MyU`HXx zZEe@dvz76334J{?F4_70g{?N9oKa({tE-2@vyA+Ih$}4Eb>7x%Zx%Ig)OgKvmS8i)&lw2-m&f%e9W;lQ%kw*LLkGs_#xZZEn(W ze@mLvza-5v*BCa2#=Vg=yRRjkwU?64H|O^hU3EK(eZ1QiWb}0UcM3jks9EI?Qb(6- z&b#Kl`yUQGgEF`VgV(_S;~Gdk2yQ|r7V9gC6LTD=j|eA5>*F>1R{J$Qr$7GOCC0q@ z`H@Qrhr4kOn=JhUr@dLzS%#DJ(E9FfXAOX zfAQPYbXmht0Q5Zu(!;XwrRLc`xO4= zVk!~GJJQL%Pr-5XTUAxnP`$Ua2bzsUW(NB#`*d&r1pc+CGX(S8K=8c(-^sf|ql8?e zqVj{=4DJ;AB>HfFcb6c-cOTB#96XbkF{cx+PsTqxLlfHl9 z|7yghAG!m4V#^_YPdln_Bxt?cH-xc4AG_W+=Zu@b_-ud;^yn2IUBUM{^Jog<0}ZYf z-=}Du>rG|bkDUu}VNJ{-%kdfgw*$P@j^4kq9|&W@eX!^Bjf?nRPXcf)_!pqpja7&lx*YPzAhhD(> z%K42Dysn!Q$N}Vgx!XALn|QfS#;-DPLUFIPc|$9cg!)FB*4orAf~6)uFS( zm;-zXyTBI^$x+7g1-LN~_B?0oZQkqbc(Zb;#hvhCt2=)FV(-4LSh>y}x#knM{PX?p z@GU>OcWgW2CUzWiOZT4kzaRcT_K7a5Gbn>=@L#_MvOJpDx}|;Hb>i{VQ(57R)BU~U zQvqa(#}f(dc|8oFPH`epqP?R>%}zBz8{$)ldYHzExE~OAKzrj{ks&6R*mp2R@g6CzS&)I(gW_^9w literal 0 HcmV?d00001 From ed2d2b29659df9ee856e4cf4128f9189ee9a3020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 08:57:08 +0100 Subject: [PATCH 02/21] Towary ulubione z example1 --- src/Samples/Samples/Config/Extender/Menu.cs | 2 +- .../Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs | 11 +++-------- .../Lists/UI/TowaryUlubioneKontaktu.viewform.xml | 5 +++-- src/Samples/Samples/Samples.csproj | 5 +++++ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Samples/Samples/Config/Extender/Menu.cs b/src/Samples/Samples/Config/Extender/Menu.cs index 4931126..c055c1c 100644 --- a/src/Samples/Samples/Config/Extender/Menu.cs +++ b/src/Samples/Samples/Config/Extender/Menu.cs @@ -15,6 +15,6 @@ [assembly: FolderView("Samples/Towary własne", Priority = 11, Description = "Towary ulubione osoby kontaktowej", - TableName = "Towary", + TableName = "TowaryUlubione", ViewType = typeof(TowaryUlubioneKontaktuViewInfo) )] \ No newline at end of file diff --git a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs index f3be49e..327ee58 100644 --- a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs +++ b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs @@ -36,18 +36,13 @@ void TowaryWlasneViewInfo_CreateView(object sender, CreateViewEventArgs args) protected View ViewCreate(WParams pars) { - var condUlubione = RowCondition.Empty; var rc = RowCondition.Empty; var tm = TowaryModule.GetInstance(pars.Context.Session); - var view = tm.Towary.CreateView(); + var view = tm.TowaryUlubione.CreateView(); - if (pars.KontaktOsoba == null) - condUlubione &= new FieldCondition.Null("Zapis", true); - else - condUlubione &= new FieldCondition.Equal("Zapis", pars.KontaktOsoba); + if (pars.KontaktOsoba != null) + rc &= new FieldCondition.Equal("Zapis", pars.KontaktOsoba); - rc &= new FieldCondition.Equal("Blokada", false); - rc &= new FieldCondition.Exists("TowaryUlubione", "Towar", condUlubione); view.Condition &= rc; return view; diff --git a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml index d56a1d5..168eef0 100644 --- a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml +++ b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml @@ -5,7 +5,8 @@ - - + + + diff --git a/src/Samples/Samples/Samples.csproj b/src/Samples/Samples/Samples.csproj index 7a2106a..9153d05 100644 --- a/src/Samples/Samples/Samples.csproj +++ b/src/Samples/Samples/Samples.csproj @@ -12,4 +12,9 @@ + + + ..\..\..\..\..\..\..\..\Program Files (x86)\Soneta\enova365\Soneta.Business.dll + + From 09c19d44fa1c15c1b613d27ff01b1443f7dea2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 10:36:48 +0100 Subject: [PATCH 03/21] Open Kontakt and Towar in TowaryUlubione --- .../TowaryUlubioneKontaktuViewInfo.cs | 4 +- .../UI/TowaryUlubioneKontaktu.viewform.xml | 6 +-- .../TowaryUlubionePokazKontaktWorker.cs | 53 +++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs diff --git a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs index 327ee58..83f85b7 100644 --- a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs +++ b/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs @@ -30,7 +30,7 @@ void TowaryWlasneViewInfo_CreateView(object sender, CreateViewEventArgs args) if (!args.Context.Get(out parameters)) return; args.View = ViewCreate(parameters); - args.View.AllowNew = false; + //args.View.AllowNew = false; } protected View ViewCreate(WParams pars) @@ -73,7 +73,7 @@ public static bool IsVisible(Context context) public class WParams : ContextBase { - private const string Key = "Soneta.Examples.TowaryUlubione"; + private const string Key = "Samples.TowaryWlasne"; public WParams(Context context) : base(context) { diff --git a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml index 168eef0..6a1e0a7 100644 --- a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml +++ b/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml @@ -4,9 +4,9 @@ - - - + + + diff --git a/src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs b/src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs new file mode 100644 index 0000000..4492d83 --- /dev/null +++ b/src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Soneta.Business; +using Soneta.Commands; +using Soneta.Towary; +using Soneta.Types; + +[assembly: Worker(typeof(Samples.Workers.TowaryUlubionePokazKontaktWorker), + typeof(TowarUlubiony))] + +namespace Samples.Workers +{ + class TowaryUlubionePokazKontaktWorker + { + [Context] + public TowarUlubiony TowarUlubiony + { + get; + set; + } + + [Action("Pokaż osobę", Target = ActionTarget.ToolbarWithText, Mode = ActionMode.SingleSession, + CommandShortcut = CommandShortcut.Shift | CommandShortcut.F8, Priority = 10, Icon =ActionIcon.Phone)] + public Row PokazZapis() + { + Row zapis = TowarUlubiony.Zapis.Root; + + if (zapis is IRowWithHistory) + { + return (zapis as IRowWithHistory).Historia[Date.Today]; + } + + return zapis; + } + + [Action("Pokaż towar", Target = ActionTarget.ToolbarWithText, Mode = ActionMode.SingleSession, + Priority = 11, Icon = ActionIcon.Open)] + public Row PokazTowar() + { + Row towar = TowarUlubiony.Towar; + + if (towar is IRowWithHistory) + { + return (towar as IRowWithHistory).Historia[Date.Today]; + } + + return towar; + } + } +} From d1154b93ce374913bc60fc2af4716bb5360a0815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 11:31:33 +0100 Subject: [PATCH 04/21] Logika z Example 2 --- .../Extender/KontrahentNewOgolneExtender.cs | 41 ++++++++++++++++ .../TowaryUlubionePokazKontaktWorker.cs | 6 +-- ...ontrahent.KontrahentNewOgolne.pageform.xml | 47 +++++++++++++++++++ 3 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs rename src/Samples/Samples/{Workers => Lists/Extender}/TowaryUlubionePokazKontaktWorker.cs (89%) create mode 100644 src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml diff --git a/src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs b/src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs new file mode 100644 index 0000000..ce418a7 --- /dev/null +++ b/src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Soneta.Business; +using Soneta.Business.Db; +using Soneta.CRM; +using Samples.Lists.Extender; + +[assembly: Worker(typeof(KontrahentNewOgolneExtender))] + +namespace Samples.Lists.Extender +{ + class KontrahentNewOgolneExtender + { + // Atrybut Context pozwala na wskazanie mechanizmowi tworzenia extenderów + // jakie property powinny zostać ustawione automatycznie po utworzeniu obiektu + // extendera. Jeśli w kontekście istnieje obiekt pasujący typem do opisanego + // atrybutem property, to po utworzeniu obiektu extendera wartość property zostanie + // ustawiona wartością znajdującą sie w kontekście (obiekt Context). + [Context] + public Kontrahent Kontrahent { get; set; } + + public Image Logo + { + get + { + // Wyszukujemy w załącznikach pierwszy o typie obraz, który jest oznaczony jako domyślny + foreach (Attachment attachemnt in Kontrahent.Attachments) + if (attachemnt.SubType == SubTypeType.Picture && attachemnt.IsDefault) + // i zwracamy go na zewnątrz + return attachemnt.DataAsImage; + + // lub zwracamy null + return null; + } + } + } +} diff --git a/src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs b/src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs similarity index 89% rename from src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs rename to src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs index 4492d83..4717957 100644 --- a/src/Samples/Samples/Workers/TowaryUlubionePokazKontaktWorker.cs +++ b/src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs @@ -7,11 +7,11 @@ using Soneta.Commands; using Soneta.Towary; using Soneta.Types; +using Samples.Lists.Extender; -[assembly: Worker(typeof(Samples.Workers.TowaryUlubionePokazKontaktWorker), - typeof(TowarUlubiony))] +[assembly: Worker(typeof(TowaryUlubionePokazKontaktWorker), typeof(TowarUlubiony))] -namespace Samples.Workers +namespace Samples.Lists.Extender { class TowaryUlubionePokazKontaktWorker { diff --git a/src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml b/src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml new file mode 100644 index 0000000..e6d3e90 --- /dev/null +++ b/src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From dcb85c514089ba383da10356b26dd2bd3bb94383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 14:17:34 +0100 Subject: [PATCH 05/21] Configuration fixes --- Directory.Build.props | 2 +- src/Punktacja/Punktacja/Punktacja.csproj | 5 ++++- src/Samples/Samples/Samples.csproj | 6 ++---- .../Soneta.Szkolenie.UI/Soneta.Szkolenie.UI.csproj | 3 +++ .../Soneta.Szkolenie/Soneta.Szkolenie.csproj | 3 +++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 6ace6ea..4737b9e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,6 @@ net46 false true - D:\Dodatki\ + \ No newline at end of file diff --git a/src/Punktacja/Punktacja/Punktacja.csproj b/src/Punktacja/Punktacja/Punktacja.csproj index 58bcce8..4d485c1 100644 --- a/src/Punktacja/Punktacja/Punktacja.csproj +++ b/src/Punktacja/Punktacja/Punktacja.csproj @@ -1,9 +1,12 @@  - net46 + $(SonetaTargetFramework) C:\Program Files (x86)\Common Files\Soneta\Assemblies\ + + + \ No newline at end of file diff --git a/src/Samples/Samples/Samples.csproj b/src/Samples/Samples/Samples.csproj index 9153d05..5955eca 100644 --- a/src/Samples/Samples/Samples.csproj +++ b/src/Samples/Samples/Samples.csproj @@ -4,7 +4,7 @@ $(SonetaTargetFramework) - C:\Program Files (x86)\Common Files\Soneta\Assemblies\ + @@ -13,8 +13,6 @@ - - ..\..\..\..\..\..\..\..\Program Files (x86)\Soneta\enova365\Soneta.Business.dll - + diff --git a/src/Soneta.Szkolenie/Soneta.Szkolenie.UI/Soneta.Szkolenie.UI.csproj b/src/Soneta.Szkolenie/Soneta.Szkolenie.UI/Soneta.Szkolenie.UI.csproj index cff10fb..ce9413b 100644 --- a/src/Soneta.Szkolenie/Soneta.Szkolenie.UI/Soneta.Szkolenie.UI.csproj +++ b/src/Soneta.Szkolenie/Soneta.Szkolenie.UI/Soneta.Szkolenie.UI.csproj @@ -6,4 +6,7 @@ + + + \ No newline at end of file diff --git a/src/Soneta.Szkolenie/Soneta.Szkolenie/Soneta.Szkolenie.csproj b/src/Soneta.Szkolenie/Soneta.Szkolenie/Soneta.Szkolenie.csproj index 7a7dbb7..e6b3e61 100644 --- a/src/Soneta.Szkolenie/Soneta.Szkolenie/Soneta.Szkolenie.csproj +++ b/src/Soneta.Szkolenie/Soneta.Szkolenie/Soneta.Szkolenie.csproj @@ -14,4 +14,7 @@ Szkolenie.business.xml + + + \ No newline at end of file From 9ea2ae3389b7196ade6fadcf4caebab636255e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 14:21:23 +0100 Subject: [PATCH 06/21] remove AggregateOutput from Directory.build.props --- Directory.Build.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4737b9e..6aecb9b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,5 @@ 2001.0.0 net46 false - true - \ No newline at end of file From f96de7b6d62e2e188307b7462808f986691f8d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 14:30:43 +0100 Subject: [PATCH 07/21] Delete unused and corrupted sln --- src/Samples/Samples.sln | 90 ----------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 src/Samples/Samples.sln diff --git a/src/Samples/Samples.sln b/src/Samples/Samples.sln deleted file mode 100644 index afa1051..0000000 --- a/src/Samples/Samples.sln +++ /dev/null @@ -1,90 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.352 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples", "Samples\Samples.csproj", "{D939A54E-F862-4B24-8CCF-1504134C12A8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Tests", "tests\Samples.Tests\Samples.Tests.csproj", "{49A48ABE-D1FC-418B-A5EC-EEA05697A610}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D48F2BCD-EE52-4313-A89C-315D7FF878CB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{2F98833B-3F8B-41E1-BCA6-06DF03806103}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - global.json = global.json - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnovaDB", "EnovaDB\EnovaDB.csproj", "{4FC4954B-C8AF-4159-8B6E-24F11C605690}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Integration.Tests", "tests\Samples.Integration.Tests\Samples.Integration.Tests.csproj", "{A165F379-C215-49B4-99E1-2F1F3BDEDDB4}" - ProjectSection(ProjectDependencies) = postProject - {D939A54E-F862-4B24-8CCF-1504134C12A8} = {D939A54E-F862-4B24-8CCF-1504134C12A8} - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnovaDB.Integration.Tests", "tests\EnovaDB.Tests\EnovaDB.Integration.Tests.csproj", "{2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}" - ProjectSection(ProjectDependencies) = postProject - {4FC4954B-C8AF-4159-8B6E-24F11C605690} = {4FC4954B-C8AF-4159-8B6E-24F11C605690} - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soneta.Szkolenie", "Soneta.Szkolenie\Soneta.Szkolenie.csproj", "{5110FB90-B5CA-48B9-B518-CB2764F4CA5F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soneta.Szkolenie.UI", "Soneta.Szkolenie.UI\Soneta.Szkolenie.UI.csproj", "{9F525776-985A-4D51-8B92-E530B97D9545}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soneta.Szkolenie.Tests", "tests\Soneta.Szkolenie.Tests\Soneta.Szkolenie.Tests.csproj", "{CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}" - ProjectSection(ProjectDependencies) = postProject - {5110FB90-B5CA-48B9-B518-CB2764F4CA5F} = {5110FB90-B5CA-48B9-B518-CB2764F4CA5F} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|Any CPU.Build.0 = Release|Any CPU - {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|Any CPU.Build.0 = Release|Any CPU - {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|Any CPU.Build.0 = Release|Any CPU - {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|Any CPU.Build.0 = Release|Any CPU - {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|Any CPU.Build.0 = Release|Any CPU - {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|Any CPU.Build.0 = Release|Any CPU - {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F525776-985A-4D51-8B92-E530B97D9545}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F525776-985A-4D51-8B92-E530B97D9545}.Release|Any CPU.Build.0 = Release|Any CPU - {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {49A48ABE-D1FC-418B-A5EC-EEA05697A610} = {D48F2BCD-EE52-4313-A89C-315D7FF878CB} - {A165F379-C215-49B4-99E1-2F1F3BDEDDB4} = {D48F2BCD-EE52-4313-A89C-315D7FF878CB} - {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C} = {D48F2BCD-EE52-4313-A89C-315D7FF878CB} - {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7} = {D48F2BCD-EE52-4313-A89C-315D7FF878CB} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} - EndGlobalSection -EndGlobal From 6bc9cf022b6ee5bbe6097e85c5bc0fe46644de54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 15:37:07 +0100 Subject: [PATCH 08/21] Change project structure --- .../{Config => Example1}/Extender/Menu.cs | 4 +-- .../Extender/TowaryUlubioneConfigExtender.cs} | 8 ++--- .../TowaryUlubioneKontaktuViewInfo.cs | 5 ++-- .../TowaryUlubionePokazKontaktWorker.cs | 4 +-- src/Samples/Samples/Example1/Readme.md | 29 +++++++++++++++++++ .../UI/Config.TowaryUlubione.pageform.xml} | 2 +- .../UI/TowaryUlubioneKontaktu.viewform.xml | 0 7 files changed, 39 insertions(+), 13 deletions(-) rename src/Samples/Samples/{Config => Example1}/Extender/Menu.cs (85%) rename src/Samples/Samples/{Config/Extender/SamplesConfigExtender.cs => Example1/Extender/TowaryUlubioneConfigExtender.cs} (92%) rename src/Samples/Samples/{Lists => Example1}/Extender/TowaryUlubioneKontaktuViewInfo.cs (95%) rename src/Samples/Samples/{Lists => Example1}/Extender/TowaryUlubionePokazKontaktWorker.cs (95%) create mode 100644 src/Samples/Samples/Example1/Readme.md rename src/Samples/Samples/{Config/UI/Config.SamplesConfigExtender.pageform.xml => Example1/UI/Config.TowaryUlubione.pageform.xml} (72%) rename src/Samples/Samples/{Lists => Example1}/UI/TowaryUlubioneKontaktu.viewform.xml (100%) diff --git a/src/Samples/Samples/Config/Extender/Menu.cs b/src/Samples/Samples/Example1/Extender/Menu.cs similarity index 85% rename from src/Samples/Samples/Config/Extender/Menu.cs rename to src/Samples/Samples/Example1/Extender/Menu.cs index c055c1c..809f6a4 100644 --- a/src/Samples/Samples/Config/Extender/Menu.cs +++ b/src/Samples/Samples/Example1/Extender/Menu.cs @@ -1,14 +1,12 @@  using Soneta.Business.Licence; using Soneta.Business.UI; -using Samples.Lists.Extender; - +using Samples.Example1.Extender; [assembly: FolderView("Samples", Priority = 10, Description = "Przykłady implementacji enova365", BrickColor = FolderViewAttribute.BlueBrick, - Icon = "Samples.Utils.examples.ico;Samples", Contexts = new object[] { LicencjeModułu.All } )] diff --git a/src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs b/src/Samples/Samples/Example1/Extender/TowaryUlubioneConfigExtender.cs similarity index 92% rename from src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs rename to src/Samples/Samples/Example1/Extender/TowaryUlubioneConfigExtender.cs index 9e8b874..4c1fcf5 100644 --- a/src/Samples/Samples/Config/Extender/SamplesConfigExtender.cs +++ b/src/Samples/Samples/Example1/Extender/TowaryUlubioneConfigExtender.cs @@ -1,16 +1,16 @@ using System; using Soneta.Business; using Soneta.Config; -using Samples.Config.Extender; +using Samples.Example1.Extender; -[assembly: Worker(typeof(SamplesConfigExtender))] +[assembly: Worker(typeof(TowaryUlubioneConfigExtender))] -namespace Samples.Config.Extender +namespace Samples.Example1.Extender { /// /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples /// - public class SamplesConfigExtender + public class TowaryUlubioneConfigExtender { [Context] public Session Session { get; set; } diff --git a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs b/src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs similarity index 95% rename from src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs rename to src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs index 83f85b7..791263a 100644 --- a/src/Samples/Samples/Lists/Extender/TowaryUlubioneKontaktuViewInfo.cs +++ b/src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs @@ -1,9 +1,8 @@ using Soneta.Business; using Soneta.CRM; -using Samples.Config.Extender; using Soneta.Towary; -namespace Samples.Lists.Extender +namespace Samples.Example1.Extender { /// /// Lista oparta na przykładzie pochodzącym z repozytorium Soneta.Examples - https://github.com/soneta/Examples (Example 1) @@ -63,7 +62,7 @@ public static bool IsVisible(Context context) bool result; using (var session = context.Login.CreateSession(true, true)) { - result = SamplesConfigExtender.IsAktywneZakladkaSamples(session); + result = TowaryUlubioneConfigExtender.IsAktywneZakladkaSamples(session); } return result; } diff --git a/src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs b/src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs similarity index 95% rename from src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs rename to src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs index 4717957..6fdddc4 100644 --- a/src/Samples/Samples/Lists/Extender/TowaryUlubionePokazKontaktWorker.cs +++ b/src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs @@ -7,11 +7,11 @@ using Soneta.Commands; using Soneta.Towary; using Soneta.Types; -using Samples.Lists.Extender; +using Samples.Example1.Extender; [assembly: Worker(typeof(TowaryUlubionePokazKontaktWorker), typeof(TowarUlubiony))] -namespace Samples.Lists.Extender +namespace Samples.Example1.Extender { class TowaryUlubionePokazKontaktWorker { diff --git a/src/Samples/Samples/Example1/Readme.md b/src/Samples/Samples/Example1/Readme.md new file mode 100644 index 0000000..d478c3e --- /dev/null +++ b/src/Samples/Samples/Example1/Readme.md @@ -0,0 +1,29 @@ +### Example 1 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje możliwość zastosowania własnej listy w oparciu o istniejące obiekty enova. Zawiera zdefiniowane własne View, z którym została powiązana odpowiednia definicja w postaci struktury viewform.xml. + +W wyniku zastosowania dodatku, powinna pojawić się dodatkowa grupa w menu głównym programu o nazwie *Samples* z opcją *"Towary własne"*, po wybraniu której pojawi się zaimplementowana lista. + +* Extender\TowaryUlubioneKontaktuViewInfo.cs + + Przykładowan klasa z implementacją View zbudowanego na bazie tabel enova. +* Extender\Menu.cs + + Rejestracja listy dla View + +* UI\TowaryUlubioneKontaktu.viewform.xml + + Definicja page'a dla View + +* UI\Config.TowaryUlubione.pageform.xml + + Definicja formularza ustawień w Narzędzia/Opcje... + +* Extender\TowaryUlubioneConfigExtender.cs + + Obsługa zapisu ustawień w Narzędzia/Opcje... + +* Extender\TowaryUlubionePokazKontaktWorker.cs + + Rejestracja akcji dla listy towarów ulubionych otwarcia powiazanych rekordów \ No newline at end of file diff --git a/src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml similarity index 72% rename from src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml rename to src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml index 0a5e4d0..204edab 100644 --- a/src/Samples/Samples/Config/UI/Config.SamplesConfigExtender.pageform.xml +++ b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml @@ -1,6 +1,6 @@ - + diff --git a/src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml b/src/Samples/Samples/Example1/UI/TowaryUlubioneKontaktu.viewform.xml similarity index 100% rename from src/Samples/Samples/Lists/UI/TowaryUlubioneKontaktu.viewform.xml rename to src/Samples/Samples/Example1/UI/TowaryUlubioneKontaktu.viewform.xml From 0f2e4d841e7b0c84b24eb2fc68831c05e0502195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 17 Feb 2020 15:54:12 +0100 Subject: [PATCH 09/21] Example2 --- .../UI/Config.TowaryUlubione.pageform.xml | 2 +- .../Extender/KontrahentNewOgolneExtender.cs | 4 ++-- src/Samples/Samples/Example2/Readme.md | 20 +++++++++++++++++++ ...ontrahent.KontrahentNewOgolne.pageform.xml | 0 4 files changed, 23 insertions(+), 3 deletions(-) rename src/Samples/Samples/{Lists => Example2}/Extender/KontrahentNewOgolneExtender.cs (95%) create mode 100644 src/Samples/Samples/Example2/Readme.md rename src/Samples/Samples/{Lists => Example2}/UI/Kontrahent.KontrahentNewOgolne.pageform.xml (100%) diff --git a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml index 204edab..6356672 100644 --- a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml +++ b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs b/src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs similarity index 95% rename from src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs rename to src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs index ce418a7..2162bd0 100644 --- a/src/Samples/Samples/Lists/Extender/KontrahentNewOgolneExtender.cs +++ b/src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs @@ -7,11 +7,11 @@ using Soneta.Business; using Soneta.Business.Db; using Soneta.CRM; -using Samples.Lists.Extender; +using Samples.Example2.Extender; [assembly: Worker(typeof(KontrahentNewOgolneExtender))] -namespace Samples.Lists.Extender +namespace Samples.Example2.Extender { class KontrahentNewOgolneExtender { diff --git a/src/Samples/Samples/Example2/Readme.md b/src/Samples/Samples/Example2/Readme.md new file mode 100644 index 0000000..fd028cc --- /dev/null +++ b/src/Samples/Samples/Example2/Readme.md @@ -0,0 +1,20 @@ +### Example 2 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje możliwość podpięcia dodatkowej zakładki użytkownika dla klasy *Kontrahent*. +Implementacja dodatkowego extendera pokazuje w jaki sposób można dodawać własne informacje +w postaci różnych danych (np. dodatkowe pola nie związane z logiką enova365). W przypadku +zakładki wprowadzone zostało dodatkowe pole wyświetlające logo kontrahenta. Aby logo +się pojawiło konieczne jest wstawienie kontrahentowi załącznika o nazwie *logo.png*. + +W wyniku zastosowania dodatku, powinna pojawić się dodatkowa zakładka na formularzu +kontrahenta, która oprócz danych standardowych zakładki ogólnej będzie posiadała również +logo kontrahenta. + + +* Extender\KontrahentNewOgolneExtender + + Przykładowan klasa implementująca property Logo, które zostało umieszczone na dodatkowej zakładce +* UI\Kontrahent.KontrahentNewOgolne.pageform.xml + + Definicja dodatkowej zakładki \ No newline at end of file diff --git a/src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml b/src/Samples/Samples/Example2/UI/Kontrahent.KontrahentNewOgolne.pageform.xml similarity index 100% rename from src/Samples/Samples/Lists/UI/Kontrahent.KontrahentNewOgolne.pageform.xml rename to src/Samples/Samples/Example2/UI/Kontrahent.KontrahentNewOgolne.pageform.xml From e429e14235a1599dd280eb28b78f4c3f6579ef91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Tue, 18 Feb 2020 08:26:18 +0100 Subject: [PATCH 10/21] Example3 --- .../UI/Config.TowaryUlubione.pageform.xml | 2 +- src/Samples/Samples/Example3/Extender/Menu.cs | 20 +++++ .../Extender/TowaryZakladkaViewInfo.cs | 35 ++++++++ .../Extender/ZakladkaTowaryConfigExtender.cs | 82 +++++++++++++++++++ src/Samples/Samples/Example3/Readme.md | 23 ++++++ ...Config.Zak\305\202adkaTowary.pageform.xml" | 10 +++ 6 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 src/Samples/Samples/Example3/Extender/Menu.cs create mode 100644 src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs create mode 100644 src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs create mode 100644 src/Samples/Samples/Example3/Readme.md create mode 100644 "src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" diff --git a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml index 6356672..3279bd1 100644 --- a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml +++ b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml @@ -1,6 +1,6 @@ - + diff --git a/src/Samples/Samples/Example3/Extender/Menu.cs b/src/Samples/Samples/Example3/Extender/Menu.cs new file mode 100644 index 0000000..91f72c6 --- /dev/null +++ b/src/Samples/Samples/Example3/Extender/Menu.cs @@ -0,0 +1,20 @@ + +using Soneta.Business.Licence; +using Soneta.Business.UI; +using Samples.Example3.Extender; + +/* +[assembly: FolderView("Samples", + Priority = 10, + Description = "Przykłady implementacji enova365", + BrickColor = FolderViewAttribute.BlueBrick, + Contexts = new object[] { LicencjeModułu.All } +)] +*/ + +[assembly: FolderView("Samples/Zakladka Towary", + Priority = 11, + Description = "Towary - zakladka", + TableName = "Towary", + ViewType = typeof(TowaryZakladkaViewInfo) +)] \ No newline at end of file diff --git a/src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs b/src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs new file mode 100644 index 0000000..800ec61 --- /dev/null +++ b/src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs @@ -0,0 +1,35 @@ +using Soneta.Business; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Samples.Example3.Extender +{ + public class TowaryZakladkaViewInfo : ViewInfo + { + public TowaryZakladkaViewInfo() + { + + } + + /// + /// Metoda pozwalająca na sterowanie widocznościa zakładki. + /// + /// + /// + /// true - widoczność zakładki, + /// false - zakładka niewidoczna + /// + public static bool IsVisible(Context context) + { + bool result; + using (var session = context.Login.CreateSession(true, true)) + { + result = ZakladkaTowaryConfigExtender.IsAktywneZakladkaTowary(session); + } + return result; + } + } +} diff --git a/src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs b/src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs new file mode 100644 index 0000000..ff7c990 --- /dev/null +++ b/src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs @@ -0,0 +1,82 @@ +using System; +using Soneta.Business; +using Soneta.Config; +using Samples.Example3.Extender; + +[assembly: Worker(typeof(ZakladkaTowaryConfigExtender))] + +namespace Samples.Example3.Extender +{ + /// + /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples + /// + public class ZakladkaTowaryConfigExtender + { + [Context] + public Session Session { get; set; } + + public bool AktywneZakladkaTowary + { + get { return GetValue("AktywneZakladkaTowary", false); } + set { SetValue("AktywneZakladkaTowary", value, AttributeType._boolean); } + } + + // Pobranie wartości parametru "AktywneZakladkaTowary" + public static bool IsAktywneZakladkaTowary(Session session) + { + return GetValue(session, "AktywneZakladkaTowary", false); + } + + // Pobranie wartości parametrów konfiguracyjnych + private T GetValue(string name, T defaultValue) + { + return GetValue(Session, name, defaultValue); + } + + // Zapisanie wartośći parametrów konfiguracyjnych + private void SetValue(string name, T value, AttributeType type) + { + SetValue(Session, name, value, type); + } + + // Pobranie wartości parametrów konfiguracyjnych + private static T GetValue(Session session, string name, T defaultValue) + { + var cfgManager = new CfgManager(session); + var node = cfgManager.Root.FindSubNode("Samples", false); + if (node == null) return defaultValue; + + var nodeLeaf = node.FindSubNode("Konfiguracja", false); + if (nodeLeaf == null) return defaultValue; + + var attr = nodeLeaf.FindAttribute(name, false); + if (attr == null) return defaultValue; + + if (attr.Value == null) return defaultValue; + + return (T)attr.Value; + } + + // Ustawianie wartości parametrów konfiguracyjnych + private static void SetValue(Session session, string name, T value, AttributeType type) + { + using (var t = session.Logout(true)) + { + var cfgManager = new CfgManager(session); + var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? + cfgManager.Root.AddNode("Samples", CfgNodeType.Node); + + var node2 = node1.FindSubNode("Konfiguracja", false) ?? + node1.AddNode("Konfiguracja", CfgNodeType.Leaf); + + var attr = node2.FindAttribute(name, false); + if (attr == null) + node2.AddAttribute(name, type, value); + else + attr.Value = value; + + t.CommitUI(); + } + } + } +} \ No newline at end of file diff --git a/src/Samples/Samples/Example3/Readme.md b/src/Samples/Samples/Example3/Readme.md new file mode 100644 index 0000000..f062033 --- /dev/null +++ b/src/Samples/Samples/Example3/Readme.md @@ -0,0 +1,23 @@ +### Example 3 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje możliwość podpięcia własnej zakładki konfiguracyjnej dla potrzeb własnego dodatku. +W przykładzie zastosowano mechanizm tworzenia ustawień konfiguracji bezpośrednio w kodzie programu, bez stosowania pliku *config.xml*. + +* Extender\Menu.cs + + Rejestracja listy dla View + +* UI\Config.ZakładkaTowary.pageform.xml + + Definicja formularza ustawień w Narzędzia/Opcje... + + +* Extender\ZakladkaTowaryConfigExtender.cs + + Obsługa zapisu i odczytu ustawień + + +* Extender\TowaryZakladkaViewInfo.cs + + Implementacja View ograniczona do sterowania widocznością zakładki. diff --git "a/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" "b/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" new file mode 100644 index 0000000..7f92650 --- /dev/null +++ "b/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" @@ -0,0 +1,10 @@ + + + + + + + + + + From 4626931ffdadea61c124df2f2eaaf3cc132cd101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Tue, 18 Feb 2020 08:41:40 +0100 Subject: [PATCH 11/21] =?UTF-8?q?Poprawki=20wy=C5=9Bwietlania=20labelek?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Example1/UI/Config.TowaryUlubione.pageform.xml | 4 ++-- src/Samples/Samples/Example3/Extender/Menu.cs | 2 +- .../Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml index 3279bd1..cb928de 100644 --- a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml +++ b/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml @@ -1,8 +1,8 @@ - - + + diff --git a/src/Samples/Samples/Example3/Extender/Menu.cs b/src/Samples/Samples/Example3/Extender/Menu.cs index 91f72c6..de86862 100644 --- a/src/Samples/Samples/Example3/Extender/Menu.cs +++ b/src/Samples/Samples/Example3/Extender/Menu.cs @@ -12,7 +12,7 @@ )] */ -[assembly: FolderView("Samples/Zakladka Towary", +[assembly: FolderView("Samples/Zakladka towary", Priority = 11, Description = "Towary - zakladka", TableName = "Towary", diff --git "a/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" "b/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" index 7f92650..2d80898 100644 --- "a/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" +++ "b/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" @@ -3,7 +3,7 @@ - + From 41eeb12e00517afd6265bc75c02f9d7817ff667f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Wed, 19 Feb 2020 12:15:13 +0100 Subject: [PATCH 12/21] Separate Examples to simple csproj --- README.md | 6 -- Samples.sln | 81 +++++++++++++++++ .../Example1.Config/Directory.Build.props | 7 ++ .../Example1.Config/Example1.Config.csproj | 6 ++ src/Example1/Example1.Config/global.json | 5 ++ .../Example1.Tests/Example1.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 ++++ src/Example1/Example1.UI/Example1.UI.csproj | 6 ++ .../UI/Config.TowaryUlubione.pageform.xml | 0 .../UI/TowaryUlubioneKontaktu.viewform.xml | 0 .../Example1.UI/ViewInfo}/Menu.cs | 2 +- .../TowaryUlubioneKontaktuViewInfo.cs | 2 +- .../Workers/TowaryUlubioneConfigExtender.cs | 82 ++++++++++++++++++ .../TowaryUlubionePokazKontaktWorker.cs | 4 +- src/Example1/Example1/Example1.csproj | 15 ++++ .../Example1}/TowaryUlubioneConfigExtender.cs | 0 src/Example1/README.md | 29 +++++++ .../Example2.Tests/Example2.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 ++++ src/Example2/Example2.UI/Example2.UI.csproj | 6 ++ .../Extender/KontrahentNewOgolneExtender.cs | 4 +- ...ontrahent.KontrahentNewOgolne.pageform.xml | 0 src/Example2/Example2/Example2.csproj | 9 ++ src/{Samples/Samples => }/Example2/Readme.md | 0 .../Example3.Tests/Example3.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 ++++ src/Example3/Example3.UI/Example3.UI.csproj | 6 ++ .../Extender/ZakladkaTowaryConfigExtender.cs | 6 +- ...Config.Zak\305\202adkaTowary.pageform.xml" | 0 .../Example3.UI/ViewInfo}/Menu.cs | 6 +- .../ViewInfo}/TowaryZakladkaViewInfo.cs | 2 +- src/Example3/Example3/Example3.csproj | 6 ++ src/Samples/Samples/Example1/Readme.md | 29 ------- src/Samples/Samples/Samples.csproj | 8 +- src/Samples/Samples/Ultis/examples.ico | Bin 9062 -> 0 bytes 35 files changed, 345 insertions(+), 51 deletions(-) delete mode 100644 README.md create mode 100644 src/Example1/Example1.Config/Directory.Build.props create mode 100644 src/Example1/Example1.Config/Example1.Config.csproj create mode 100644 src/Example1/Example1.Config/global.json create mode 100644 src/Example1/Example1.Tests/Example1.Tests.csproj create mode 100644 src/Example1/Example1.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example1/Example1.UI/Example1.UI.csproj rename src/{Samples/Samples/Example1 => Example1/Example1.UI}/UI/Config.TowaryUlubione.pageform.xml (100%) rename src/{Samples/Samples/Example1 => Example1/Example1.UI}/UI/TowaryUlubioneKontaktu.viewform.xml (100%) rename src/{Samples/Samples/Example1/Extender => Example1/Example1.UI/ViewInfo}/Menu.cs (93%) rename src/{Samples/Samples/Example1/Extender => Example1/Example1.UI/ViewInfo}/TowaryUlubioneKontaktuViewInfo.cs (98%) create mode 100644 src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs rename src/{Samples/Samples/Example1/Extender => Example1/Example1.UI/Workers}/TowaryUlubionePokazKontaktWorker.cs (94%) create mode 100644 src/Example1/Example1/Example1.csproj rename src/{Samples/Samples/Example1/Extender => Example1/Example1}/TowaryUlubioneConfigExtender.cs (100%) create mode 100644 src/Example1/README.md create mode 100644 src/Example2/Example2.Tests/Example2.Tests.csproj create mode 100644 src/Example2/Example2.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example2/Example2.UI/Example2.UI.csproj rename src/{Samples/Samples/Example2 => Example2/Example2.UI}/Extender/KontrahentNewOgolneExtender.cs (94%) rename src/{Samples/Samples/Example2 => Example2/Example2.UI}/UI/Kontrahent.KontrahentNewOgolne.pageform.xml (100%) create mode 100644 src/Example2/Example2/Example2.csproj rename src/{Samples/Samples => }/Example2/Readme.md (100%) create mode 100644 src/Example3/Example3.Tests/Example3.Tests.csproj create mode 100644 src/Example3/Example3.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example3/Example3.UI/Example3.UI.csproj rename src/{Samples/Samples/Example3 => Example3/Example3.UI}/Extender/ZakladkaTowaryConfigExtender.cs (95%) rename "src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" => "src/Example3/Example3.UI/UI/Config.Zak\305\202adkaTowary.pageform.xml" (100%) rename src/{Samples/Samples/Example3/Extender => Example3/Example3.UI/ViewInfo}/Menu.cs (92%) rename src/{Samples/Samples/Example3/Extender => Example3/Example3.UI/ViewInfo}/TowaryZakladkaViewInfo.cs (95%) create mode 100644 src/Example3/Example3/Example3.csproj delete mode 100644 src/Samples/Samples/Example1/Readme.md delete mode 100644 src/Samples/Samples/Ultis/examples.ico diff --git a/README.md b/README.md deleted file mode 100644 index 76d1cf5..0000000 --- a/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Samples - -Repozytorium zawiera szereg przykładów pokazujących możliwości oraz sposób tworzenia dodatków dla enova365: - -* folder [doc](./doc) zawiera ich indywidualną dokumentację -* w folderze [src](./src) znajduje się ich kod źródłowy diff --git a/Samples.sln b/Samples.sln index cc19963..27c1cba 100644 --- a/Samples.sln +++ b/Samples.sln @@ -40,6 +40,37 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soneta.Szkolenie.Tests", "s {5110FB90-B5CA-48B9-B518-CB2764F4CA5F} = {5110FB90-B5CA-48B9-B518-CB2764F4CA5F} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9988A292-3657-421B-BFBA-55C479DE1216}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example2", "Example2", "{170192A9-6512-46E0-843E-F1E4184C24D4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example2", "src\Example2\Example2\Example2.csproj", "{AE8400E0-6DE5-4857-9306-28C29C089A44}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example2.UI", "src\Example2\Example2.UI\Example2.UI.csproj", "{C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example2.Tests", "src\Example2\Example2.Tests\Example2.Tests.csproj", "{69218F9E-6DF2-4489-9B5F-4CCB3209E627}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example1", "Example1", "{C436FCE2-9D48-4A6C-B4D1-FEA65F362562}" + ProjectSection(SolutionItems) = preProject + src\Example1\README.md = src\Example1\README.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example1", "src\Example1\Example1\Example1.csproj", "{7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example1.UI", "src\Example1\Example1.UI\Example1.UI.csproj", "{359D3C43-5D95-4031-B693-392745618E36}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example1.Tests", "src\Example1\Example1.Tests\Example1.Tests.csproj", "{7E96485D-CD13-4E85-8830-1ECDAC687679}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example3", "Example3", "{6BA3954F-A731-44F3-B8B9-93253321CE9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Config", "src\Example3\Example3.Config\Example3.Config.csproj", "{A1CCF793-A461-4898-8DFC-727E8E7E91F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3", "src\Example3\Example3\Example3.csproj", "{2F6258C6-DF86-412C-945F-DB6728FBB7D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.UI", "src\Example3\Example3.UI\Example3.UI.csproj", "{757906CE-6C18-457E-9979-713B372CFD18}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Tests", "src\Example3\Example3.Tests\Example3.Tests.csproj", "{FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -78,6 +109,46 @@ Global {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.Build.0 = Release|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|Any CPU.Build.0 = Release|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|Any CPU.Build.0 = Release|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|Any CPU.Build.0 = Release|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|Any CPU.Build.0 = Release|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Release|Any CPU.Build.0 = Release|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.Build.0 = Release|Any CPU + {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Release|Any CPU.Build.0 = Release|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|Any CPU.Build.0 = Release|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Release|Any CPU.Build.0 = Release|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -91,6 +162,16 @@ Global {5110FB90-B5CA-48B9-B518-CB2764F4CA5F} = {A82FAF26-B549-4058-86A3-B4EA4EEEB7BD} {9F525776-985A-4D51-8B92-E530B97D9545} = {A82FAF26-B549-4058-86A3-B4EA4EEEB7BD} {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7} = {A82FAF26-B549-4058-86A3-B4EA4EEEB7BD} + {AE8400E0-6DE5-4857-9306-28C29C089A44} = {170192A9-6512-46E0-843E-F1E4184C24D4} + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3} = {170192A9-6512-46E0-843E-F1E4184C24D4} + {69218F9E-6DF2-4489-9B5F-4CCB3209E627} = {170192A9-6512-46E0-843E-F1E4184C24D4} + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} + {359D3C43-5D95-4031-B693-392745618E36} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} + {7E96485D-CD13-4E85-8830-1ECDAC687679} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} + {A1CCF793-A461-4898-8DFC-727E8E7E91F0} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} + {2F6258C6-DF86-412C-945F-DB6728FBB7D5} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} + {757906CE-6C18-457E-9979-713B372CFD18} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example1/Example1.Config/Directory.Build.props b/src/Example1/Example1.Config/Directory.Build.props new file mode 100644 index 0000000..a842560 --- /dev/null +++ b/src/Example1/Example1.Config/Directory.Build.props @@ -0,0 +1,7 @@ + + + + 1910.1.1 + net46 + + diff --git a/src/Example1/Example1.Config/Example1.Config.csproj b/src/Example1/Example1.Config/Example1.Config.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example1/Example1.Config/Example1.Config.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example1/Example1.Config/global.json b/src/Example1/Example1.Config/global.json new file mode 100644 index 0000000..8cfb040 --- /dev/null +++ b/src/Example1/Example1.Config/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Soneta.Sdk": "1.0.3" + } +} diff --git a/src/Example1/Example1.Tests/Example1.Tests.csproj b/src/Example1/Example1.Tests/Example1.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example1/Example1.Tests/Example1.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example1/Example1.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example1/Example1.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example1/Example1.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example1/Example1.UI/Example1.UI.csproj b/src/Example1/Example1.UI/Example1.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example1/Example1.UI/Example1.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml b/src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml similarity index 100% rename from src/Samples/Samples/Example1/UI/Config.TowaryUlubione.pageform.xml rename to src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml diff --git a/src/Samples/Samples/Example1/UI/TowaryUlubioneKontaktu.viewform.xml b/src/Example1/Example1.UI/UI/TowaryUlubioneKontaktu.viewform.xml similarity index 100% rename from src/Samples/Samples/Example1/UI/TowaryUlubioneKontaktu.viewform.xml rename to src/Example1/Example1.UI/UI/TowaryUlubioneKontaktu.viewform.xml diff --git a/src/Samples/Samples/Example1/Extender/Menu.cs b/src/Example1/Example1.UI/ViewInfo/Menu.cs similarity index 93% rename from src/Samples/Samples/Example1/Extender/Menu.cs rename to src/Example1/Example1.UI/ViewInfo/Menu.cs index 809f6a4..8c83b2e 100644 --- a/src/Samples/Samples/Example1/Extender/Menu.cs +++ b/src/Example1/Example1.UI/ViewInfo/Menu.cs @@ -1,7 +1,7 @@  using Soneta.Business.Licence; using Soneta.Business.UI; -using Samples.Example1.Extender; +using Samples.Example1.UI.Extender; [assembly: FolderView("Samples", Priority = 10, diff --git a/src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs b/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs similarity index 98% rename from src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs rename to src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs index 791263a..9608b3f 100644 --- a/src/Samples/Samples/Example1/Extender/TowaryUlubioneKontaktuViewInfo.cs +++ b/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs @@ -2,7 +2,7 @@ using Soneta.CRM; using Soneta.Towary; -namespace Samples.Example1.Extender +namespace Samples.Example1.UI.Extender { /// /// Lista oparta na przykładzie pochodzącym z repozytorium Soneta.Examples - https://github.com/soneta/Examples (Example 1) diff --git a/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs b/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs new file mode 100644 index 0000000..cf3cd7d --- /dev/null +++ b/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs @@ -0,0 +1,82 @@ +using System; +using Soneta.Business; +using Soneta.Config; +using Samples.Example1.UI.Extender; + +[assembly: Worker(typeof(TowaryUlubioneConfigExtender))] + +namespace Samples.Example1.UI.Extender +{ + /// + /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples/Example1 + /// + public class TowaryUlubioneConfigExtender + { + [Context] + public Session Session { get; set; } + + public bool AktywneZakladkaSamples + { + get { return GetValue("AktywneZakladkaSamples", false); } + set { SetValue("AktywneZakladkaSamples", value, AttributeType._boolean); } + } + + // Pobranie wartości parametru "AktywneZakladkaSamples" + public static bool IsAktywneZakladkaSamples(Session session) + { + return GetValue(session, "AktywneZakladkaSamples", false); + } + + // Pobranie wartości parametrów konfiguracyjnych + private T GetValue(string name, T defaultValue) + { + return GetValue(Session, name, defaultValue); + } + + // Zapisanie wartośći parametrów konfiguracyjnych + private void SetValue(string name, T value, AttributeType type) + { + SetValue(Session, name, value, type); + } + + // Pobranie wartości parametrów konfiguracyjnych + private static T GetValue(Session session, string name, T defaultValue) + { + var cfgManager = new CfgManager(session); + var node = cfgManager.Root.FindSubNode("Samples", false); + if (node == null) return defaultValue; + + var nodeLeaf = node.FindSubNode("Konfiguracja", false); + if (nodeLeaf == null) return defaultValue; + + var attr = nodeLeaf.FindAttribute(name, false); + if (attr == null) return defaultValue; + + if (attr.Value == null) return defaultValue; + + return (T)attr.Value; + } + + // Ustawianie wartości parametrów konfiguracyjnych + private static void SetValue(Session session, string name, T value, AttributeType type) + { + using (var t = session.Logout(true)) + { + var cfgManager = new CfgManager(session); + var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? + cfgManager.Root.AddNode("Samples", CfgNodeType.Node); + + var node2 = node1.FindSubNode("Konfiguracja", false) ?? + node1.AddNode("Konfiguracja", CfgNodeType.Leaf); + + var attr = node2.FindAttribute(name, false); + if (attr == null) + node2.AddAttribute(name, type, value); + else + attr.Value = value; + + t.CommitUI(); + } + } + } +} \ No newline at end of file diff --git a/src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs b/src/Example1/Example1.UI/Workers/TowaryUlubionePokazKontaktWorker.cs similarity index 94% rename from src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs rename to src/Example1/Example1.UI/Workers/TowaryUlubionePokazKontaktWorker.cs index 6fdddc4..068222d 100644 --- a/src/Samples/Samples/Example1/Extender/TowaryUlubionePokazKontaktWorker.cs +++ b/src/Example1/Example1.UI/Workers/TowaryUlubionePokazKontaktWorker.cs @@ -7,11 +7,11 @@ using Soneta.Commands; using Soneta.Towary; using Soneta.Types; -using Samples.Example1.Extender; +using Samples.Example1.UI.Extender; [assembly: Worker(typeof(TowaryUlubionePokazKontaktWorker), typeof(TowarUlubiony))] -namespace Samples.Example1.Extender +namespace Samples.Example1.UI.Extender { class TowaryUlubionePokazKontaktWorker { diff --git a/src/Example1/Example1/Example1.csproj b/src/Example1/Example1/Example1.csproj new file mode 100644 index 0000000..f424872 --- /dev/null +++ b/src/Example1/Example1/Example1.csproj @@ -0,0 +1,15 @@ + + + + $(SonetaTargetFramework) + + + + + + + + + + + \ No newline at end of file diff --git a/src/Samples/Samples/Example1/Extender/TowaryUlubioneConfigExtender.cs b/src/Example1/Example1/TowaryUlubioneConfigExtender.cs similarity index 100% rename from src/Samples/Samples/Example1/Extender/TowaryUlubioneConfigExtender.cs rename to src/Example1/Example1/TowaryUlubioneConfigExtender.cs diff --git a/src/Example1/README.md b/src/Example1/README.md new file mode 100644 index 0000000..afde736 --- /dev/null +++ b/src/Example1/README.md @@ -0,0 +1,29 @@ +### Example 1 +----------------------------------------------------------------------------------------------------- + +Przykad pokazuje moliwo zastosowania wasnej listy w oparciu o istniejce obiekty enova. Zawiera zdefiniowane wasne View, z ktrym zostaa powizana odpowiednia definicja w postaci struktury viewform.xml. + +W wyniku zastosowania dodatku, powinna pojawi si dodatkowa grupa w menu gwnym programu o nazwie *Samples* z opcj *"Towary wasne"*, po wybraniu ktrej pojawi si zaimplementowana lista. + +* Extender\TowaryUlubioneKontaktuViewInfo.cs + + Przykadowan klasa z implementacj View zbudowanego na bazie tabel enova. +* Extender\Menu.cs + + Rejestracja listy dla View + +* UI\TowaryUlubioneKontaktu.viewform.xml + + Definicja page'a dla View + +* UI\Config.TowaryUlubione.pageform.xml + + Definicja formularza ustawie w Narzdzia/Opcje... + +* Extender\TowaryUlubioneConfigExtender.cs + + Obsuga zapisu ustawie w Narzdzia/Opcje... + +* Extender\TowaryUlubionePokazKontaktWorker.cs + + Rejestracja akcji dla listy towarw ulubionych otwarcia powiazanych rekordw \ No newline at end of file diff --git a/src/Example2/Example2.Tests/Example2.Tests.csproj b/src/Example2/Example2.Tests/Example2.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example2/Example2.Tests/Example2.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example2/Example2.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example2/Example2.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example2/Example2.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example2/Example2.UI/Example2.UI.csproj b/src/Example2/Example2.UI/Example2.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example2/Example2.UI/Example2.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs b/src/Example2/Example2.UI/Extender/KontrahentNewOgolneExtender.cs similarity index 94% rename from src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs rename to src/Example2/Example2.UI/Extender/KontrahentNewOgolneExtender.cs index 2162bd0..ced6b1f 100644 --- a/src/Samples/Samples/Example2/Extender/KontrahentNewOgolneExtender.cs +++ b/src/Example2/Example2.UI/Extender/KontrahentNewOgolneExtender.cs @@ -7,11 +7,11 @@ using Soneta.Business; using Soneta.Business.Db; using Soneta.CRM; -using Samples.Example2.Extender; +using Samples.Example2.UI.Extender; [assembly: Worker(typeof(KontrahentNewOgolneExtender))] -namespace Samples.Example2.Extender +namespace Samples.Example2.UI.Extender { class KontrahentNewOgolneExtender { diff --git a/src/Samples/Samples/Example2/UI/Kontrahent.KontrahentNewOgolne.pageform.xml b/src/Example2/Example2.UI/UI/Kontrahent.KontrahentNewOgolne.pageform.xml similarity index 100% rename from src/Samples/Samples/Example2/UI/Kontrahent.KontrahentNewOgolne.pageform.xml rename to src/Example2/Example2.UI/UI/Kontrahent.KontrahentNewOgolne.pageform.xml diff --git a/src/Example2/Example2/Example2.csproj b/src/Example2/Example2/Example2.csproj new file mode 100644 index 0000000..c5f0cba --- /dev/null +++ b/src/Example2/Example2/Example2.csproj @@ -0,0 +1,9 @@ + + + + $(SonetaTargetFramework) + + + + + \ No newline at end of file diff --git a/src/Samples/Samples/Example2/Readme.md b/src/Example2/Readme.md similarity index 100% rename from src/Samples/Samples/Example2/Readme.md rename to src/Example2/Readme.md diff --git a/src/Example3/Example3.Tests/Example3.Tests.csproj b/src/Example3/Example3.Tests/Example3.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example3/Example3.Tests/Example3.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example3/Example3.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example3/Example3.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example3/Example3.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example3/Example3.UI/Example3.UI.csproj b/src/Example3/Example3.UI/Example3.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example3/Example3.UI/Example3.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs b/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs similarity index 95% rename from src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs rename to src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs index ff7c990..882b610 100644 --- a/src/Samples/Samples/Example3/Extender/ZakladkaTowaryConfigExtender.cs +++ b/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs @@ -1,14 +1,14 @@ using System; using Soneta.Business; using Soneta.Config; -using Samples.Example3.Extender; +using Samples.Example3.UI.Extender; [assembly: Worker(typeof(ZakladkaTowaryConfigExtender))] -namespace Samples.Example3.Extender +namespace Samples.Example3.UI.Extender { /// - /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples + /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples Example3 /// public class ZakladkaTowaryConfigExtender { diff --git "a/src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" "b/src/Example3/Example3.UI/UI/Config.Zak\305\202adkaTowary.pageform.xml" similarity index 100% rename from "src/Samples/Samples/Example3/UI/Config.Zak\305\202adkaTowary.pageform.xml" rename to "src/Example3/Example3.UI/UI/Config.Zak\305\202adkaTowary.pageform.xml" diff --git a/src/Samples/Samples/Example3/Extender/Menu.cs b/src/Example3/Example3.UI/ViewInfo/Menu.cs similarity index 92% rename from src/Samples/Samples/Example3/Extender/Menu.cs rename to src/Example3/Example3.UI/ViewInfo/Menu.cs index de86862..4760726 100644 --- a/src/Samples/Samples/Example3/Extender/Menu.cs +++ b/src/Example3/Example3.UI/ViewInfo/Menu.cs @@ -1,16 +1,16 @@  using Soneta.Business.Licence; using Soneta.Business.UI; -using Samples.Example3.Extender; +using Samples.Example3.UI.Extender; + -/* [assembly: FolderView("Samples", Priority = 10, Description = "Przykłady implementacji enova365", BrickColor = FolderViewAttribute.BlueBrick, Contexts = new object[] { LicencjeModułu.All } )] -*/ + [assembly: FolderView("Samples/Zakladka towary", Priority = 11, diff --git a/src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs b/src/Example3/Example3.UI/ViewInfo/TowaryZakladkaViewInfo.cs similarity index 95% rename from src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs rename to src/Example3/Example3.UI/ViewInfo/TowaryZakladkaViewInfo.cs index 800ec61..83c4ccd 100644 --- a/src/Samples/Samples/Example3/Extender/TowaryZakladkaViewInfo.cs +++ b/src/Example3/Example3.UI/ViewInfo/TowaryZakladkaViewInfo.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Samples.Example3.Extender +namespace Samples.Example3.UI.Extender { public class TowaryZakladkaViewInfo : ViewInfo { diff --git a/src/Example3/Example3/Example3.csproj b/src/Example3/Example3/Example3.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example3/Example3/Example3.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Samples/Samples/Example1/Readme.md b/src/Samples/Samples/Example1/Readme.md deleted file mode 100644 index d478c3e..0000000 --- a/src/Samples/Samples/Example1/Readme.md +++ /dev/null @@ -1,29 +0,0 @@ -### Example 1 ------------------------------------------------------------------------------------------------------ - -Przykład pokazuje możliwość zastosowania własnej listy w oparciu o istniejące obiekty enova. Zawiera zdefiniowane własne View, z którym została powiązana odpowiednia definicja w postaci struktury viewform.xml. - -W wyniku zastosowania dodatku, powinna pojawić się dodatkowa grupa w menu głównym programu o nazwie *Samples* z opcją *"Towary własne"*, po wybraniu której pojawi się zaimplementowana lista. - -* Extender\TowaryUlubioneKontaktuViewInfo.cs - - Przykładowan klasa z implementacją View zbudowanego na bazie tabel enova. -* Extender\Menu.cs - - Rejestracja listy dla View - -* UI\TowaryUlubioneKontaktu.viewform.xml - - Definicja page'a dla View - -* UI\Config.TowaryUlubione.pageform.xml - - Definicja formularza ustawień w Narzędzia/Opcje... - -* Extender\TowaryUlubioneConfigExtender.cs - - Obsługa zapisu ustawień w Narzędzia/Opcje... - -* Extender\TowaryUlubionePokazKontaktWorker.cs - - Rejestracja akcji dla listy towarów ulubionych otwarcia powiazanych rekordów \ No newline at end of file diff --git a/src/Samples/Samples/Samples.csproj b/src/Samples/Samples/Samples.csproj index 5955eca..5e66c15 100644 --- a/src/Samples/Samples/Samples.csproj +++ b/src/Samples/Samples/Samples.csproj @@ -7,12 +7,14 @@ - + + + - + - + diff --git a/src/Samples/Samples/Ultis/examples.ico b/src/Samples/Samples/Ultis/examples.ico deleted file mode 100644 index 54045d6ea0551a6bf95d6087cfe3ed123e15cbe2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9062 zcmeI1e`r-@7{}jpcXgY)>8Kz=bE7C^`3tlqZ0?8K!as~8l!*R_q*4iWk>OvpO9&E} zf~7=676u9iWr)AY9~CW%6f}QEE;X_OHBFs4clvzKdC%RsclU1h+$los9nX2*_j#W0 z^L?N9{J8HqGsZD-Q(0-ym1aY^F^?Hz$0cS%i81G}l_T=ciyO1%-e6o}<_$5X`#xjF z2!k{riu0OP{$TJp&=qKFYm3dEJ-cY2d7|Q{O`CR4eSLi`a=fmtu5;?tsZY_bjGCv= zcsRE^@MKuv zpByz$q4DrO2;am^nK5I=utIa@i-U6}(w({f_8MH3Z=OQq;9hFE_OlKHh%mqjg5^DXY++^)KZRIMv`H>`m)(N zw`KBcY<*e}eieIKZEfv%Y!`S=zSLvQ-6Qr@=G#TSM}sJA4cPvcJsY=d_>R~)EDCVb zr%x}&{+&eqz}}B`h~JF-1aCs;0{ydc=i(0RV7iFCOwCo|V7y9W^tgUF)7+e^3NY@+zzld%}e@Ly`Qs!)0ua=gUG6jIySSUZ(Gs*#HiE2?lY6H7^ z0Q^Uy@+lt91oE!tO$`g}TE3IH#(j+~=40g}htB(0_4{kYK7t%X{?t8euZw>epYMw= z>?5|_^3Q@dj_8`xGqqLYTywzpGT2V!OSm5j;uwFReCYLIo?Lw!doZ}~^qWHNB>1by z&gSOk5kc;-#`hkwNbzAi`;EJ>pRhG;&&3PJQsf45k=S0pL)dG{vrGHuaQ=MyU`HXx zZEe@dvz76334J{?F4_70g{?N9oKa({tE-2@vyA+Ih$}4Eb>7x%Zx%Ig)OgKvmS8i)&lw2-m&f%e9W;lQ%kw*LLkGs_#xZZEn(W ze@mLvza-5v*BCa2#=Vg=yRRjkwU?64H|O^hU3EK(eZ1QiWb}0UcM3jks9EI?Qb(6- z&b#Kl`yUQGgEF`VgV(_S;~Gdk2yQ|r7V9gC6LTD=j|eA5>*F>1R{J$Qr$7GOCC0q@ z`H@Qrhr4kOn=JhUr@dLzS%#DJ(E9FfXAOX zfAQPYbXmht0Q5Zu(!;XwrRLc`xO4= zVk!~GJJQL%Pr-5XTUAxnP`$Ua2bzsUW(NB#`*d&r1pc+CGX(S8K=8c(-^sf|ql8?e zqVj{=4DJ;AB>HfFcb6c-cOTB#96XbkF{cx+PsTqxLlfHl9 z|7yghAG!m4V#^_YPdln_Bxt?cH-xc4AG_W+=Zu@b_-ud;^yn2IUBUM{^Jog<0}ZYf z-=}Du>rG|bkDUu}VNJ{-%kdfgw*$P@j^4kq9|&W@eX!^Bjf?nRPXcf)_!pqpja7&lx*YPzAhhD(> z%K42Dysn!Q$N}Vgx!XALn|QfS#;-DPLUFIPc|$9cg!)FB*4orAf~6)uFS( zm;-zXyTBI^$x+7g1-LN~_B?0oZQkqbc(Zb;#hvhCt2=)FV(-4LSh>y}x#knM{PX?p z@GU>OcWgW2CUzWiOZT4kzaRcT_K7a5Gbn>=@L#_MvOJpDx}|;Hb>i{VQ(57R)BU~U zQvqa(#}f(dc|8oFPH`epqP?R>%}zBz8{$)ldYHzExE~OAKzrj{ks&6R*mp2R@g6CzS&)I(gW_^9w From c5fe89ce8edeb6258208f463c5775cc90a91a6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Wed, 19 Feb 2020 15:02:06 +0100 Subject: [PATCH 13/21] Uproszczenie Example1 --- Samples.sln | 13 +-- .../UI/Config.TowaryUlubione.pageform.xml | 8 -- .../TowaryUlubioneKontaktuViewInfo.cs | 25 +----- .../Workers/TowaryUlubioneConfigExtender.cs | 82 ------------------- .../Example1/TowaryUlubioneConfigExtender.cs | 82 ------------------- src/Example1/README.md | 30 ++++--- 6 files changed, 22 insertions(+), 218 deletions(-) delete mode 100644 src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml delete mode 100644 src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs delete mode 100644 src/Example1/Example1/TowaryUlubioneConfigExtender.cs diff --git a/Samples.sln b/Samples.sln index 27c1cba..cc6a940 100644 --- a/Samples.sln +++ b/Samples.sln @@ -63,13 +63,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example1.Tests", "src\Examp EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example3", "Example3", "{6BA3954F-A731-44F3-B8B9-93253321CE9E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Config", "src\Example3\Example3.Config\Example3.Config.csproj", "{A1CCF793-A461-4898-8DFC-727E8E7E91F0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3", "src\Example3\Example3\Example3.csproj", "{2F6258C6-DF86-412C-945F-DB6728FBB7D5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3", "src\Example3\Example3\Example3.csproj", "{2F6258C6-DF86-412C-945F-DB6728FBB7D5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3.UI", "src\Example3\Example3.UI\Example3.UI.csproj", "{757906CE-6C18-457E-9979-713B372CFD18}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.UI", "src\Example3\Example3.UI\Example3.UI.csproj", "{757906CE-6C18-457E-9979-713B372CFD18}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Tests", "src\Example3\Example3.Tests\Example3.Tests.csproj", "{FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3.Tests", "src\Example3\Example3.Tests\Example3.Tests.csproj", "{FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -133,10 +131,6 @@ Global {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|Any CPU.Build.0 = Debug|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.Build.0 = Release|Any CPU - {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1CCF793-A461-4898-8DFC-727E8E7E91F0}.Release|Any CPU.Build.0 = Release|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -168,7 +162,6 @@ Global {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} {359D3C43-5D95-4031-B693-392745618E36} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} {7E96485D-CD13-4E85-8830-1ECDAC687679} = {C436FCE2-9D48-4A6C-B4D1-FEA65F362562} - {A1CCF793-A461-4898-8DFC-727E8E7E91F0} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} {2F6258C6-DF86-412C-945F-DB6728FBB7D5} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} {757906CE-6C18-457E-9979-713B372CFD18} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} diff --git a/src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml b/src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml deleted file mode 100644 index cb928de..0000000 --- a/src/Example1/Example1.UI/UI/Config.TowaryUlubione.pageform.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs b/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs index 9608b3f..392e67a 100644 --- a/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs +++ b/src/Example1/Example1.UI/ViewInfo/TowaryUlubioneKontaktuViewInfo.cs @@ -28,13 +28,13 @@ void TowaryWlasneViewInfo_CreateView(object sender, CreateViewEventArgs args) WParams parameters; if (!args.Context.Get(out parameters)) return; + args.View = ViewCreate(parameters); - //args.View.AllowNew = false; + args.View.AllowNew = false; } protected View ViewCreate(WParams pars) { - var rc = RowCondition.Empty; var tm = TowaryModule.GetInstance(pars.Context.Session); var view = tm.TowaryUlubione.CreateView(); @@ -47,27 +47,6 @@ protected View ViewCreate(WParams pars) return view; } - #region Widoczność zakładki - - /// - /// Metoda pozwalająca na sterowanie widocznościa zakładki. - /// - /// - /// - /// true - widoczność zakładki, - /// false - zakładka niewidoczna - /// - public static bool IsVisible(Context context) - { - bool result; - using (var session = context.Login.CreateSession(true, true)) - { - result = TowaryUlubioneConfigExtender.IsAktywneZakladkaSamples(session); - } - return result; - } - - #endregion Widoczność zakładki } public class WParams : ContextBase diff --git a/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs b/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs deleted file mode 100644 index cf3cd7d..0000000 --- a/src/Example1/Example1.UI/Workers/TowaryUlubioneConfigExtender.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using Soneta.Business; -using Soneta.Config; -using Samples.Example1.UI.Extender; - -[assembly: Worker(typeof(TowaryUlubioneConfigExtender))] - -namespace Samples.Example1.UI.Extender -{ - /// - /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples/Example1 - /// - public class TowaryUlubioneConfigExtender - { - [Context] - public Session Session { get; set; } - - public bool AktywneZakladkaSamples - { - get { return GetValue("AktywneZakladkaSamples", false); } - set { SetValue("AktywneZakladkaSamples", value, AttributeType._boolean); } - } - - // Pobranie wartości parametru "AktywneZakladkaSamples" - public static bool IsAktywneZakladkaSamples(Session session) - { - return GetValue(session, "AktywneZakladkaSamples", false); - } - - // Pobranie wartości parametrów konfiguracyjnych - private T GetValue(string name, T defaultValue) - { - return GetValue(Session, name, defaultValue); - } - - // Zapisanie wartośći parametrów konfiguracyjnych - private void SetValue(string name, T value, AttributeType type) - { - SetValue(Session, name, value, type); - } - - // Pobranie wartości parametrów konfiguracyjnych - private static T GetValue(Session session, string name, T defaultValue) - { - var cfgManager = new CfgManager(session); - var node = cfgManager.Root.FindSubNode("Samples", false); - if (node == null) return defaultValue; - - var nodeLeaf = node.FindSubNode("Konfiguracja", false); - if (nodeLeaf == null) return defaultValue; - - var attr = nodeLeaf.FindAttribute(name, false); - if (attr == null) return defaultValue; - - if (attr.Value == null) return defaultValue; - - return (T)attr.Value; - } - - // Ustawianie wartości parametrów konfiguracyjnych - private static void SetValue(Session session, string name, T value, AttributeType type) - { - using (var t = session.Logout(true)) - { - var cfgManager = new CfgManager(session); - var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? - cfgManager.Root.AddNode("Samples", CfgNodeType.Node); - - var node2 = node1.FindSubNode("Konfiguracja", false) ?? - node1.AddNode("Konfiguracja", CfgNodeType.Leaf); - - var attr = node2.FindAttribute(name, false); - if (attr == null) - node2.AddAttribute(name, type, value); - else - attr.Value = value; - - t.CommitUI(); - } - } - } -} \ No newline at end of file diff --git a/src/Example1/Example1/TowaryUlubioneConfigExtender.cs b/src/Example1/Example1/TowaryUlubioneConfigExtender.cs deleted file mode 100644 index 4c1fcf5..0000000 --- a/src/Example1/Example1/TowaryUlubioneConfigExtender.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using Soneta.Business; -using Soneta.Config; -using Samples.Example1.Extender; - -[assembly: Worker(typeof(TowaryUlubioneConfigExtender))] - -namespace Samples.Example1.Extender -{ - /// - /// Klasa wspiera zapis i odczyt parametrów konfiguracyjnych dodatku Samples - /// - public class TowaryUlubioneConfigExtender - { - [Context] - public Session Session { get; set; } - - public bool AktywneZakladkaSamples - { - get { return GetValue("AktywneZakladkaSamples", false); } - set { SetValue("AktywneZakladkaSamples", value, AttributeType._boolean); } - } - - // Pobranie wartości parametru "AktywneZakladkaSamples" - public static bool IsAktywneZakladkaSamples(Session session) - { - return GetValue(session, "AktywneZakladkaSamples", false); - } - - // Pobranie wartości parametrów konfiguracyjnych - private T GetValue(string name, T defaultValue) - { - return GetValue(Session, name, defaultValue); - } - - // Zapisanie wartośći parametrów konfiguracyjnych - private void SetValue(string name, T value, AttributeType type) - { - SetValue(Session, name, value, type); - } - - // Pobranie wartości parametrów konfiguracyjnych - private static T GetValue(Session session, string name, T defaultValue) - { - var cfgManager = new CfgManager(session); - var node = cfgManager.Root.FindSubNode("Samples", false); - if (node == null) return defaultValue; - - var nodeLeaf = node.FindSubNode("Konfiguracja", false); - if (nodeLeaf == null) return defaultValue; - - var attr = nodeLeaf.FindAttribute(name, false); - if (attr == null) return defaultValue; - - if (attr.Value == null) return defaultValue; - - return (T)attr.Value; - } - - // Ustawianie wartości parametrów konfiguracyjnych - private static void SetValue(Session session, string name, T value, AttributeType type) - { - using (var t = session.Logout(true)) - { - var cfgManager = new CfgManager(session); - var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? - cfgManager.Root.AddNode("Samples", CfgNodeType.Node); - - var node2 = node1.FindSubNode("Konfiguracja", false) ?? - node1.AddNode("Konfiguracja", CfgNodeType.Leaf); - - var attr = node2.FindAttribute(name, false); - if (attr == null) - node2.AddAttribute(name, type, value); - else - attr.Value = value; - - t.CommitUI(); - } - } - } -} \ No newline at end of file diff --git a/src/Example1/README.md b/src/Example1/README.md index afde736..0028189 100644 --- a/src/Example1/README.md +++ b/src/Example1/README.md @@ -3,27 +3,31 @@ Przykad pokazuje moliwo zastosowania wasnej listy w oparciu o istniejce obiekty enova. Zawiera zdefiniowane wasne View, z ktrym zostaa powizana odpowiednia definicja w postaci struktury viewform.xml. -W wyniku zastosowania dodatku, powinna pojawi si dodatkowa grupa w menu gwnym programu o nazwie *Samples* z opcj *"Towary wasne"*, po wybraniu ktrej pojawi si zaimplementowana lista. +W wyniku zastosowania dodatku, powinna pojawi si dodatkowa grupa w menu gwnym programu o nazwie *`Samples`* z opcj *`Towary wasne`*, po wybraniu ktrej pojawi si zaimplementowana lista. -* Extender\TowaryUlubioneKontaktuViewInfo.cs + +W skad przykadu wchodz trzy projekty: + +* `Example1` - zawierajcy elementy logiki biznesowej +* `Example1.UI` - interfejsu uytkownika +* `Example1.Tests` - testy + + +#### Zawarto przykadu: +> Przykad zawiera jedynie elementy interfejsu uytkownika wiec cao znajduje si w `Example1.UI`. + +* `Example1.UI`\Extender\TowaryUlubioneKontaktuViewInfo.cs Przykadowan klasa z implementacj View zbudowanego na bazie tabel enova. -* Extender\Menu.cs +* `Example1.UI`\Extender\Menu.cs Rejestracja listy dla View -* UI\TowaryUlubioneKontaktu.viewform.xml +* `Example1.UI`\UI\TowaryUlubioneKontaktu.viewform.xml Definicja page'a dla View -* UI\Config.TowaryUlubione.pageform.xml - - Definicja formularza ustawie w Narzdzia/Opcje... - -* Extender\TowaryUlubioneConfigExtender.cs - - Obsuga zapisu ustawie w Narzdzia/Opcje... -* Extender\TowaryUlubionePokazKontaktWorker.cs +* `Example1.UI`\Extender\TowaryUlubionePokazKontaktWorker.cs - Rejestracja akcji dla listy towarw ulubionych otwarcia powiazanych rekordw \ No newline at end of file + Rejestracja akcji dla listy towarw ulubionych \ No newline at end of file From 97a7a45b520dc8d44f528926d30413d63d93ff8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Thu, 20 Feb 2020 12:57:36 +0100 Subject: [PATCH 14/21] Example4 --- Samples.sln | 32 ++++ src/Example2/Readme.md | 23 ++- .../Extender/ZakladkaTowaryConfigExtender.cs | 10 +- src/Example3/Readme.md | 38 +++++ .../Example4.Config/Directory.Build.props | 7 + .../Example4.Config/Example4.Config.csproj | 6 + src/Example4/Example4.Config/global.json | 5 + .../Example4.Tests/Example4.Tests.csproj | 6 + .../EnsureSonetaTypesReferenceClass.cs | 17 ++ src/Example4/Example4.UI/Example4.UI.csproj | 9 + src/Example4/Example4.UI/Menu.cs | 20 +++ .../Config.CfgWalutyNbpExtender.pageform.xml | 15 ++ .../DzienneKursyWalutNbp.Ogolne.pageform.xml | 29 ++++ .../DzienneKursyWalutNbp.Aktualizacja.cs | 159 ++++++++++++++++++ .../Example4/DzienneKursyWalutNbp.Ogolne.cs | 50 ++++++ .../Example4/DzienneKursyWalutNbp.Pobranie.cs | 77 +++++++++ src/Example4/Example4/Example4.csproj | 6 + .../Example4/Extender/CfgWalutyNbpExtender.cs | 91 ++++++++++ src/Example4/Example4/KursWalutyNbp.cs | 8 + src/Example4/Readme.md | 50 ++++++ 20 files changed, 647 insertions(+), 11 deletions(-) create mode 100644 src/Example3/Readme.md create mode 100644 src/Example4/Example4.Config/Directory.Build.props create mode 100644 src/Example4/Example4.Config/Example4.Config.csproj create mode 100644 src/Example4/Example4.Config/global.json create mode 100644 src/Example4/Example4.Tests/Example4.Tests.csproj create mode 100644 src/Example4/Example4.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example4/Example4.UI/Example4.UI.csproj create mode 100644 src/Example4/Example4.UI/Menu.cs create mode 100644 src/Example4/Example4.UI/UI/Config.CfgWalutyNbpExtender.pageform.xml create mode 100644 src/Example4/Example4.UI/UI/DzienneKursyWalutNbp.Ogolne.pageform.xml create mode 100644 src/Example4/Example4/DzienneKursyWalutNbp.Aktualizacja.cs create mode 100644 src/Example4/Example4/DzienneKursyWalutNbp.Ogolne.cs create mode 100644 src/Example4/Example4/DzienneKursyWalutNbp.Pobranie.cs create mode 100644 src/Example4/Example4/Example4.csproj create mode 100644 src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs create mode 100644 src/Example4/Example4/KursWalutyNbp.cs create mode 100644 src/Example4/Readme.md diff --git a/Samples.sln b/Samples.sln index cc6a940..5bd39aa 100644 --- a/Samples.sln +++ b/Samples.sln @@ -43,6 +43,9 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9988A292-3657-421B-BFBA-55C479DE1216}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example2", "Example2", "{170192A9-6512-46E0-843E-F1E4184C24D4}" + ProjectSection(SolutionItems) = preProject + src\Example2\Readme.md = src\Example2\Readme.md + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example2", "src\Example2\Example2\Example2.csproj", "{AE8400E0-6DE5-4857-9306-28C29C089A44}" EndProject @@ -62,6 +65,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example1.Tests", "src\Example1\Example1.Tests\Example1.Tests.csproj", "{7E96485D-CD13-4E85-8830-1ECDAC687679}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example3", "Example3", "{6BA3954F-A731-44F3-B8B9-93253321CE9E}" + ProjectSection(SolutionItems) = preProject + src\Example3\Readme.md = src\Example3\Readme.md + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3", "src\Example3\Example3\Example3.csproj", "{2F6258C6-DF86-412C-945F-DB6728FBB7D5}" EndProject @@ -69,6 +75,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3.UI", "src\Example3 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example3.Tests", "src\Example3\Example3.Tests\Example3.Tests.csproj", "{FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example4", "Example4", "{690B0B2F-9184-4047-9F47-8408ADDB0EE4}" + ProjectSection(SolutionItems) = preProject + src\Example4\Readme.md = src\Example4\Readme.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example4", "src\Example4\Example4\Example4.csproj", "{B6EF0217-7110-4CEA-9450-B30D8F3D55E5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example4.UI", "src\Example4\Example4.UI\Example4.UI.csproj", "{9D33DA69-0D14-4442-8DAE-2FE528AA962B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example4.Tests", "src\Example4\Example4.Tests\Example4.Tests.csproj", "{BC71E9BE-8765-4444-A16E-E786EAB6CF7F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -143,6 +160,18 @@ Global {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|Any CPU.Build.0 = Debug|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.Build.0 = Release|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|Any CPU.Build.0 = Release|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|Any CPU.Build.0 = Release|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -165,6 +194,9 @@ Global {2F6258C6-DF86-412C-945F-DB6728FBB7D5} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} {757906CE-6C18-457E-9979-713B372CFD18} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0} = {6BA3954F-A731-44F3-B8B9-93253321CE9E} + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} + {9D33DA69-0D14-4442-8DAE-2FE528AA962B} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example2/Readme.md b/src/Example2/Readme.md index fd028cc..c97a2ce 100644 --- a/src/Example2/Readme.md +++ b/src/Example2/Readme.md @@ -4,17 +4,28 @@ Przykład pokazuje możliwość podpięcia dodatkowej zakładki użytkownika dla klasy *Kontrahent*. Implementacja dodatkowego extendera pokazuje w jaki sposób można dodawać własne informacje w postaci różnych danych (np. dodatkowe pola nie związane z logiką enova365). W przypadku -zakładki wprowadzone zostało dodatkowe pole wyświetlające logo kontrahenta. Aby logo -się pojawiło konieczne jest wstawienie kontrahentowi załącznika o nazwie *logo.png*. +zakładki wprowadzone zostało dodatkowe pole wyświetlające logo kontrahenta. +Aby logo się pojawiło konieczne jest wstawienie kontrahentowi załącznika o typie obraz i ustawieniu go jako domyślny. W wyniku zastosowania dodatku, powinna pojawić się dodatkowa zakładka na formularzu kontrahenta, która oprócz danych standardowych zakładki ogólnej będzie posiadała również logo kontrahenta. -* Extender\KontrahentNewOgolneExtender +W skład przykładu wchodzą trzy projekty: - Przykładowan klasa implementująca property Logo, które zostało umieszczone na dodatkowej zakładce -* UI\Kontrahent.KontrahentNewOgolne.pageform.xml +* `Example2` - zawierający elementy logiki biznesowej +* `Example2.UI` - elementy interfejsu użytkownika +* `Example2.Tests` - testy - Definicja dodatkowej zakładki \ No newline at end of file + +#### Zawartość przykładu: +> Przykład zawiera jedynie elementy związane z interfejsem użytkownika wiec całość znajduje się w `Example2.UI`. + + +* `Example2.UI`\Extender\KontrahentNewOgolneExtender.cs + + Przykładowa klasa implementująca property Logo, które zostało umieszczone na dodatkowej zakładce +* `Example2.UI`\UI\Kontrahent.KontrahentNewOgolne.pageform.xml + + Definicja dodatkowej zakładki wyświetlającej logo Kontrahenta \ No newline at end of file diff --git a/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs b/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs index 882b610..bf6ece8 100644 --- a/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs +++ b/src/Example3/Example3.UI/Extender/ZakladkaTowaryConfigExtender.cs @@ -63,15 +63,15 @@ private static void SetValue(Session session, string name, T value, Attribute using (var t = session.Logout(true)) { var cfgManager = new CfgManager(session); - var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? + var node = cfgManager.Root.FindSubNode("Samples", false) ?? cfgManager.Root.AddNode("Samples", CfgNodeType.Node); - var node2 = node1.FindSubNode("Konfiguracja", false) ?? - node1.AddNode("Konfiguracja", CfgNodeType.Leaf); + var nodeLeaf = node.FindSubNode("Konfiguracja", false) ?? + node.AddNode("Konfiguracja", CfgNodeType.Leaf); - var attr = node2.FindAttribute(name, false); + var attr = nodeLeaf.FindAttribute(name, false); if (attr == null) - node2.AddAttribute(name, type, value); + nodeLeaf.AddAttribute(name, type, value); else attr.Value = value; diff --git a/src/Example3/Readme.md b/src/Example3/Readme.md new file mode 100644 index 0000000..94fc62b --- /dev/null +++ b/src/Example3/Readme.md @@ -0,0 +1,38 @@ +### Example 3 +----------------------------------------------------------------------------------------------------- + +Przykad pokazuje moliwo podpicia wasnej zakadki konfiguracyjnej dla potrzeb wasnego dodatku. +W przykadzie zastosowano mechanizm tworzenia ustawie konfiguracji bezporednio w kodzie programu, +bez stosowania pliku *config.xml*. + +W wyniku zastosowania dodatku, w konfiguracji powinna pojawi si dodatkowa zakadka w sekcji o nazwie +**Samples**. + + +W skad przykadu wchodz trzy projekty: + +* `Example3` - zawierajcy elementy logiki biznesowej +* `Example3.UI` - elementy interfejsu uytkownika +* `Example3.Tests` - testy + + +#### Zawarto przykadu: +> Przykad zawiera jedynie elementy zwizane z interfejsem uytkownika wiec cao znajduje si w `Example3.UI`. + + + +* `Example3.UI`\Extender\ZakladkaTowaryConfigExtender.cs + + Wsparcie dla ustawie + +* `Example3.UI`\UI\Config.ZakadkaTowary.pageform.xml + + Definicja zakadki konfiguracyjnej + +* `Example3.UI`\ViewInfo\Menu.cs + + Rejestracja listy dla View + +* `Example3.UI`\ViewInfo\TowaryZakladkaViewInfo.cs + + Definicja ViewInfo z logik sterujc widocznoci \ No newline at end of file diff --git a/src/Example4/Example4.Config/Directory.Build.props b/src/Example4/Example4.Config/Directory.Build.props new file mode 100644 index 0000000..a842560 --- /dev/null +++ b/src/Example4/Example4.Config/Directory.Build.props @@ -0,0 +1,7 @@ + + + + 1910.1.1 + net46 + + diff --git a/src/Example4/Example4.Config/Example4.Config.csproj b/src/Example4/Example4.Config/Example4.Config.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example4/Example4.Config/Example4.Config.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example4/Example4.Config/global.json b/src/Example4/Example4.Config/global.json new file mode 100644 index 0000000..8cfb040 --- /dev/null +++ b/src/Example4/Example4.Config/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Soneta.Sdk": "1.0.3" + } +} diff --git a/src/Example4/Example4.Tests/Example4.Tests.csproj b/src/Example4/Example4.Tests/Example4.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example4/Example4.Tests/Example4.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example4/Example4.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example4/Example4.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example4/Example4.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example4/Example4.UI/Example4.UI.csproj b/src/Example4/Example4.UI/Example4.UI.csproj new file mode 100644 index 0000000..94bf74a --- /dev/null +++ b/src/Example4/Example4.UI/Example4.UI.csproj @@ -0,0 +1,9 @@ + + + + $(SonetaTargetFramework) + + + + + \ No newline at end of file diff --git a/src/Example4/Example4.UI/Menu.cs b/src/Example4/Example4.UI/Menu.cs new file mode 100644 index 0000000..4b7849b --- /dev/null +++ b/src/Example4/Example4.UI/Menu.cs @@ -0,0 +1,20 @@ + +using Soneta.Business.Licence; +using Soneta.Business.UI; +using Samples.Example4; + +[assembly: FolderView("Samples", + Priority = 10, + Description = "Przykłady implementacji enova365", + BrickColor = FolderViewAttribute.BlueBrick, + Contexts = new object[] { LicencjeModułu.All } +)] + +[assembly: FolderView("Samples/Kursy walut NBP", + Priority = 11, + Description = "Przykład kursów walut pobieranych z NBP online", + ObjectType = typeof(DzienneKursyWalutNbp), + ObjectPage = "DzienneKursyWalutNbp.Ogolne.pageform.xml", + ReadOnlySession = false, + ConfigSession = false +)] \ No newline at end of file diff --git a/src/Example4/Example4.UI/UI/Config.CfgWalutyNbpExtender.pageform.xml b/src/Example4/Example4.UI/UI/Config.CfgWalutyNbpExtender.pageform.xml new file mode 100644 index 0000000..4c5fe6c --- /dev/null +++ b/src/Example4/Example4.UI/UI/Config.CfgWalutyNbpExtender.pageform.xml @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/src/Example4/Example4.UI/UI/DzienneKursyWalutNbp.Ogolne.pageform.xml b/src/Example4/Example4.UI/UI/DzienneKursyWalutNbp.Ogolne.pageform.xml new file mode 100644 index 0000000..549801c --- /dev/null +++ b/src/Example4/Example4.UI/UI/DzienneKursyWalutNbp.Ogolne.pageform.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Example4/Example4/DzienneKursyWalutNbp.Aktualizacja.cs b/src/Example4/Example4/DzienneKursyWalutNbp.Aktualizacja.cs new file mode 100644 index 0000000..a4c1164 --- /dev/null +++ b/src/Example4/Example4/DzienneKursyWalutNbp.Aktualizacja.cs @@ -0,0 +1,159 @@ +using System; +using System.IO; +using System.Text; +using System.Xml; +using Soneta.Business; +using Soneta.Business.UI; +using Samples.Example4; +using Soneta.Tools; + +namespace Samples.Example4 { + + public partial class DzienneKursyWalutNbp { + + #region Aktualizacja kursów + + #region Aktualizacja online + + public MessageBoxInformation Aktualizuj() + { + return new MessageBoxInformation( + "Aktualizowanie kursów walut w formie XML".Translate(), + "Czy aktualizować tabelę kursów w formie XML".Translate() + ) { + YesHandler = () => { + // Wczytujemy aktualne kursy + aktualizujonline(DateTime.Today); + + // Wymuszamy odświeżenie listy + Context.Session.InvokeChanged(); + return null; + } + }; + } + + private void aktualizujonline(DateTime date) + { + string f; + var bytes = loadData(date, out f); + using (var stream = new MemoryStream(bytes)) { + aktualizuj(stream); + } + } + + private void aktualizuj(DateTime date) + { + string f; + var bytes = loadData(date, out f); + var reader = new StreamReader(new MemoryStream(bytes), Encoding.GetEncoding(1250)); + var document = new XmlDocument(); + document.Load(reader); + var element = document.DocumentElement; + if (element == null) + return; + + var tabelaKursow = element.SelectSingleNode("//tabela_kursow[@typ='A']"); + + _kursyWalut.Clear(); + + if (tabelaKursow == null) + return; + + var pozycje = tabelaKursow.SelectNodes("pozycja"); + if (pozycje == null) + return; + + foreach (XmlNode pozycja in pozycje) + { + if (pozycja == null) + continue; + + var przelicznik = GetNodeValue(pozycja, "przelicznik"); + var kursSredni = GetNodeValue(pozycja, "kurs_sredni"); + var kodWaluty = GetNodeValue(pozycja, "kod_waluty"); + var nazwaWaluty = GetNodeValue(pozycja, "nazwa_waluty"); + + _kursyWalut.Add(kodWaluty, new KursWalutyNbp { + Kod = kodWaluty, + Nazwa = nazwaWaluty, + Przelicznik = (przelicznik.IsNullOrEmpty() ? 0 : Convert.ToInt32(przelicznik)), + KursSredni = (kursSredni.IsNullOrEmpty() ? 0 : Convert.ToDouble(kursSredni)) + }); + } + } + + #endregion + + #region Aktualizacja z pliku + + public MessageBoxInformation AktualizujZPliku() { + return new MessageBoxInformation( + "Aktualizowanie kursów walut w formie XML".Translate(), + "Czy aktualizować tabelę kursów w formie XML".Translate() + ) { + YesHandler = () => QueryContextInformation.Create(importFile) + }; + } + + private object importFile(NamedStream ns) { + using (var stream = new MemoryStream(ns.GetData())) { + // Wczytujemy aktualne kursy + aktualizuj(stream); + } + // Wymuszamy odświeżenie listy + Context.Session.InvokeChanged(); + return "Importowanie danych został zakończony pomyślnie."; + } + + #endregion + + private static string GetNodeValue(XmlNode node, string valueName) + { + var result = String.Empty; + var valueNode = node.SelectSingleNode(valueName); + if (valueNode != null) + result = valueNode.InnerText; + return result; + } + + private void aktualizuj(Stream stream) { + var reader = new StreamReader(stream, Encoding.GetEncoding(1250)); + var document = new XmlDocument(); + document.Load(reader); + var element = document.DocumentElement; + if (element == null) + return; + + var tabelaKursow = element.SelectSingleNode("//tabela_kursow[@typ='A']"); + + _kursyWalut.Clear(); + + if (tabelaKursow == null) + return; + + var pozycje = tabelaKursow.SelectNodes("pozycja"); + if (pozycje == null) + return; + + foreach (XmlNode pozycja in pozycje) { + if (pozycja == null) + continue; + + var przelicznik = GetNodeValue(pozycja, "przelicznik"); + var kursSredni = GetNodeValue(pozycja, "kurs_sredni"); + var kodWaluty = GetNodeValue(pozycja, "kod_waluty"); + var nazwaWaluty = GetNodeValue(pozycja, "nazwa_waluty"); + + _kursyWalut.Add(kodWaluty, new KursWalutyNbp { + Kod = kodWaluty, + Nazwa = nazwaWaluty, + Przelicznik = (przelicznik.IsNullOrEmpty() ? 0 : Convert.ToInt32(przelicznik)), + KursSredni = (kursSredni.IsNullOrEmpty() ? 0 : Convert.ToDouble(kursSredni)) + }); + } + } + + #endregion Aktualizacja kursów + } + +} diff --git a/src/Example4/Example4/DzienneKursyWalutNbp.Ogolne.cs b/src/Example4/Example4/DzienneKursyWalutNbp.Ogolne.cs new file mode 100644 index 0000000..e52f978 --- /dev/null +++ b/src/Example4/Example4/DzienneKursyWalutNbp.Ogolne.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using System.Linq; +using Soneta.Business; +using Samples.Example4; +using Samples.Example4.Extender; + +namespace Samples.Example4 +{ + + public partial class DzienneKursyWalutNbp { + [Context(Required = true)] + public Context Context { get; set; } + + [Context(Required = true)] + public Session Session { get; set; } + + #region Property dla formularza + + private SortedDictionary _kursyWalut; + public IEnumerable KursyWalut { + get { + if (_kursyWalut != null) + return _kursyWalut.Values.ToArray(); + + _kursyWalut = new SortedDictionary { + { + "USD", new KursWalutyNbp { + Kod = "USD", + Nazwa = "Dolar amerykański", + Przelicznik = 1, + KursSredni = 3.0589f + } + }, + { + "CHF", new KursWalutyNbp { + Kod = "CHF", + Nazwa = "Frank szwajcarski", + Przelicznik = 1, + KursSredni = 3.4018f + } + } + }; + return _kursyWalut.Values.ToArray(); + } + } + + #endregion Property dla formularza + } + +} diff --git a/src/Example4/Example4/DzienneKursyWalutNbp.Pobranie.cs b/src/Example4/Example4/DzienneKursyWalutNbp.Pobranie.cs new file mode 100644 index 0000000..74e433d --- /dev/null +++ b/src/Example4/Example4/DzienneKursyWalutNbp.Pobranie.cs @@ -0,0 +1,77 @@ +using System; +using System.IO; +using System.Net; +using Soneta.Business; +using Soneta.Business.UI; +using Samples.Example4.Extender; +using Soneta.Tools; + +namespace Samples.Example4 +{ + + public partial class DzienneKursyWalutNbp { + #region Pobranie kursów w formie xml + + public MessageBoxInformation PobierzXml() { + return new MessageBoxInformation( + "Pobranie kursow walut w formie XML".Translate(), + "Czy pobrać aktualną tabelę kursów w formie XML".Translate() + ) { + YesHandler = () => { + string file; + var bytes = loadData(DateTime.Today, out file); + return new NamedStream(file, bytes); + } + }; + } + + private byte[] loadData(DateTime date, out string file) + { + var lastDay = date; + switch (DateTime.Today.DayOfWeek) { + case DayOfWeek.Thursday: + lastDay = lastDay.AddDays(-1); + break; + case DayOfWeek.Saturday: + lastDay = lastDay.AddDays(-1); + break; + case DayOfWeek.Sunday: + lastDay = lastDay.AddDays(-2); + break; + } + + var nbpUrl = CfgWalutyNbpExtender.GetUrlNbp(Session, "http://www.nbp.pl/kursy/xml/a034z"); + nbpUrl += "{0}"; + file = String.Format("{0}.xml", lastDay.ToString("yyMMdd")); + var url = String.Format(nbpUrl, file); + + var request = (HttpWebRequest)WebRequest.Create(url); + byte[] bytes; + using (var webResponse = (HttpWebResponse)request.GetResponse()) { + using (var sr = webResponse.GetResponseStream()) { + + bytes = new byte[(int)webResponse.ContentLength]; + var pos = 0; + + while (pos < bytes.Length) { + if (sr == null) + continue; + + var bytesRead = sr.Read(bytes, pos, bytes.Length - pos); + if (bytesRead == 0) { + throw new IOException("Premature end of data"); + } + pos += bytesRead; + } + if (sr != null) + sr.Close(); + } + webResponse.Close(); + } + return bytes; + } + + #endregion Pobranie kursów w formie xml + } + +} diff --git a/src/Example4/Example4/Example4.csproj b/src/Example4/Example4/Example4.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example4/Example4/Example4.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs b/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs new file mode 100644 index 0000000..581e988 --- /dev/null +++ b/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs @@ -0,0 +1,91 @@ +#define EXAMPLE3 + +using Soneta.Business; +using Soneta.Config; +using Samples.Example4.Extender; + +// Rejestracja extender'a użytego na interfejsie +#if EXAMPLE3 +[assembly: Worker(typeof(CfgWalutyNbpExtender))] +#endif + +namespace Samples.Example4.Extender { + public class CfgWalutyNbpExtender + { + [Context] + public Session Session { get; set; } + + #region Property formularza + + public string UrlNbp { + get { return GetValue("UrlNbp", ""); } + set { SetValue("UrlNbp", value, AttributeType._string); } + } + + public static string GetUrlNbp(Session session, string def) + { + return GetValue(session, "UrlNbp", def); + } + + #endregion Property formularza + + #region Metody pomocnicze + + //Metoda odpowiada za ustawianie wartosci parametrów konfiguracji + private void SetValue(string name, T value, AttributeType type) { + SetValue(Session, name, value, type); + } + + //Metoda odpowiada za pobieranie wartosci parametrów konfiguracji + private T GetValue(string name, T def) { + return GetValue(Session, name, def); + } + + //Metoda odpowiada za ustawianie wartosci parametrów konfiguracji + private static void SetValue(Session session, string name, T value, AttributeType type) { + using (var t = session.Logout(true)) { + var cfgManager = new CfgManager(session); + //wyszukiwanie gałęzi głównej + var node1 = cfgManager.Root.FindSubNode("Samples", false) ?? + cfgManager.Root.AddNode("Samples", CfgNodeType.Node); + + //wyszukiwanie liścia + var node2 = node1.FindSubNode("Kursy Walut NBP", false) ?? + node1.AddNode("Kursy Walut NBP", CfgNodeType.Leaf); + + //wyszukiwanie wartosci atrybutu w liściu + var attr = node2.FindAttribute(name, false); + if (attr == null) + node2.AddAttribute(name, type, value); + else + attr.Value = value; + + t.CommitUI(); + } + } + + //Metoda odpowiada za pobieranie wartosci parametrów konfiguracji + private static T GetValue(Session session, string name, T def) { + var cfgManager = new CfgManager(session); + + var node1 = cfgManager.Root.FindSubNode("Samples", false); + + //Jeśli nie znaleziono gałęzi, zwracamy wartosć domyślną + if (node1 == null) return def; + + var node2 = node1.FindSubNode("Kursy Walut NBP", false); + if (node2 == null) return def; + + var attr = node2.FindAttribute(name, false); + if (attr == null) return def; + + if (attr.Value == null) return def; + + return (T) attr.Value; + } + + #endregion Metody pomocnicze + } + + +} diff --git a/src/Example4/Example4/KursWalutyNbp.cs b/src/Example4/Example4/KursWalutyNbp.cs new file mode 100644 index 0000000..6ee3168 --- /dev/null +++ b/src/Example4/Example4/KursWalutyNbp.cs @@ -0,0 +1,8 @@ +namespace Samples.Example4 { + public class KursWalutyNbp { + public string Kod { get; set; } + public string Nazwa { get; set; } + public double KursSredni { get; set; } + public int Przelicznik { get; set; } + } +} diff --git a/src/Example4/Readme.md b/src/Example4/Readme.md new file mode 100644 index 0000000..6da2e4c --- /dev/null +++ b/src/Example4/Readme.md @@ -0,0 +1,50 @@ +### Example 4 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje implementacje własnej klasy, nie powiązanej z logiką enova365. Dla zaimplementowanej +klasy została utworzona dedykowana definicja formularza. W przykładzie pokazano wykorzystanie *Command* +oraz podpięcia do nich własnych metod. + +W wyniku zastosowania dodatku, powinna pojawić się dodatkowa grupa w menu głównym programu o nazwie +*Soneta.Examples*, z opcją *"Kursy walut NBP"*, po wybraniu której pojawi się zaimplementowana lista. + +Na liście pokazane zostało użycie zaimplementowanych metod extender'a: +* `Aktualizuj` - uzupełnia dane pobrane z serwera +* `AktualizujZPliku` - która uzupełnia dane na liście na podstawie pliku XML. +* `PobierzXml` - pokazuje możliwość ściągnięcia pliku xml, zawierającego +dane przygotowane po stronie serwera. + +Adres url serwera można wprowadzić w konfiguracji *Narzedzia/Opcje/Samples/Ustawienia Kursy NBP* + +W skład przykładu wchodzą trzy projekty: + +* `Example4` - zawierający elementy logiki biznesowej +* `Example4.UI` - interfejsu użytkownika +* `Example4.Tests` - testy + + +#### Zawartość przykładu: + +* `Example4`\KursWalutyNbp.cs + + Klasa implemenująca pojedynczy wiersz wyświetlany na liście zdefiniowanej na zakładce. + +* `Example4`\DzienneKursyWalutNbp.*.cs + + Klasa implementująca dane oraz metody + +* `Example4`\Extender\CfgWalutyNbpExtender.cs + + Przykładowa klasa implementująca ustawienia konfiguracyjne + +* `Example4.UI`\UI\Config.CfgWalutyNbpExtender.pageform.xml + + Definicja formularza własnej zakładki konfiguracyjnej + +* `Example4.UI`\UI\DzienneKursyWalutNbp.Ogolne.pageform.xml + + Definicja page'a dla kursów + +* `Example4.UI`\Menu.cs + + Rejestracja zakładki \ No newline at end of file From 9c8812100c4a70dada24ca197522d6ef63dfaed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Thu, 20 Feb 2020 13:54:38 +0100 Subject: [PATCH 15/21] Example5 --- Samples.sln | 33 ++++++++ .../Example4/Extender/CfgWalutyNbpExtender.cs | 5 +- .../Example5.Config/Directory.Build.props | 7 ++ .../Example5.Config/Example5.Config.csproj | 6 ++ src/Example5/Example5.Config/global.json | 5 ++ .../Example5.Tests/Example5.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 +++++ src/Example5/Example5.UI/Example5.UI.csproj | 9 +++ ...mianaNazwTowarowParams.Ogolne.pageform.xml | 22 ++++++ src/Example5/Example5/Example5.csproj | 6 ++ .../Example5/ZmianaNazwTowarowWorker.cs | 75 +++++++++++++++++++ src/Example5/Readme.md | 15 ++++ 12 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 src/Example5/Example5.Config/Directory.Build.props create mode 100644 src/Example5/Example5.Config/Example5.Config.csproj create mode 100644 src/Example5/Example5.Config/global.json create mode 100644 src/Example5/Example5.Tests/Example5.Tests.csproj create mode 100644 src/Example5/Example5.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example5/Example5.UI/Example5.UI.csproj create mode 100644 src/Example5/Example5.UI/UI/ZmianaNazwTowarowParams.Ogolne.pageform.xml create mode 100644 src/Example5/Example5/Example5.csproj create mode 100644 src/Example5/Example5/ZmianaNazwTowarowWorker.cs create mode 100644 src/Example5/Readme.md diff --git a/Samples.sln b/Samples.sln index 5bd39aa..09865fe 100644 --- a/Samples.sln +++ b/Samples.sln @@ -86,6 +86,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example4.UI", "src\Example4 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example4.Tests", "src\Example4\Example4.Tests\Example4.Tests.csproj", "{BC71E9BE-8765-4444-A16E-E786EAB6CF7F}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example5", "Example5", "{41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2}" + ProjectSection(SolutionItems) = preProject + src\Example5\Readme.md = src\Example5\Readme.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.Config", "src\Example5\Example5.Config\Example5.Config.csproj", "{98856534-6E7D-4A81-BDEF-5F9493CFC2FF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5", "src\Example5\Example5\Example5.csproj", "{D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.UI", "src\Example5\Example5.UI\Example5.UI.csproj", "{26C693A4-2DFE-4BB9-9484-1F88F037F994}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.Tests", "src\Example5\Example5.Tests\Example5.Tests.csproj", "{35BFCDB3-E35A-4619-9F9F-454CC430A403}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -172,6 +185,22 @@ Global {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|Any CPU.Build.0 = Debug|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.Build.0 = Release|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Release|Any CPU.Build.0 = Release|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|Any CPU.Build.0 = Release|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|Any CPU.Build.0 = Release|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -197,6 +226,10 @@ Global {B6EF0217-7110-4CEA-9450-B30D8F3D55E5} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} {9D33DA69-0D14-4442-8DAE-2FE528AA962B} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} {BC71E9BE-8765-4444-A16E-E786EAB6CF7F} = {690B0B2F-9184-4047-9F47-8408ADDB0EE4} + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} + {26C693A4-2DFE-4BB9-9484-1F88F037F994} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} + {35BFCDB3-E35A-4619-9F9F-454CC430A403} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs b/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs index 581e988..c62a70a 100644 --- a/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs +++ b/src/Example4/Example4/Extender/CfgWalutyNbpExtender.cs @@ -1,13 +1,10 @@ -#define EXAMPLE3 - + using Soneta.Business; using Soneta.Config; using Samples.Example4.Extender; // Rejestracja extender'a użytego na interfejsie -#if EXAMPLE3 [assembly: Worker(typeof(CfgWalutyNbpExtender))] -#endif namespace Samples.Example4.Extender { public class CfgWalutyNbpExtender diff --git a/src/Example5/Example5.Config/Directory.Build.props b/src/Example5/Example5.Config/Directory.Build.props new file mode 100644 index 0000000..a842560 --- /dev/null +++ b/src/Example5/Example5.Config/Directory.Build.props @@ -0,0 +1,7 @@ + + + + 1910.1.1 + net46 + + diff --git a/src/Example5/Example5.Config/Example5.Config.csproj b/src/Example5/Example5.Config/Example5.Config.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example5/Example5.Config/Example5.Config.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example5/Example5.Config/global.json b/src/Example5/Example5.Config/global.json new file mode 100644 index 0000000..8cfb040 --- /dev/null +++ b/src/Example5/Example5.Config/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Soneta.Sdk": "1.0.3" + } +} diff --git a/src/Example5/Example5.Tests/Example5.Tests.csproj b/src/Example5/Example5.Tests/Example5.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example5/Example5.Tests/Example5.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example5/Example5.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example5/Example5.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example5/Example5.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example5/Example5.UI/Example5.UI.csproj b/src/Example5/Example5.UI/Example5.UI.csproj new file mode 100644 index 0000000..0556b90 --- /dev/null +++ b/src/Example5/Example5.UI/Example5.UI.csproj @@ -0,0 +1,9 @@ + + + + $(SonetaTargetFramework) + + + + + \ No newline at end of file diff --git a/src/Example5/Example5.UI/UI/ZmianaNazwTowarowParams.Ogolne.pageform.xml b/src/Example5/Example5.UI/UI/ZmianaNazwTowarowParams.Ogolne.pageform.xml new file mode 100644 index 0000000..a4973c2 --- /dev/null +++ b/src/Example5/Example5.UI/UI/ZmianaNazwTowarowParams.Ogolne.pageform.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Example5/Example5/Example5.csproj b/src/Example5/Example5/Example5.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example5/Example5/Example5.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example5/Example5/ZmianaNazwTowarowWorker.cs b/src/Example5/Example5/ZmianaNazwTowarowWorker.cs new file mode 100644 index 0000000..27e3bd6 --- /dev/null +++ b/src/Example5/Example5/ZmianaNazwTowarowWorker.cs @@ -0,0 +1,75 @@ + +using System.Linq; +using Soneta.Business; +using Samples.Example5.Extender; +using Soneta.Tools; +using Soneta.Towary; + + +[assembly: Worker(typeof(ZmianaNazwTowarowWorker), typeof(Towary))] + +namespace Samples.Example5.Extender { + + public class ZmianaNazwTowarowWorker : ContextBase { + + public ZmianaNazwTowarowWorker(Context context) : base(context) { + } + + // Potrzebne dla akcji parametry + [Context] + public ZmianaNazwTowarowParams PrefixParams { + get; + set; + } + + // Potrzebne dane na których zostanie wykonana akcja + [Context] + public Towar[] Towary { + get; set; + } + + // Akcja jaka zostanie wykonana na danych w oparciu o ustawione parametry + [Action("Soneta Examples/Zmiana postfix-prefix", Mode = ActionMode.SingleSession | ActionMode.ConfirmSave | ActionMode.Progress)] + public void ZmianaNazw() { + using (var t = PrefixParams.Session.Logout(true)) { + foreach (var towar in Towary.Where(towar => PrefixParams.TypTowaru == towar.Typ)) { + + if (!PrefixParams.DodajPrefix.IsNullOrEmpty() && !towar.Nazwa.StartsWith(PrefixParams.DodajPrefix)) { + towar.Nazwa = PrefixParams.DodajPrefix + towar.Nazwa; + } + + if (!PrefixParams.DodajPostfix.IsNullOrEmpty() && !towar.Nazwa.StartsWith(PrefixParams.DodajPostfix)) { + towar.Nazwa += PrefixParams.DodajPostfix; + } + + if (!PrefixParams.UsunPrefix.IsNullOrEmpty() && towar.Nazwa.StartsWith(PrefixParams.UsunPrefix)) { + towar.Nazwa = towar.Nazwa.Substring(PrefixParams.UsunPrefix.Length); + } + + if (!PrefixParams.UsunPostfix.IsNullOrEmpty() && towar.Nazwa.EndsWith(PrefixParams.UsunPostfix)) { + towar.Nazwa = towar.Nazwa.Substring(0, towar.Nazwa.Length - PrefixParams.UsunPostfix.Length); + } + + } + t.Commit(); + } + } + } + + public class ZmianaNazwTowarowParams : ContextBase { + + public ZmianaNazwTowarowParams(Context context) : base(context) { + TypTowaru = TypTowaru.Towar; + } + + public TypTowaru TypTowaru { get; set; } + + public string DodajPrefix { get; set; } + + public string DodajPostfix { get; set; } + + public string UsunPrefix { get; set; } + + public string UsunPostfix { get; set; } + } +} diff --git a/src/Example5/Readme.md b/src/Example5/Readme.md new file mode 100644 index 0000000..d714372 --- /dev/null +++ b/src/Example5/Readme.md @@ -0,0 +1,15 @@ +### Example 5 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje możliwość definiowania pageform dla parametrów zarejestrowanego workera. + +W wyniku zastosowania dodatku, w menu czynności na liście towarów powinna pojawić się dodatkowa +sekcja o nazwie *Soneta.Examples*, która zawiera akcje o nazwie *"Zmiana postfix/prefix"* zaimplementowaną +w przykładzie. + +* `Example5`\Extender\ZmianaNazwTowarowWorker.cs + + Przykładowa klasa worker'a implementująca czynności w opraciu o klasę parametrów z którą powiązany jest zarejestrowany page. +* `Example5.UI`\UI\ZmianaNazwTowarowParams.Ogolne.pageform.xml + + Pageform zarejestrowany dla parametrów metody worker'a From 16cd2193cccf481724327e37c9a96cd3c174a761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Thu, 20 Feb 2020 14:09:54 +0100 Subject: [PATCH 16/21] rm unused Config project --- Samples.sln | 10 ++++++---- src/Example1/Example1.Config/Directory.Build.props | 7 ------- src/Example1/Example1.Config/Example1.Config.csproj | 6 ------ src/Example1/Example1.Config/global.json | 5 ----- src/Example4/Example4.Config/Directory.Build.props | 7 ------- src/Example4/Example4.Config/Example4.Config.csproj | 6 ------ src/Example4/Example4.Config/global.json | 5 ----- src/Example5/Example5.Config/Directory.Build.props | 7 ------- src/Example5/Example5.Config/Example5.Config.csproj | 6 ------ src/Example5/Example5.Config/global.json | 5 ----- 10 files changed, 6 insertions(+), 58 deletions(-) delete mode 100644 src/Example1/Example1.Config/Directory.Build.props delete mode 100644 src/Example1/Example1.Config/Example1.Config.csproj delete mode 100644 src/Example1/Example1.Config/global.json delete mode 100644 src/Example4/Example4.Config/Directory.Build.props delete mode 100644 src/Example4/Example4.Config/Example4.Config.csproj delete mode 100644 src/Example4/Example4.Config/global.json delete mode 100644 src/Example5/Example5.Config/Directory.Build.props delete mode 100644 src/Example5/Example5.Config/Example5.Config.csproj delete mode 100644 src/Example5/Example5.Config/global.json diff --git a/Samples.sln b/Samples.sln index 09865fe..491db81 100644 --- a/Samples.sln +++ b/Samples.sln @@ -91,13 +91,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example5", "Example5", "{41 src\Example5\Readme.md = src\Example5\Readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.Config", "src\Example5\Example5.Config\Example5.Config.csproj", "{98856534-6E7D-4A81-BDEF-5F9493CFC2FF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5.Config", "src\Example5\Example5.Config\Example5.Config.csproj", "{98856534-6E7D-4A81-BDEF-5F9493CFC2FF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5", "src\Example5\Example5\Example5.csproj", "{D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5", "src\Example5\Example5\Example5.csproj", "{D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.UI", "src\Example5\Example5.UI\Example5.UI.csproj", "{26C693A4-2DFE-4BB9-9484-1F88F037F994}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5.UI", "src\Example5\Example5.UI\Example5.UI.csproj", "{26C693A4-2DFE-4BB9-9484-1F88F037F994}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.Tests", "src\Example5\Example5.Tests\Example5.Tests.csproj", "{35BFCDB3-E35A-4619-9F9F-454CC430A403}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5.Tests", "src\Example5\Example5.Tests\Example5.Tests.csproj", "{35BFCDB3-E35A-4619-9F9F-454CC430A403}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example6", "Example6", "{DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Example1/Example1.Config/Directory.Build.props b/src/Example1/Example1.Config/Directory.Build.props deleted file mode 100644 index a842560..0000000 --- a/src/Example1/Example1.Config/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - 1910.1.1 - net46 - - diff --git a/src/Example1/Example1.Config/Example1.Config.csproj b/src/Example1/Example1.Config/Example1.Config.csproj deleted file mode 100644 index b421654..0000000 --- a/src/Example1/Example1.Config/Example1.Config.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(SonetaTargetFramework) - - \ No newline at end of file diff --git a/src/Example1/Example1.Config/global.json b/src/Example1/Example1.Config/global.json deleted file mode 100644 index 8cfb040..0000000 --- a/src/Example1/Example1.Config/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "msbuild-sdks": { - "Soneta.Sdk": "1.0.3" - } -} diff --git a/src/Example4/Example4.Config/Directory.Build.props b/src/Example4/Example4.Config/Directory.Build.props deleted file mode 100644 index a842560..0000000 --- a/src/Example4/Example4.Config/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - 1910.1.1 - net46 - - diff --git a/src/Example4/Example4.Config/Example4.Config.csproj b/src/Example4/Example4.Config/Example4.Config.csproj deleted file mode 100644 index b421654..0000000 --- a/src/Example4/Example4.Config/Example4.Config.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(SonetaTargetFramework) - - \ No newline at end of file diff --git a/src/Example4/Example4.Config/global.json b/src/Example4/Example4.Config/global.json deleted file mode 100644 index 8cfb040..0000000 --- a/src/Example4/Example4.Config/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "msbuild-sdks": { - "Soneta.Sdk": "1.0.3" - } -} diff --git a/src/Example5/Example5.Config/Directory.Build.props b/src/Example5/Example5.Config/Directory.Build.props deleted file mode 100644 index a842560..0000000 --- a/src/Example5/Example5.Config/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - 1910.1.1 - net46 - - diff --git a/src/Example5/Example5.Config/Example5.Config.csproj b/src/Example5/Example5.Config/Example5.Config.csproj deleted file mode 100644 index b421654..0000000 --- a/src/Example5/Example5.Config/Example5.Config.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(SonetaTargetFramework) - - \ No newline at end of file diff --git a/src/Example5/Example5.Config/global.json b/src/Example5/Example5.Config/global.json deleted file mode 100644 index 8cfb040..0000000 --- a/src/Example5/Example5.Config/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "msbuild-sdks": { - "Soneta.Sdk": "1.0.3" - } -} From c2404ae22c626bcf21fc98b7b61ed157e18e380e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Thu, 20 Feb 2020 14:40:39 +0100 Subject: [PATCH 17/21] Example6 --- Samples.sln | 24 +++++ .../{ => Extender}/ZmianaNazwTowarowWorker.cs | 0 .../Example6.Tests/Example6.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 ++++ src/Example6/Example6.UI/Example6.UI.csproj | 6 ++ .../Example6.UI/Extender/ExampleWorker.cs | 88 +++++++++++++++++++ src/Example6/Example6/Example6.csproj | 6 ++ src/Example6/README.md | 14 +++ 8 files changed, 161 insertions(+) rename src/Example5/Example5/{ => Extender}/ZmianaNazwTowarowWorker.cs (100%) create mode 100644 src/Example6/Example6.Tests/Example6.Tests.csproj create mode 100644 src/Example6/Example6.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example6/Example6.UI/Example6.UI.csproj create mode 100644 src/Example6/Example6.UI/Extender/ExampleWorker.cs create mode 100644 src/Example6/Example6/Example6.csproj create mode 100644 src/Example6/README.md diff --git a/Samples.sln b/Samples.sln index 491db81..1871cd8 100644 --- a/Samples.sln +++ b/Samples.sln @@ -100,6 +100,15 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5.Tests", "src\Example5\Example5.Tests\Example5.Tests.csproj", "{35BFCDB3-E35A-4619-9F9F-454CC430A403}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example6", "Example6", "{DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543}" + ProjectSection(SolutionItems) = preProject + src\Example6\Readme.md = src\Example6\Readme.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6", "src\Example6\Example6\Example6.csproj", "{96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.UI", "src\Example6\Example6.UI\Example6.UI.csproj", "{33313A3A-7423-4FEA-9C51-93928A4655DA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.Tests", "src\Example6\Example6.Tests\Example6.Tests.csproj", "{39A516AD-9A04-4121-B519-88284D4C0BB7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -203,6 +212,18 @@ Global {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|Any CPU.Build.0 = Debug|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.ActiveCfg = Release|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.Build.0 = Release|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|Any CPU.Build.0 = Release|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|Any CPU.Build.0 = Release|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -232,6 +253,9 @@ Global {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} {26C693A4-2DFE-4BB9-9484-1F88F037F994} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} {35BFCDB3-E35A-4619-9F9F-454CC430A403} = {41C4BA4C-C3B5-4AA6-9C44-2EEC916B86A2} + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} + {33313A3A-7423-4FEA-9C51-93928A4655DA} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} + {39A516AD-9A04-4121-B519-88284D4C0BB7} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example5/Example5/ZmianaNazwTowarowWorker.cs b/src/Example5/Example5/Extender/ZmianaNazwTowarowWorker.cs similarity index 100% rename from src/Example5/Example5/ZmianaNazwTowarowWorker.cs rename to src/Example5/Example5/Extender/ZmianaNazwTowarowWorker.cs diff --git a/src/Example6/Example6.Tests/Example6.Tests.csproj b/src/Example6/Example6.Tests/Example6.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example6/Example6.Tests/Example6.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example6/Example6.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example6/Example6.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example6/Example6.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example6/Example6.UI/Example6.UI.csproj b/src/Example6/Example6.UI/Example6.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example6/Example6.UI/Example6.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example6/Example6.UI/Extender/ExampleWorker.cs b/src/Example6/Example6.UI/Extender/ExampleWorker.cs new file mode 100644 index 0000000..c4407b8 --- /dev/null +++ b/src/Example6/Example6.UI/Extender/ExampleWorker.cs @@ -0,0 +1,88 @@ + +using Soneta.Business; +using Soneta.Business.UI; +using Soneta.CRM; +using Samples.Example6.Extender; +using Soneta.Types; + +[assembly: Worker(typeof(ExampleWorker), typeof(Kontrahent))] + + +namespace Samples.Example6.Extender { + + public class ExampleWorker { + + [Context] + public Kontrahent Kontrahent { get; set; } + + [Action(@"Soneta.Examples/MessageBox YesNo", Mode = ActionMode.SingleSession, Priority = 90001)] + public MessageBoxInformation MsgYesNo() + { + return new MessageBoxInformation("Wybierz coś") { + Text = "To jest jakaś wyświetlana informacja", + YesHandler = () => Kontrahent, + NoHandler = () => "Wciśnięty NO" + }; + } + + [Action(@"Soneta.Examples/QueryContext1 ...", Mode = ActionMode.SingleSession, Priority = 90002)] + public QueryContextInformation QueryContextExample() { + return QueryContextInformation.Create(args => new MessageBoxInformation { + Text = "Dane zostały zmienione. Potwierdzasz zapis ?", + OKHandler = () => { + using (var trans = Kontrahent.Session.Logout(true)) { + Kontrahent.Adres.Telefon = args.NowyTelefon ?? ""; + Kontrahent.Adres.Faks = args.NowyFax ?? ""; + trans.CommitUI(); + } + return null; + }, + CancelHandler = () => null, + IsCancelVisible = true, + }); + } + + [Action(@"Soneta.Examples/QueryContext2 ...", Mode = ActionMode.SingleSession, Priority = 90003)] + public QueryContextInformation QueryContextExample2() { + return QueryContextInformation.Create(args => { + using (var trans = Kontrahent.Session.Logout(true)) { + Kontrahent.Adres.Telefon = args.NowyTelefon ?? ""; + Kontrahent.Adres.Faks = args.NowyFax ?? ""; + trans.CommitUI(); + } + return null; + }); + } + + [Action(@"Soneta.Examples/QueryContext3 ...", Mode = ActionMode.SingleSession, Priority = 90004)] + public QueryContextInformation KontrahentQuery() { + var qci = new QueryContextInformation(Kontrahent) { + Caption = "Dodawanie osoby kontaktowej", + AcceptHandler = () => { + KontaktOsoba kontakt; + using (var trans = Kontrahent.Session.Logout(true)) { + kontakt = new KontaktOsoba(); + Kontrahent.Module.KontaktyOsoby.AddRow(kontakt); + kontakt.Kontrahent = Kontrahent; + trans.CommitUI(); + } + return kontakt; + } + }; + return qci; + } + + } + + public class WParams : ContextBase { + + public WParams(Context cx) : base(cx) { + } + + [Caption("Nowy numer telefonu")] + public string NowyTelefon { get; set; } + + [Caption("Nowy numer faksu")] + public string NowyFax { get; set; } + } +} diff --git a/src/Example6/Example6/Example6.csproj b/src/Example6/Example6/Example6.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example6/Example6/Example6.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example6/README.md b/src/Example6/README.md new file mode 100644 index 0000000..71ce7cf --- /dev/null +++ b/src/Example6/README.md @@ -0,0 +1,14 @@ +### Example 6 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje możliwość podpięcia workera dla typu Kontrahent z własnymi czynnościami. +Zaimplementowane czynności wykorzystują różne typy zwracanych rezultatów mające wpływ na zachowanie interfejsu użytkownika. +W przykładzie zastosowano rezultaty typu `MessageBoxInformation` i `QueryContextInformation`. +Natomiast rezultat `NamedStream` pozwalający na zwrócenie pliku został zaprezentowany w przykładzie 4 . + +W wyniku zastosowania dodatku, w menu czynności na liście kontrahentów powinna pojawić się dodatkowa +sekcja o nazwie Soneta.Examples, która zawiera 4 różne akcje zaimplementowane w przykładzie. + +* `Example6.UI`\Extender\ExampleWorker.cs + + Przykładowa klasa extender'a implementująca czynności z zastosowaniem różnych rezultatów. From 6d970bb0497ba20e14b8ed37c622ebacf3bdfabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 24 Feb 2020 10:28:49 +0100 Subject: [PATCH 18/21] Example 8 --- Samples.sln | 187 +++++++++++++++++- .../Example7.Config/Directory.Build.props | 7 + .../Example7.Config/Example7.Config.csproj | 6 + src/Example7/Example7.Config/global.json | 5 + .../Example7.Tests/Example7.Tests.csproj | 6 + .../EnsureSonetaTypesReferenceClass.cs | 17 ++ src/Example7/Example7.UI/Example7.UI.csproj | 7 + .../Example7.UI/Extender/DashboardExtender.cs | 93 +++++++++ .../DashBoard.ExampleGoogleMap.pageform.xml | 22 +++ .../UI/DashBoard.ExampleObroty.pageform.xml | 29 +++ .../DashBoard.ExamplePopulacja.pageform.xml | 28 +++ src/Example7/Example7.UI/mapa.html | 55 ++++++ src/Example7/Example7/Example7.csproj | 7 + src/Example7/Readme.md | 21 ++ .../Example8.Config/Directory.Build.props | 7 + .../Example8.Config/Example8.Config.csproj | 6 + src/Example8/Example8.Config/global.json | 5 + .../Example8.Tests/Example8.Tests.csproj | 7 + .../EnsureSonetaTypesReferenceClass.cs | 17 ++ src/Example8/Example8.UI/Example8.UI.csproj | 10 + .../UI/Notowania.Ogolne.pageform.xml | 17 ++ src/Example8/Example8.UI/ViewInfo/Menu.cs | 21 ++ src/Example8/Example8/Example8.csproj | 7 + src/Example8/Example8/Extender/Akcja.cs | 31 +++ src/Example8/Example8/Extender/Notowania.cs | 54 +++++ src/Example8/Readme.md | 14 ++ 26 files changed, 683 insertions(+), 3 deletions(-) create mode 100644 src/Example7/Example7.Config/Directory.Build.props create mode 100644 src/Example7/Example7.Config/Example7.Config.csproj create mode 100644 src/Example7/Example7.Config/global.json create mode 100644 src/Example7/Example7.Tests/Example7.Tests.csproj create mode 100644 src/Example7/Example7.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example7/Example7.UI/Example7.UI.csproj create mode 100644 src/Example7/Example7.UI/Extender/DashboardExtender.cs create mode 100644 src/Example7/Example7.UI/UI/DashBoard.ExampleGoogleMap.pageform.xml create mode 100644 src/Example7/Example7.UI/UI/DashBoard.ExampleObroty.pageform.xml create mode 100644 src/Example7/Example7.UI/UI/DashBoard.ExamplePopulacja.pageform.xml create mode 100644 src/Example7/Example7.UI/mapa.html create mode 100644 src/Example7/Example7/Example7.csproj create mode 100644 src/Example7/Readme.md create mode 100644 src/Example8/Example8.Config/Directory.Build.props create mode 100644 src/Example8/Example8.Config/Example8.Config.csproj create mode 100644 src/Example8/Example8.Config/global.json create mode 100644 src/Example8/Example8.Tests/Example8.Tests.csproj create mode 100644 src/Example8/Example8.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example8/Example8.UI/Example8.UI.csproj create mode 100644 src/Example8/Example8.UI/UI/Notowania.Ogolne.pageform.xml create mode 100644 src/Example8/Example8.UI/ViewInfo/Menu.cs create mode 100644 src/Example8/Example8/Example8.csproj create mode 100644 src/Example8/Example8/Extender/Akcja.cs create mode 100644 src/Example8/Example8/Extender/Notowania.cs create mode 100644 src/Example8/Readme.md diff --git a/Samples.sln b/Samples.sln index 1871cd8..466da5b 100644 --- a/Samples.sln +++ b/Samples.sln @@ -104,126 +104,301 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example6", "Example6", "{DF src\Example6\Readme.md = src\Example6\Readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6", "src\Example6\Example6\Example6.csproj", "{96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example6", "src\Example6\Example6\Example6.csproj", "{96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.UI", "src\Example6\Example6.UI\Example6.UI.csproj", "{33313A3A-7423-4FEA-9C51-93928A4655DA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example6.UI", "src\Example6\Example6.UI\Example6.UI.csproj", "{33313A3A-7423-4FEA-9C51-93928A4655DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.Tests", "src\Example6\Example6.Tests\Example6.Tests.csproj", "{39A516AD-9A04-4121-B519-88284D4C0BB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example6.Tests", "src\Example6\Example6.Tests\Example6.Tests.csproj", "{39A516AD-9A04-4121-B519-88284D4C0BB7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example7", "Example7", "{C1E3F91E-8F66-4AF9-88EE-4116E2445542}" + ProjectSection(SolutionItems) = preProject + src\Example7\Readme.md = src\Example7\Readme.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example7", "src\Example7\Example7\Example7.csproj", "{AF462CC2-86F4-454F-AD40-871CB945B741}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example7.UI", "src\Example7\Example7.UI\Example7.UI.csproj", "{9140DBE8-468D-4A3A-88CB-E5CAC8E93612}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example7.Tests", "src\Example7\Example7.Tests\Example7.Tests.csproj", "{1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example8", "Example8", "{B70C2CCA-794F-4962-9C13-E8A07033BA04}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8", "src\Example8\Example8\Example8.csproj", "{A0D78F56-7F17-446D-B7CB-575CFE521C9C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8.UI", "src\Example8\Example8.UI\Example8.UI.csproj", "{F3242DBA-D695-482C-9DE0-E4A5DF1B7075}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8.Tests", "src\Example8\Example8.Tests\Example8.Tests.csproj", "{7B38993A-946A-4ADD-A0E7-A9F858B6F084}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {D939A54E-F862-4B24-8CCF-1504134C12A8}.Debug|x64.Build.0 = Debug|Any CPU {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|Any CPU.ActiveCfg = Release|Any CPU {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|Any CPU.Build.0 = Release|Any CPU + {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|x64.ActiveCfg = Release|Any CPU + {D939A54E-F862-4B24-8CCF-1504134C12A8}.Release|x64.Build.0 = Release|Any CPU {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|x64.ActiveCfg = Debug|Any CPU + {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Debug|x64.Build.0 = Debug|Any CPU {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|Any CPU.ActiveCfg = Release|Any CPU {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|Any CPU.Build.0 = Release|Any CPU + {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|x64.ActiveCfg = Release|Any CPU + {A165F379-C215-49B4-99E1-2F1F3BDEDDB4}.Release|x64.Build.0 = Release|Any CPU {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|x64.ActiveCfg = Debug|Any CPU + {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Debug|x64.Build.0 = Debug|Any CPU {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|Any CPU.ActiveCfg = Release|Any CPU {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|Any CPU.Build.0 = Release|Any CPU + {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|x64.ActiveCfg = Release|Any CPU + {49A48ABE-D1FC-418B-A5EC-EEA05697A610}.Release|x64.Build.0 = Release|Any CPU {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|x64.ActiveCfg = Debug|Any CPU + {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Debug|x64.Build.0 = Debug|Any CPU {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|Any CPU.Build.0 = Release|Any CPU + {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|x64.ActiveCfg = Release|Any CPU + {4FC4954B-C8AF-4159-8B6E-24F11C605690}.Release|x64.Build.0 = Release|Any CPU {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Debug|x64.Build.0 = Debug|Any CPU {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|Any CPU.Build.0 = Release|Any CPU + {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|x64.ActiveCfg = Release|Any CPU + {2F8DAAEB-FC29-42E8-AC6D-26F7DCC8D05C}.Release|x64.Build.0 = Release|Any CPU {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|x64.ActiveCfg = Debug|Any CPU + {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Debug|x64.Build.0 = Debug|Any CPU {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|Any CPU.Build.0 = Release|Any CPU + {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|x64.ActiveCfg = Release|Any CPU + {5110FB90-B5CA-48B9-B518-CB2764F4CA5F}.Release|x64.Build.0 = Release|Any CPU {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F525776-985A-4D51-8B92-E530B97D9545}.Debug|x64.Build.0 = Debug|Any CPU {9F525776-985A-4D51-8B92-E530B97D9545}.Release|Any CPU.ActiveCfg = Release|Any CPU {9F525776-985A-4D51-8B92-E530B97D9545}.Release|Any CPU.Build.0 = Release|Any CPU + {9F525776-985A-4D51-8B92-E530B97D9545}.Release|x64.ActiveCfg = Release|Any CPU + {9F525776-985A-4D51-8B92-E530B97D9545}.Release|x64.Build.0 = Release|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Debug|x64.Build.0 = Debug|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|Any CPU.Build.0 = Release|Any CPU + {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|x64.ActiveCfg = Release|Any CPU + {CE036F3E-32C3-45B6-A7C3-2F01442CD5F7}.Release|x64.Build.0 = Release|Any CPU {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|x64.ActiveCfg = Debug|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Debug|x64.Build.0 = Debug|Any CPU {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|Any CPU.Build.0 = Release|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|x64.ActiveCfg = Release|Any CPU + {AE8400E0-6DE5-4857-9306-28C29C089A44}.Release|x64.Build.0 = Release|Any CPU {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Debug|x64.Build.0 = Debug|Any CPU {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|Any CPU.Build.0 = Release|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|x64.ActiveCfg = Release|Any CPU + {C13484B2-8653-4424-A3C8-A4C8E7EBC6F3}.Release|x64.Build.0 = Release|Any CPU {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|x64.ActiveCfg = Debug|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Debug|x64.Build.0 = Debug|Any CPU {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|Any CPU.ActiveCfg = Release|Any CPU {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|Any CPU.Build.0 = Release|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|x64.ActiveCfg = Release|Any CPU + {69218F9E-6DF2-4489-9B5F-4CCB3209E627}.Release|x64.Build.0 = Release|Any CPU {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|x64.ActiveCfg = Debug|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Debug|x64.Build.0 = Debug|Any CPU {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|Any CPU.ActiveCfg = Release|Any CPU {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|Any CPU.Build.0 = Release|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|x64.ActiveCfg = Release|Any CPU + {7FB5AE53-C4D0-4B84-97F0-2BC5873CCEF6}.Release|x64.Build.0 = Release|Any CPU {359D3C43-5D95-4031-B693-392745618E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {359D3C43-5D95-4031-B693-392745618E36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Debug|x64.ActiveCfg = Debug|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Debug|x64.Build.0 = Debug|Any CPU {359D3C43-5D95-4031-B693-392745618E36}.Release|Any CPU.ActiveCfg = Release|Any CPU {359D3C43-5D95-4031-B693-392745618E36}.Release|Any CPU.Build.0 = Release|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Release|x64.ActiveCfg = Release|Any CPU + {359D3C43-5D95-4031-B693-392745618E36}.Release|x64.Build.0 = Release|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Debug|x64.Build.0 = Debug|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|Any CPU.Build.0 = Release|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|x64.ActiveCfg = Release|Any CPU + {7E96485D-CD13-4E85-8830-1ECDAC687679}.Release|x64.Build.0 = Release|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Debug|x64.Build.0 = Debug|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|Any CPU.Build.0 = Release|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|x64.ActiveCfg = Release|Any CPU + {2F6258C6-DF86-412C-945F-DB6728FBB7D5}.Release|x64.Build.0 = Release|Any CPU {757906CE-6C18-457E-9979-713B372CFD18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {757906CE-6C18-457E-9979-713B372CFD18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Debug|x64.ActiveCfg = Debug|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Debug|x64.Build.0 = Debug|Any CPU {757906CE-6C18-457E-9979-713B372CFD18}.Release|Any CPU.ActiveCfg = Release|Any CPU {757906CE-6C18-457E-9979-713B372CFD18}.Release|Any CPU.Build.0 = Release|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Release|x64.ActiveCfg = Release|Any CPU + {757906CE-6C18-457E-9979-713B372CFD18}.Release|x64.Build.0 = Release|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|x64.ActiveCfg = Debug|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Debug|x64.Build.0 = Debug|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|Any CPU.Build.0 = Release|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|x64.ActiveCfg = Release|Any CPU + {FE3FCDBF-93F8-4BA1-A494-387E2DBC2DD0}.Release|x64.Build.0 = Release|Any CPU {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|x64.ActiveCfg = Debug|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Debug|x64.Build.0 = Debug|Any CPU {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|Any CPU.ActiveCfg = Release|Any CPU {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|Any CPU.Build.0 = Release|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|x64.ActiveCfg = Release|Any CPU + {B6EF0217-7110-4CEA-9450-B30D8F3D55E5}.Release|x64.Build.0 = Release|Any CPU {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|x64.ActiveCfg = Debug|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Debug|x64.Build.0 = Debug|Any CPU {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|Any CPU.Build.0 = Release|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|x64.ActiveCfg = Release|Any CPU + {9D33DA69-0D14-4442-8DAE-2FE528AA962B}.Release|x64.Build.0 = Release|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|x64.ActiveCfg = Debug|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Debug|x64.Build.0 = Debug|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|Any CPU.Build.0 = Release|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|x64.ActiveCfg = Release|Any CPU + {BC71E9BE-8765-4444-A16E-E786EAB6CF7F}.Release|x64.Build.0 = Release|Any CPU {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Debug|x64.ActiveCfg = Debug|Any CPU {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Release|Any CPU.Build.0 = Release|Any CPU + {98856534-6E7D-4A81-BDEF-5F9493CFC2FF}.Release|x64.ActiveCfg = Release|Any CPU {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|x64.ActiveCfg = Debug|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Debug|x64.Build.0 = Debug|Any CPU {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|Any CPU.Build.0 = Release|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|x64.ActiveCfg = Release|Any CPU + {D079568A-C4A5-4F6B-A80C-8FA45D4FA0E7}.Release|x64.Build.0 = Release|Any CPU {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|x64.ActiveCfg = Debug|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Debug|x64.Build.0 = Debug|Any CPU {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|Any CPU.ActiveCfg = Release|Any CPU {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|Any CPU.Build.0 = Release|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|x64.ActiveCfg = Release|Any CPU + {26C693A4-2DFE-4BB9-9484-1F88F037F994}.Release|x64.Build.0 = Release|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|x64.ActiveCfg = Debug|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Debug|x64.Build.0 = Debug|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.ActiveCfg = Release|Any CPU {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|Any CPU.Build.0 = Release|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|x64.ActiveCfg = Release|Any CPU + {35BFCDB3-E35A-4619-9F9F-454CC430A403}.Release|x64.Build.0 = Release|Any CPU {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Debug|x64.Build.0 = Debug|Any CPU {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|Any CPU.ActiveCfg = Release|Any CPU {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|Any CPU.Build.0 = Release|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|x64.ActiveCfg = Release|Any CPU + {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8}.Release|x64.Build.0 = Release|Any CPU {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|x64.ActiveCfg = Debug|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Debug|x64.Build.0 = Debug|Any CPU {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|Any CPU.Build.0 = Release|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|x64.ActiveCfg = Release|Any CPU + {33313A3A-7423-4FEA-9C51-93928A4655DA}.Release|x64.Build.0 = Release|Any CPU {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|x64.ActiveCfg = Debug|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Debug|x64.Build.0 = Debug|Any CPU {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|Any CPU.Build.0 = Release|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|x64.ActiveCfg = Release|Any CPU + {39A516AD-9A04-4121-B519-88284D4C0BB7}.Release|x64.Build.0 = Release|Any CPU + {AF462CC2-86F4-454F-AD40-871CB945B741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF462CC2-86F4-454F-AD40-871CB945B741}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF462CC2-86F4-454F-AD40-871CB945B741}.Debug|x64.ActiveCfg = Debug|x64 + {AF462CC2-86F4-454F-AD40-871CB945B741}.Debug|x64.Build.0 = Debug|x64 + {AF462CC2-86F4-454F-AD40-871CB945B741}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF462CC2-86F4-454F-AD40-871CB945B741}.Release|Any CPU.Build.0 = Release|Any CPU + {AF462CC2-86F4-454F-AD40-871CB945B741}.Release|x64.ActiveCfg = Release|x64 + {AF462CC2-86F4-454F-AD40-871CB945B741}.Release|x64.Build.0 = Release|x64 + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Debug|x64.ActiveCfg = Debug|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Debug|x64.Build.0 = Debug|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Release|Any CPU.Build.0 = Release|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Release|x64.ActiveCfg = Release|Any CPU + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612}.Release|x64.Build.0 = Release|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Debug|x64.ActiveCfg = Debug|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Debug|x64.Build.0 = Debug|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Release|Any CPU.Build.0 = Release|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Release|x64.ActiveCfg = Release|Any CPU + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}.Release|x64.Build.0 = Release|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Debug|x64.Build.0 = Debug|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Release|Any CPU.Build.0 = Release|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Release|x64.ActiveCfg = Release|Any CPU + {A0D78F56-7F17-446D-B7CB-575CFE521C9C}.Release|x64.Build.0 = Release|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Debug|x64.ActiveCfg = Debug|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Debug|x64.Build.0 = Debug|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Release|Any CPU.Build.0 = Release|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Release|x64.ActiveCfg = Release|Any CPU + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075}.Release|x64.Build.0 = Release|Any CPU + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Debug|x64.ActiveCfg = Debug|x64 + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Debug|x64.Build.0 = Debug|x64 + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|Any CPU.Build.0 = Release|Any CPU + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|x64.ActiveCfg = Release|x64 + {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -256,6 +431,12 @@ Global {96F95100-CD7D-4A42-8D94-E7AC7C91E2A8} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} {33313A3A-7423-4FEA-9C51-93928A4655DA} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} {39A516AD-9A04-4121-B519-88284D4C0BB7} = {DF9DC272-8E6D-4CD6-BE55-0FD8AFBA1543} + {AF462CC2-86F4-454F-AD40-871CB945B741} = {C1E3F91E-8F66-4AF9-88EE-4116E2445542} + {9140DBE8-468D-4A3A-88CB-E5CAC8E93612} = {C1E3F91E-8F66-4AF9-88EE-4116E2445542} + {1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9} = {C1E3F91E-8F66-4AF9-88EE-4116E2445542} + {A0D78F56-7F17-446D-B7CB-575CFE521C9C} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} + {F3242DBA-D695-482C-9DE0-E4A5DF1B7075} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} + {7B38993A-946A-4ADD-A0E7-A9F858B6F084} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example7/Example7.Config/Directory.Build.props b/src/Example7/Example7.Config/Directory.Build.props new file mode 100644 index 0000000..a842560 --- /dev/null +++ b/src/Example7/Example7.Config/Directory.Build.props @@ -0,0 +1,7 @@ + + + + 1910.1.1 + net46 + + diff --git a/src/Example7/Example7.Config/Example7.Config.csproj b/src/Example7/Example7.Config/Example7.Config.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example7/Example7.Config/Example7.Config.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example7/Example7.Config/global.json b/src/Example7/Example7.Config/global.json new file mode 100644 index 0000000..8cfb040 --- /dev/null +++ b/src/Example7/Example7.Config/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Soneta.Sdk": "1.0.3" + } +} diff --git a/src/Example7/Example7.Tests/Example7.Tests.csproj b/src/Example7/Example7.Tests/Example7.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example7/Example7.Tests/Example7.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example7/Example7.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example7/Example7.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example7/Example7.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example7/Example7.UI/Example7.UI.csproj b/src/Example7/Example7.UI/Example7.UI.csproj new file mode 100644 index 0000000..ddb6cf1 --- /dev/null +++ b/src/Example7/Example7.UI/Example7.UI.csproj @@ -0,0 +1,7 @@ + + + + $(SonetaTargetFramework) + + + \ No newline at end of file diff --git a/src/Example7/Example7.UI/Extender/DashboardExtender.cs b/src/Example7/Example7.UI/Extender/DashboardExtender.cs new file mode 100644 index 0000000..3adc88a --- /dev/null +++ b/src/Example7/Example7.UI/Extender/DashboardExtender.cs @@ -0,0 +1,93 @@ + +using System; +using System.Linq; +using Soneta.Business; +using Soneta.Business.App; +using Soneta.Examples.Example7.Extender; +using Soneta.Tools; + + +[assembly: Worker(typeof(New_DashboardExtender))] + + +namespace Soneta.Examples.Example7.Extender { + + public class New_DashboardExtender + { + public int LiczbaDodatnia + { + get { return 12; } + } + + public int LiczbaUjemna { + get { return -56; } + } + + public int MaxObrot { + get { return (int)DaneObrot.Max(d => d.Obrót); } + } + + public int MinObrot { + get { return (int)DaneObrot.Min(d => d.Obrót); } + } + + public int MaxPopulacja { + get { return (int)DanePopulacja.Max(d => d.Populacja); } + } + + public int MinPopulacja { + get { return (int)DanePopulacja.Min(d => d.Populacja); } + } + + public Wiersz[] DaneObrot { + get { + return obroty(); + } + } + + public WierszPopulacja[] DanePopulacja { + get { + return populacja(); + } + } + + public class Wiersz { + public string Miasto { get; set; } + public string Towar { get; set; } + public decimal Obrót { get; set; } + public decimal Marża { get; set; } + } + + public class WierszPopulacja { + public string Miasto { get; set; } + public double Populacja { get; set; } + } + + private static Wiersz[] obroty() { + return new[] { + new Wiersz{ Miasto="Kraków", Towar="A", Obrót=123, Marża=10 }, + new Wiersz{ Miasto="Kraków", Towar="B", Obrót=234, Marża=20 }, + new Wiersz{ Miasto="Kraków", Towar="C", Obrót=345, Marża=30 }, + new Wiersz{ Miasto="Kraków", Towar="D", Obrót=300, Marża=30 } + }; + } + + private static WierszPopulacja[] populacja() { + return new[] { + new WierszPopulacja{ Miasto="Kraków", Populacja=758 }, + new WierszPopulacja{ Miasto="Lublin", Populacja=347 }, + new WierszPopulacja{ Miasto="Warszawa", Populacja=1715 }, + new WierszPopulacja{ Miasto="Poznań", Populacja=550 }, + new WierszPopulacja{ Miasto="Gdańsk", Populacja=460 }, + new WierszPopulacja{ Miasto="Szczecin", Populacja=408 }, + new WierszPopulacja{ Miasto="Wrocław", Populacja=631 } + }; + } + + public string GoogleMapHtml + { + get { return String.Format("", "http://localhost/googlemap/mapa.html"); } + } + + } +} diff --git a/src/Example7/Example7.UI/UI/DashBoard.ExampleGoogleMap.pageform.xml b/src/Example7/Example7.UI/UI/DashBoard.ExampleGoogleMap.pageform.xml new file mode 100644 index 0000000..02241f0 --- /dev/null +++ b/src/Example7/Example7.UI/UI/DashBoard.ExampleGoogleMap.pageform.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Example7/Example7.UI/UI/DashBoard.ExampleObroty.pageform.xml b/src/Example7/Example7.UI/UI/DashBoard.ExampleObroty.pageform.xml new file mode 100644 index 0000000..7df9223 --- /dev/null +++ b/src/Example7/Example7.UI/UI/DashBoard.ExampleObroty.pageform.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Example7/Example7.UI/UI/DashBoard.ExamplePopulacja.pageform.xml b/src/Example7/Example7.UI/UI/DashBoard.ExamplePopulacja.pageform.xml new file mode 100644 index 0000000..9d4b46b --- /dev/null +++ b/src/Example7/Example7.UI/UI/DashBoard.ExamplePopulacja.pageform.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Example7/Example7.UI/mapa.html b/src/Example7/Example7.UI/mapa.html new file mode 100644 index 0000000..08a171a --- /dev/null +++ b/src/Example7/Example7.UI/mapa.html @@ -0,0 +1,55 @@ + + + + + + + + + + + +
+
+
+ + \ No newline at end of file diff --git a/src/Example7/Example7/Example7.csproj b/src/Example7/Example7/Example7.csproj new file mode 100644 index 0000000..01022cf --- /dev/null +++ b/src/Example7/Example7/Example7.csproj @@ -0,0 +1,7 @@ + + + + $(SonetaTargetFramework) + AnyCPU;x64 + + \ No newline at end of file diff --git a/src/Example7/Readme.md b/src/Example7/Readme.md new file mode 100644 index 0000000..06c48ae --- /dev/null +++ b/src/Example7/Readme.md @@ -0,0 +1,21 @@ +### Example 7 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje tworzenie elementu dashboard. + +Do uruchomienia przykładu wymagane jest posiadanie licencji na pulpity pracownika oraz pulpity kierownika. Należy zalogować się jako Pracownik. W wyniku zastosowania dodatku, w panelu użytkownika pojawią się dodatkowe elementy w dahshboard o nazwie +Soneta.Examples.Obroty, Soneta.Examples.Populacja i Soneta.Examples.GoogleMap. Z uwagi na zastosowanie +nowych elementów w pageform.xml przykład będzie działał od wersji 10.5. + +UWAGA !!! + +Aby przykład zadziałał prawidłowo w wersjach od 10.5, przed skompilowaniem dodatku należy dla plików +Dashboard.*.xml ustawić atrybut Embedded Resource. + +Element o nazwie Soneta.Examples.GoogleMap wymaga przygotowania strony html w oparciu o GoogleMap API. +Przykład takiej strony html znajduje się w projekcie (Example7\mapa.html). Aby wykorzystać przykład należy +wygenerować niezbędny klucz dla GoogleMap API. + +* Extender\DashboardExetnder.cs + + Przykładowa klasa extender'a implementująca dane widoczne na dashboard. diff --git a/src/Example8/Example8.Config/Directory.Build.props b/src/Example8/Example8.Config/Directory.Build.props new file mode 100644 index 0000000..a842560 --- /dev/null +++ b/src/Example8/Example8.Config/Directory.Build.props @@ -0,0 +1,7 @@ + + + + 1910.1.1 + net46 + + diff --git a/src/Example8/Example8.Config/Example8.Config.csproj b/src/Example8/Example8.Config/Example8.Config.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example8/Example8.Config/Example8.Config.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example8/Example8.Config/global.json b/src/Example8/Example8.Config/global.json new file mode 100644 index 0000000..8cfb040 --- /dev/null +++ b/src/Example8/Example8.Config/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "Soneta.Sdk": "1.0.3" + } +} diff --git a/src/Example8/Example8.Tests/Example8.Tests.csproj b/src/Example8/Example8.Tests/Example8.Tests.csproj new file mode 100644 index 0000000..01022cf --- /dev/null +++ b/src/Example8/Example8.Tests/Example8.Tests.csproj @@ -0,0 +1,7 @@ + + + + $(SonetaTargetFramework) + AnyCPU;x64 + + \ No newline at end of file diff --git a/src/Example8/Example8.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example8/Example8.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example8/Example8.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example8/Example8.UI/Example8.UI.csproj b/src/Example8/Example8.UI/Example8.UI.csproj new file mode 100644 index 0000000..61d3ec9 --- /dev/null +++ b/src/Example8/Example8.UI/Example8.UI.csproj @@ -0,0 +1,10 @@ + + + + $(SonetaTargetFramework) + + + + + + \ No newline at end of file diff --git a/src/Example8/Example8.UI/UI/Notowania.Ogolne.pageform.xml b/src/Example8/Example8.UI/UI/Notowania.Ogolne.pageform.xml new file mode 100644 index 0000000..d90e549 --- /dev/null +++ b/src/Example8/Example8.UI/UI/Notowania.Ogolne.pageform.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Example8/Example8.UI/ViewInfo/Menu.cs b/src/Example8/Example8.UI/ViewInfo/Menu.cs new file mode 100644 index 0000000..006e368 --- /dev/null +++ b/src/Example8/Example8.UI/ViewInfo/Menu.cs @@ -0,0 +1,21 @@ + + +using Soneta.Business.UI; +using Sample8.Extender; +using Soneta.Business.Licence; + +[assembly: FolderView("Samples", + Priority = 10, + Description = "Przykłady implementacji enova365", + BrickColor = FolderViewAttribute.BlueBrick, + Contexts = new object[] { LicencjeModułu.All } +)] + +[assembly: FolderView("Samples/Notowania GPW", + Priority = 13, + Description = "Przykład pokazujący programistyczne możliwości kolorowania wierszy", + ObjectType = typeof(Notowania), + ObjectPage = "Notowania.Ogolne.pageform.xml", + ReadOnlySession = false, + ConfigSession = false +)] diff --git a/src/Example8/Example8/Example8.csproj b/src/Example8/Example8/Example8.csproj new file mode 100644 index 0000000..ddb6cf1 --- /dev/null +++ b/src/Example8/Example8/Example8.csproj @@ -0,0 +1,7 @@ + + + + $(SonetaTargetFramework) + + + \ No newline at end of file diff --git a/src/Example8/Example8/Extender/Akcja.cs b/src/Example8/Example8/Extender/Akcja.cs new file mode 100644 index 0000000..064f6fd --- /dev/null +++ b/src/Example8/Example8/Extender/Akcja.cs @@ -0,0 +1,31 @@ +using Soneta.Business; + +namespace Sample8.Extender { + public class Akcja { + public string Nazwa { get; set; } + public double Kurs { get; set; } + public double Zmiana { get; set; } + public int LiczbaTransakcji { get; set; } + + public DataAppearance GetAppearance() { + var appearance = new DataAppearance(); + + if (Zmiana > 0) { + appearance.SetForeColorFromName("Green"); + } + else if (Zmiana < 0) { + appearance.SetForeColorFromName("Red"); + } + + return appearance; + } + + public DataAppearance GetAppearanceNazwa() { + var appearance = new DataAppearance(); + if (LiczbaTransakcji > 100) { + appearance.SetFontStyleFromName(DataAppearance.FontStyleNames.Bold); + } + return appearance; + } + } +} diff --git a/src/Example8/Example8/Extender/Notowania.cs b/src/Example8/Example8/Extender/Notowania.cs new file mode 100644 index 0000000..282c380 --- /dev/null +++ b/src/Example8/Example8/Extender/Notowania.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; + +namespace Sample8.Extender { + + public class Notowania { + #region Property dla formularza + + public IEnumerable AktualneNotowania { + get { + return new List() { + new Akcja() { + Nazwa = "ALIOR", + Kurs = 82.45f, + Zmiana = 1.35f, + LiczbaTransakcji = 275 + }, + new Akcja() { + Nazwa = "ERGIS", + Kurs = 4.75f, + Zmiana = 0f, + LiczbaTransakcji = 5 + }, + new Akcja() { + Nazwa = "ENEA", + Kurs = 16.25f, + Zmiana = -0.05f, + LiczbaTransakcji = 115 + }, + new Akcja() { + Nazwa = "GROCLIN", + Kurs = 10.98f, + Zmiana = 0.01f, + LiczbaTransakcji = 237 + }, + new Akcja() { + Nazwa = "INTEGERPL", + Kurs = 213f, + Zmiana = 0f, + LiczbaTransakcji = 20 + }, + new Akcja() { + Nazwa = "MENNICA", + Kurs = 14.5f, + Zmiana = 0.1f, + LiczbaTransakcji = 2 + }, + }; + } + } + + #endregion Property dla formularza + } + +} diff --git a/src/Example8/Readme.md b/src/Example8/Readme.md new file mode 100644 index 0000000..b0381c6 --- /dev/null +++ b/src/Example8/Readme.md @@ -0,0 +1,14 @@ +###Example 8 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje programistyczne możliwości kolorowania wierszy na liście. + +Aby system odpowiedno wyświetlił dany rekord, należy w odpowiedniej klasie (dotyczy to zarówno obiektów biznesowych jak i niesesyjnych) +dodać metodę GetAppearance(). Metoda ta sprawi, że pokolorowany zostanie cały wiersz. Aby pokolorowana została tylko dana komórka, należy +do metody GetAppearance dodać sufiks zawierający nazwę property np. GetAppearanceNazwa(). + +Obiekt DataAppearance zwracany przez metodę GetAppearance() pozwala ustawić takie właściwości jak kolor tła oraz kolor i styl czcionki. + +* Extender\Akcja.cs + + Przykładowa klasa implementująca metody odpowiedzialne za kolorowanie wiersza. \ No newline at end of file From 2392cb8c4b82f9bbdc12fb3f60a40b207a244239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Mon, 24 Feb 2020 15:14:47 +0100 Subject: [PATCH 19/21] Example 9 --- Samples.sln | 41 ++++++++++++++ .../Example8.Config/Directory.Build.props | 7 --- src/Example8/Example8.Config/global.json | 5 -- src/Example8/Example8.UI/ViewInfo/Menu.cs | 2 +- src/Example8/Example8/Extender/Akcja.cs | 2 +- src/Example8/Example8/Extender/Notowania.cs | 2 +- src/Example8/Readme.md | 26 +++++++-- .../Example9.Tests/Example9.Tests.csproj} | 0 .../EnsureSonetaTypesReferenceClass.cs | 17 ++++++ src/Example9/Example9.UI/Example9.UI.csproj | 6 +++ .../Extender/DynamicFormExtender.cs | 54 +++++++++++++++++++ src/Example9/Example9.UI/Menu.cs | 21 ++++++++ .../DynamicFormExtender.ogolne.pageform.xml | 16 ++++++ src/Example9/Example9/Example9.csproj | 6 +++ src/Example9/README.md | 21 ++++++++ 15 files changed, 208 insertions(+), 18 deletions(-) delete mode 100644 src/Example8/Example8.Config/Directory.Build.props delete mode 100644 src/Example8/Example8.Config/global.json rename src/{Example8/Example8.Config/Example8.Config.csproj => Example9/Example9.Tests/Example9.Tests.csproj} (100%) create mode 100644 src/Example9/Example9.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example9/Example9.UI/Example9.UI.csproj create mode 100644 src/Example9/Example9.UI/Extender/DynamicFormExtender.cs create mode 100644 src/Example9/Example9.UI/Menu.cs create mode 100644 src/Example9/Example9.UI/UI/DynamicFormExtender.ogolne.pageform.xml create mode 100644 src/Example9/Example9/Example9.csproj create mode 100644 src/Example9/README.md diff --git a/Samples.sln b/Samples.sln index 466da5b..c205aff 100644 --- a/Samples.sln +++ b/Samples.sln @@ -122,6 +122,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example7.Tests", "src\Example7\Example7.Tests\Example7.Tests.csproj", "{1C17DDEC-CFD0-4A2E-AD4D-F0536B6CC1E9}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example8", "Example8", "{B70C2CCA-794F-4962-9C13-E8A07033BA04}" + ProjectSection(SolutionItems) = preProject + src\Example8\Readme.md = src\Example8\Readme.md + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8", "src\Example8\Example8\Example8.csproj", "{A0D78F56-7F17-446D-B7CB-575CFE521C9C}" EndProject @@ -129,6 +132,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8.UI", "src\Example8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example8.Tests", "src\Example8\Example8.Tests\Example8.Tests.csproj", "{7B38993A-946A-4ADD-A0E7-A9F858B6F084}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example9", "Example9", "{4F926038-013A-41CA-AF6A-3237AFA7D90D}" + ProjectSection(SolutionItems) = preProject + src\Example9\Readme.md = src\Example9\Readme.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9", "src\Example9\Example9\Example9.csproj", "{79915F94-7CEA-4202-90F2-B0378E6F9073}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.UI", "src\Example9\Example9.UI\Example9.UI.csproj", "{BF6DF90F-8E0F-4010-A723-D0A69429CC0E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.Tests", "src\Example9\Example9.Tests\Example9.Tests.csproj", "{5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -399,6 +413,30 @@ Global {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|Any CPU.Build.0 = Release|Any CPU {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|x64.ActiveCfg = Release|x64 {7B38993A-946A-4ADD-A0E7-A9F858B6F084}.Release|x64.Build.0 = Release|x64 + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Debug|x64.ActiveCfg = Debug|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Debug|x64.Build.0 = Debug|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Release|Any CPU.Build.0 = Release|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Release|x64.ActiveCfg = Release|Any CPU + {79915F94-7CEA-4202-90F2-B0378E6F9073}.Release|x64.Build.0 = Release|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Debug|x64.ActiveCfg = Debug|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Debug|x64.Build.0 = Debug|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Release|Any CPU.Build.0 = Release|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Release|x64.ActiveCfg = Release|Any CPU + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E}.Release|x64.Build.0 = Release|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Debug|x64.ActiveCfg = Debug|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Debug|x64.Build.0 = Debug|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|Any CPU.Build.0 = Release|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|x64.ActiveCfg = Release|Any CPU + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -437,6 +475,9 @@ Global {A0D78F56-7F17-446D-B7CB-575CFE521C9C} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} {F3242DBA-D695-482C-9DE0-E4A5DF1B7075} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} {7B38993A-946A-4ADD-A0E7-A9F858B6F084} = {B70C2CCA-794F-4962-9C13-E8A07033BA04} + {79915F94-7CEA-4202-90F2-B0378E6F9073} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} + {BF6DF90F-8E0F-4010-A723-D0A69429CC0E} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} + {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example8/Example8.Config/Directory.Build.props b/src/Example8/Example8.Config/Directory.Build.props deleted file mode 100644 index a842560..0000000 --- a/src/Example8/Example8.Config/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - 1910.1.1 - net46 - - diff --git a/src/Example8/Example8.Config/global.json b/src/Example8/Example8.Config/global.json deleted file mode 100644 index 8cfb040..0000000 --- a/src/Example8/Example8.Config/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "msbuild-sdks": { - "Soneta.Sdk": "1.0.3" - } -} diff --git a/src/Example8/Example8.UI/ViewInfo/Menu.cs b/src/Example8/Example8.UI/ViewInfo/Menu.cs index 006e368..faf78b0 100644 --- a/src/Example8/Example8.UI/ViewInfo/Menu.cs +++ b/src/Example8/Example8.UI/ViewInfo/Menu.cs @@ -1,7 +1,7 @@  using Soneta.Business.UI; -using Sample8.Extender; +using Samples.Example8.Extender; using Soneta.Business.Licence; [assembly: FolderView("Samples", diff --git a/src/Example8/Example8/Extender/Akcja.cs b/src/Example8/Example8/Extender/Akcja.cs index 064f6fd..031aac0 100644 --- a/src/Example8/Example8/Extender/Akcja.cs +++ b/src/Example8/Example8/Extender/Akcja.cs @@ -1,6 +1,6 @@ using Soneta.Business; -namespace Sample8.Extender { +namespace Samples.Example8.Extender { public class Akcja { public string Nazwa { get; set; } public double Kurs { get; set; } diff --git a/src/Example8/Example8/Extender/Notowania.cs b/src/Example8/Example8/Extender/Notowania.cs index 282c380..be47238 100644 --- a/src/Example8/Example8/Extender/Notowania.cs +++ b/src/Example8/Example8/Extender/Notowania.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Sample8.Extender { +namespace Samples.Example8.Extender { public class Notowania { #region Property dla formularza diff --git a/src/Example8/Readme.md b/src/Example8/Readme.md index b0381c6..7e8065d 100644 --- a/src/Example8/Readme.md +++ b/src/Example8/Readme.md @@ -1,4 +1,4 @@ -###Example 8 +### Example 8 ----------------------------------------------------------------------------------------------------- Przykład pokazuje programistyczne możliwości kolorowania wierszy na liście. @@ -9,6 +9,26 @@ do metody GetAppearance dodać sufiks zawierający nazwę property np. GetAppear Obiekt DataAppearance zwracany przez metodę GetAppearance() pozwala ustawić takie właściwości jak kolor tła oraz kolor i styl czcionki. -* Extender\Akcja.cs +W skład przykładu wchodzą trzy projekty: - Przykładowa klasa implementująca metody odpowiedzialne za kolorowanie wiersza. \ No newline at end of file +* `Example8` - zawierający elementy logiki biznesowej +* `Example8.UI` - interfejsu użytkownika +* `Example8.Tests` - testy + + +#### Zawartość przykładu: + +* `Example8`\Extender\Akcja.cs + + Przykładowa klasa implementująca metody odpowiedzialne za kolorowanie wiersza. +* `Example8`\Extender\Notowania.cs + + Przykładowe dane. + +* `Example8.UI`\UI\Notowania.Ogolne.pageform.xml + + Definicja page'a dla Notowań + +* `Example8.UI`\ViewInfo\Menu.cs + + Rejestracja View \ No newline at end of file diff --git a/src/Example8/Example8.Config/Example8.Config.csproj b/src/Example9/Example9.Tests/Example9.Tests.csproj similarity index 100% rename from src/Example8/Example8.Config/Example8.Config.csproj rename to src/Example9/Example9.Tests/Example9.Tests.csproj diff --git a/src/Example9/Example9.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example9/Example9.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example9/Example9.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example9/Example9.UI/Example9.UI.csproj b/src/Example9/Example9.UI/Example9.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example9/Example9.UI/Example9.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example9/Example9.UI/Extender/DynamicFormExtender.cs b/src/Example9/Example9.UI/Extender/DynamicFormExtender.cs new file mode 100644 index 0000000..e0ff614 --- /dev/null +++ b/src/Example9/Example9.UI/Extender/DynamicFormExtender.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Samples.Example9.UI.Extender; +using Soneta.Business; +using Soneta.Business.UI; + +[assembly: Worker(typeof(DynamicFormExtender))] + +namespace Samples.Example9.UI.Extender +{ + class DynamicFormExtender + { + + public string Field1 { get; set; } + public string Field2 { get; set; } + public string Field3 { get; set; } + + public UIElement GetSource() + { + var stack = new StackContainer(); + var group = new GroupContainer { CaptionHtml = "Tytuł grupy", LabelHeight = "10" }; + var row = new RowContainer(); + var rowCmd = new RowContainer(); + + var field1 = new FieldElement { CaptionHtml = "Pole 1", EditValue = "{Field1}", OuterWidth = "30" }; + var field2 = new FieldElement { CaptionHtml = "Pole 2", EditValue = "{Field2}", OuterWidth = "30" }; + var field3 = new FieldElement { CaptionHtml = "Pole 3", EditValue = "{Field3}", OuterWidth = "30" }; + var command = new CommandElement { CaptionHtml = "Pokaż wartości", MethodName = "ShowFieldValue", Width = "20" }; + + row.Elements.Add(field1); + row.Elements.Add(field2); + row.Elements.Add(field3); + rowCmd.Elements.Add(command); + + group.Elements.Add(row); + group.Elements.Add(rowCmd); + stack.Elements.Add(group); + + return stack; + + } + + public MessageBoxInformation ShowFieldValue() + { + return new MessageBoxInformation("Aktualne wartości") + { + Text = String.Format("Pole1 = {0}, Pole2 = {1}, Pole3 = {2}", Field1, Field2, Field3) + }; + } + } +} diff --git a/src/Example9/Example9.UI/Menu.cs b/src/Example9/Example9.UI/Menu.cs new file mode 100644 index 0000000..2d32a41 --- /dev/null +++ b/src/Example9/Example9.UI/Menu.cs @@ -0,0 +1,21 @@ + +using System; +using Samples.Example9.UI.Extender; +using Soneta.Business.Licence; +using Soneta.Business.UI; + +[assembly: FolderView("Samples", + Priority = 10, + Description = "Przykłady implementacji enova365", + BrickColor = FolderViewAttribute.BlueBrick, + Contexts = new object[] { LicencjeModułu.All } +)] + +[assembly: FolderView("Samples/Formularz dynamiczny", + Priority = 11, + Description = "Przykład pokazujący programistyczne możliwości dynamicznego tworzenia formularza", + ObjectType = typeof(DynamicFormExtender), + ObjectPage = "DynamicFormExtender.ogolne.pageform.xml", + ReadOnlySession = false, + ConfigSession = false +)] \ No newline at end of file diff --git a/src/Example9/Example9.UI/UI/DynamicFormExtender.ogolne.pageform.xml b/src/Example9/Example9.UI/UI/DynamicFormExtender.ogolne.pageform.xml new file mode 100644 index 0000000..1c3bafe --- /dev/null +++ b/src/Example9/Example9.UI/UI/DynamicFormExtender.ogolne.pageform.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/src/Example9/Example9/Example9.csproj b/src/Example9/Example9/Example9.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example9/Example9/Example9.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example9/README.md b/src/Example9/README.md new file mode 100644 index 0000000..273cc27 --- /dev/null +++ b/src/Example9/README.md @@ -0,0 +1,21 @@ +### Example 9 +----------------------------------------------------------------------------------------------------- + +Przykład pokazuje implementacje własnej klasy, pozwalającej na dynamiczne uzupełnienie zawartości +formularza. Dla zaimplementowanej klasy została utworzona dedykowana definicja formularza. +W przykładzie pokazano wykorzystanie elementu *Include* zasilanego kontentem przez metodę zwracającą +dynamiczną wartość formularza zależną od specyficznych warunków. + +W wyniku zastosowania dodatku, powinna pojawić się dodatkowa grupa w menu głównym programu o nazwie +*Soneta.Examples*, z opcją *"Formularz dynamiczny"*, po wybraniu której pojawi się formularz utworzony +za pośrednictwem kodu programu. + +* `Example9.UI`\Extender\DynamicFormExtender.cs + + Przykładowan klasa implementująca dane oraz metody +* `Example9.UI`\Extender\DynamicFormExtender.Ogolne.pageform.xml + + Definicja zakładki powiązanej z klasą implementująca dane +* `Example9.UI`\Menu + + Rejestracja View \ No newline at end of file From 07ae460cbac93241b2d37878134e6f47c030ad81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Tue, 25 Feb 2020 13:29:16 +0100 Subject: [PATCH 20/21] Example10 --- Samples.sln | 38 +++++++++++++ .../Example10.Tests/Example10.Tests.csproj | 6 ++ .../EnsureSonetaTypesReferenceClass.cs | 17 ++++++ .../Example10.UI/Example10.UI.csproj | 6 ++ src/Example10/Example10/Example10.csproj | 6 ++ .../Extender/CennikSerwis.EksportujCennik.cs | 30 ++++++++++ .../Extender/CennikSerwis.ImportujCennik.cs | 57 +++++++++++++++++++ .../Example10/Extender/CennikSerwis.cs | 15 +++++ .../Example10/Extender/ICennikSerwis.cs | 6 ++ src/Example10/Readme.md | 18 ++++++ 10 files changed, 199 insertions(+) create mode 100644 src/Example10/Example10.Tests/Example10.Tests.csproj create mode 100644 src/Example10/Example10.UI/EnsureSonetaTypesReferenceClass.cs create mode 100644 src/Example10/Example10.UI/Example10.UI.csproj create mode 100644 src/Example10/Example10/Example10.csproj create mode 100644 src/Example10/Example10/Extender/CennikSerwis.EksportujCennik.cs create mode 100644 src/Example10/Example10/Extender/CennikSerwis.ImportujCennik.cs create mode 100644 src/Example10/Example10/Extender/CennikSerwis.cs create mode 100644 src/Example10/Example10/Extender/ICennikSerwis.cs create mode 100644 src/Example10/Readme.md diff --git a/Samples.sln b/Samples.sln index c205aff..c1070f1 100644 --- a/Samples.sln +++ b/Samples.sln @@ -143,6 +143,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.UI", "src\Example9 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.Tests", "src\Example9\Example9.Tests\Example9.Tests.csproj", "{5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example10", "Example10", "{C342F069-9167-477E-85EE-33307F203AC1}" + ProjectSection(SolutionItems) = preProject + src\Example10\Readme.md = src\Example10\Readme.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10", "src\Example10\Example10\Example10.csproj", "{269E2147-1390-49E2-A2A2-8F4293710389}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10.UI", "src\Example10\Example10.UI\Example10.UI.csproj", "{FE619DF2-A254-41E6-8413-4AB906F32A8D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10.Tests", "src\Example10\Example10.Tests\Example10.Tests.csproj", "{9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -437,6 +448,30 @@ Global {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|Any CPU.Build.0 = Release|Any CPU {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|x64.ActiveCfg = Release|Any CPU {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}.Release|x64.Build.0 = Release|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Debug|Any CPU.Build.0 = Debug|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Debug|x64.ActiveCfg = Debug|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Debug|x64.Build.0 = Debug|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Release|Any CPU.ActiveCfg = Release|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Release|Any CPU.Build.0 = Release|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Release|x64.ActiveCfg = Release|Any CPU + {269E2147-1390-49E2-A2A2-8F4293710389}.Release|x64.Build.0 = Release|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Debug|x64.ActiveCfg = Debug|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Debug|x64.Build.0 = Debug|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Release|Any CPU.Build.0 = Release|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Release|x64.ActiveCfg = Release|Any CPU + {FE619DF2-A254-41E6-8413-4AB906F32A8D}.Release|x64.Build.0 = Release|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Debug|x64.ActiveCfg = Debug|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Debug|x64.Build.0 = Debug|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|Any CPU.Build.0 = Release|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|x64.ActiveCfg = Release|Any CPU + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -478,6 +513,9 @@ Global {79915F94-7CEA-4202-90F2-B0378E6F9073} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} {BF6DF90F-8E0F-4010-A723-D0A69429CC0E} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} {5E1FBA2A-1BF2-4C2F-9F3D-751B67787753} = {4F926038-013A-41CA-AF6A-3237AFA7D90D} + {269E2147-1390-49E2-A2A2-8F4293710389} = {C342F069-9167-477E-85EE-33307F203AC1} + {FE619DF2-A254-41E6-8413-4AB906F32A8D} = {C342F069-9167-477E-85EE-33307F203AC1} + {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71} = {C342F069-9167-477E-85EE-33307F203AC1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51} diff --git a/src/Example10/Example10.Tests/Example10.Tests.csproj b/src/Example10/Example10.Tests/Example10.Tests.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example10/Example10.Tests/Example10.Tests.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example10/Example10.UI/EnsureSonetaTypesReferenceClass.cs b/src/Example10/Example10.UI/EnsureSonetaTypesReferenceClass.cs new file mode 100644 index 0000000..41ada48 --- /dev/null +++ b/src/Example10/Example10.UI/EnsureSonetaTypesReferenceClass.cs @@ -0,0 +1,17 @@ +using Soneta.Types; + +namespace SonetaAddon +{ + public static class EnsureSonetaTypesReferenceClass + { + /// + /// Ważne ze względnu na wczytywanie bibliotek, które mają referencje do Soneta.Types + /// Tylko biblioteki z referencją do Soneta.Types są wczytywane podczas analizowania form.xml + /// Cały plik "EnsureSonetaTypesReferenceClass.cs" można usunąć, jeśli dodatek zawiera jawne odwołanie + /// do biblioteki Soneta.Types, w innym wypadku plik należy pozostawić + /// +#pragma warning disable 414 + private static readonly FromTo EnsureSonetaTypesReferenceVariable = new FromTo(); +#pragma warning restore 414 + } +} \ No newline at end of file diff --git a/src/Example10/Example10.UI/Example10.UI.csproj b/src/Example10/Example10.UI/Example10.UI.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example10/Example10.UI/Example10.UI.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example10/Example10/Example10.csproj b/src/Example10/Example10/Example10.csproj new file mode 100644 index 0000000..b421654 --- /dev/null +++ b/src/Example10/Example10/Example10.csproj @@ -0,0 +1,6 @@ + + + + $(SonetaTargetFramework) + + \ No newline at end of file diff --git a/src/Example10/Example10/Extender/CennikSerwis.EksportujCennik.cs b/src/Example10/Example10/Extender/CennikSerwis.EksportujCennik.cs new file mode 100644 index 0000000..cf9b2fd --- /dev/null +++ b/src/Example10/Example10/Extender/CennikSerwis.EksportujCennik.cs @@ -0,0 +1,30 @@ +using Soneta.Business; +using Soneta.Towary; + +namespace Samples.Example10.Extender { + + public partial class CennikSerwis { + + public string EksportujCennik(string tsvContent) { + var tcsvr = initCsvReader(); + tcsvr.Read(tsvContent); + return tcsvr.ImportException != null ? tcsvr.ImportException.Message : ""; + } + + private SessionCsvReader initCsvReader() { + var csv = new SessionCsvReader { + View = initView() + }; + return csv; + } + + private View initView() { + var tm = TowaryModule.GetInstance(_session); + var view = tm.Towary.CreateView(); + view.Context = Context.Empty.Clone(_session); + view.NewRowType = typeof (Towar); + return view; + } + + } +} diff --git a/src/Example10/Example10/Extender/CennikSerwis.ImportujCennik.cs b/src/Example10/Example10/Extender/CennikSerwis.ImportujCennik.cs new file mode 100644 index 0000000..3314786 --- /dev/null +++ b/src/Example10/Example10/Extender/CennikSerwis.ImportujCennik.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Soneta.Business; +using Soneta.Towary; + +namespace Samples.Example10.Extender { + + public partial class CennikSerwis { + + public string ImportujCennik() { + string result; + try { + var tcsvw = initCsvWriter(); + using (var writer = new StringWriter()) { + tcsvw.Write(writer); + result = writer.ToString(); + } + } + catch (Exception exc) { + result = exc.Message; + } + return result; + } + + private SessionCsvWriter initCsvWriter() { + var data = initDatasource(); + var accessor = new AccessorContext { + Context = Context.Empty.Clone(_session), + MemberType = data.GetRowType() + }; + + var tsvw = new SessionCsvWriter { + HeaderMode = CsvWriterHeaderMode.Path, + DataSource = data, + Accessors = new List { + accessor.GetAccessor("Kod"), + accessor.GetAccessor("Ceny.Podstawowa.Netto") + } + }; + + foreach (var acc in tsvw.Accessors) + acc.Prepare(); + + return tsvw; + } + + private SubTable initDatasource() { + var tm = TowaryModule.GetInstance(_session); + var tkey = tm.Towary.PrimaryKey; + var condition = RowCondition.Empty; + condition &= new FieldCondition.Equal("Typ", TypTowaru.Towar); + condition &= new FieldCondition.Equal("Features.Synchronizowany", true); + return tkey[condition]; + } + } +} diff --git a/src/Example10/Example10/Extender/CennikSerwis.cs b/src/Example10/Example10/Extender/CennikSerwis.cs new file mode 100644 index 0000000..5258c37 --- /dev/null +++ b/src/Example10/Example10/Extender/CennikSerwis.cs @@ -0,0 +1,15 @@ +using Soneta.Business; +using Samples.Example10.Extender; + +[assembly: Service(typeof(ICennikSerwis), typeof(CennikSerwis), Published = true)] +namespace Samples.Example10.Extender { + + public partial class CennikSerwis : ICennikSerwis { + + private readonly Session _session; + + public CennikSerwis(Session session) { + _session = session; + } + } +} diff --git a/src/Example10/Example10/Extender/ICennikSerwis.cs b/src/Example10/Example10/Extender/ICennikSerwis.cs new file mode 100644 index 0000000..ea3d018 --- /dev/null +++ b/src/Example10/Example10/Extender/ICennikSerwis.cs @@ -0,0 +1,6 @@ +namespace Samples.Example10.Extender { + interface ICennikSerwis { + string ImportujCennik(); + string EksportujCennik(string tsvContent); + } +} diff --git a/src/Example10/Readme.md b/src/Example10/Readme.md new file mode 100644 index 0000000..dbacda1 --- /dev/null +++ b/src/Example10/Readme.md @@ -0,0 +1,18 @@ +### Example 10 +----------------------------------------------------------------------------------------------------- + + +Przykład pokazuje możliwość zdalnej wymiany danych przy wykorzystaniu zaimplementowanego w enova365 serwisu WCF. Przykład zawiera implementacje serwisu enova, którego metody zostaną udostępnione przez serwis WCF co umożliwi wymianę danych z dowolnej maszyny w sieci. Przykadowy serwis zawiera prostą implementaję importu i eksportu cennika. + +W ramach interfejsu użytkownika zarejestrowanie takiego serwisu nie powoduje pojawienia się żadnej grupy w menu głównym programu. + +* Extender\CennikSerwis.cs + + Definicja klasy serwisu oraz jego rejestracja. +* Extender\CennikSerwis.ImportujCennik.cs + + Zawiera definicje metody importującej cennik +* Extender\CennikSerwis.EksportujCennik.cs + + Zawiera definicje metody eksportującej cennik + From 335a8cec5b437baffe24f1f426f33a1ed31d00f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20=C5=BBurman?= Date: Tue, 25 Feb 2020 14:08:49 +0100 Subject: [PATCH 21/21] After merge missing projects in sln --- Samples.sln | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/Samples.sln b/Samples.sln index c1070f1..257f5d4 100644 --- a/Samples.sln +++ b/Samples.sln @@ -137,22 +137,30 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example9", "Example9", "{4F src\Example9\Readme.md = src\Example9\Readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9", "src\Example9\Example9\Example9.csproj", "{79915F94-7CEA-4202-90F2-B0378E6F9073}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example9", "src\Example9\Example9\Example9.csproj", "{79915F94-7CEA-4202-90F2-B0378E6F9073}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.UI", "src\Example9\Example9.UI\Example9.UI.csproj", "{BF6DF90F-8E0F-4010-A723-D0A69429CC0E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example9.UI", "src\Example9\Example9.UI\Example9.UI.csproj", "{BF6DF90F-8E0F-4010-A723-D0A69429CC0E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example9.Tests", "src\Example9\Example9.Tests\Example9.Tests.csproj", "{5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example9.Tests", "src\Example9\Example9.Tests\Example9.Tests.csproj", "{5E1FBA2A-1BF2-4C2F-9F3D-751B67787753}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example10", "Example10", "{C342F069-9167-477E-85EE-33307F203AC1}" ProjectSection(SolutionItems) = preProject src\Example10\Readme.md = src\Example10\Readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10", "src\Example10\Example10\Example10.csproj", "{269E2147-1390-49E2-A2A2-8F4293710389}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example10", "src\Example10\Example10\Example10.csproj", "{269E2147-1390-49E2-A2A2-8F4293710389}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10.UI", "src\Example10\Example10.UI\Example10.UI.csproj", "{FE619DF2-A254-41E6-8413-4AB906F32A8D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example10.UI", "src\Example10\Example10.UI\Example10.UI.csproj", "{FE619DF2-A254-41E6-8413-4AB906F32A8D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10.Tests", "src\Example10\Example10.Tests\Example10.Tests.csproj", "{9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example10.Tests", "src\Example10\Example10.Tests\Example10.Tests.csproj", "{9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FilesOperations", "FilesOperations", "{0E8EBB14-1B5B-4695-8924-C567352FE1B3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaveDataFromList", "src\FilesOperations\SaveDataFromList\SaveDataFromList.csproj", "{617BFEFC-31DE-450A-8CBE-23841EF3DFE8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaveInvoicesGroupingByContractor", "src\FilesOperations\SaveInvoicesGroupingByContractor\SaveInvoicesGroupingByContractor.csproj", "{997696F9-1F53-46F6-92B7-85174830F3A7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadFileFromList", "src\FilesOperations\ReadFileFromList\ReadFileFromList.csproj", "{CC481775-AF23-4F08-95D6-2C9E852E02E6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -472,6 +480,30 @@ Global {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|Any CPU.Build.0 = Release|Any CPU {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|x64.ActiveCfg = Release|Any CPU {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71}.Release|x64.Build.0 = Release|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Debug|x64.ActiveCfg = Debug|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Debug|x64.Build.0 = Debug|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Release|Any CPU.Build.0 = Release|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Release|x64.ActiveCfg = Release|Any CPU + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8}.Release|x64.Build.0 = Release|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Debug|x64.ActiveCfg = Debug|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Debug|x64.Build.0 = Debug|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Release|Any CPU.Build.0 = Release|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Release|x64.ActiveCfg = Release|Any CPU + {997696F9-1F53-46F6-92B7-85174830F3A7}.Release|x64.Build.0 = Release|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Debug|x64.Build.0 = Debug|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Release|Any CPU.Build.0 = Release|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Release|x64.ActiveCfg = Release|Any CPU + {CC481775-AF23-4F08-95D6-2C9E852E02E6}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -516,6 +548,9 @@ Global {269E2147-1390-49E2-A2A2-8F4293710389} = {C342F069-9167-477E-85EE-33307F203AC1} {FE619DF2-A254-41E6-8413-4AB906F32A8D} = {C342F069-9167-477E-85EE-33307F203AC1} {9D9A75F9-6A2B-438A-BE15-66F5BCE69C71} = {C342F069-9167-477E-85EE-33307F203AC1} + {617BFEFC-31DE-450A-8CBE-23841EF3DFE8} = {0E8EBB14-1B5B-4695-8924-C567352FE1B3} + {997696F9-1F53-46F6-92B7-85174830F3A7} = {0E8EBB14-1B5B-4695-8924-C567352FE1B3} + {CC481775-AF23-4F08-95D6-2C9E852E02E6} = {0E8EBB14-1B5B-4695-8924-C567352FE1B3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAFA3D20-F417-4EDD-88F6-F850D5CF3A51}