From b8ec9517ebf0f1ad5634dc5ad8b0f1e5afb54a17 Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Fri, 7 Sep 2018 16:59:17 +0200 Subject: [PATCH] Work-In_progress --- Parts.cs | 11 ++++- WaWi.cs | 13 +++--- WaWi.xml | 7 ++-- models/Part.cs | 12 ++++++ sharp-wawi.csproj | 10 +++++ templates/sharpwawi.Parts.hfrm | 14 +++++++ templates/sharpwawi.models.Part.hfrm | 61 ++++++++++++++++++++++++++++ www/editor.css | 31 ++++++++++++++ www/layout.hfrm | 3 +- www/navigation.hfrm | 2 +- www/style.css | 20 +-------- 11 files changed, 152 insertions(+), 32 deletions(-) create mode 100644 templates/sharpwawi.Parts.hfrm create mode 100644 templates/sharpwawi.models.Part.hfrm create mode 100644 www/editor.css diff --git a/Parts.cs b/Parts.cs index 8410950..7363179 100644 --- a/Parts.cs +++ b/Parts.cs @@ -14,11 +14,18 @@ namespace sharpwawi WaWi = waWi; } - public Part this[string key]{ + public Part this[string key] + { get => throw new KeyNotFoundException(); } + [PublishedMember] + public Part Create() + { + return new Part(); + } - + [PublishedMember] + public Part TestPart { get; } = new Part("P001-456-8765", "Der universelle Testartikel"); } } diff --git a/WaWi.cs b/WaWi.cs index e10ea14..884ee6e 100644 --- a/WaWi.cs +++ b/WaWi.cs @@ -29,7 +29,7 @@ namespace sharpwawi private void PrepareMapper() { - mapperConfiguration = new Configuration() +/* mapperConfiguration = new Configuration() .AddClass(typeof(Entity)) .AddClass(typeof(Part)) .AddClass(typeof(Assembly)) @@ -37,12 +37,15 @@ namespace sharpwawi .SetConnectionProvider(new PGSQLConnectionProvider("feuerbach.lupus","demo","demo","demo")); Mapper = new Mapper(mapperConfiguration); + */ + + } private void TestMapper() { - Console.WriteLine("TestMapper():"); +/* Console.WriteLine("TestMapper():"); Console.WriteLine("UpdateScheme():"); Mapper.UpdateScheme(); @@ -60,15 +63,15 @@ namespace sharpwawi Mapper.MappingInterface.SaveOrUpdate(parts[2]); Entity[] entities = Mapper.MappingInterface.Load(); - +*/ } - [WebCallable] + [PublishedMember] public static String Version { get; } = "V0.0.1"; - [WebCallable] + [PublishedMember] public static String CurrentTime => DateTime.Now.ToString(); diff --git a/WaWi.xml b/WaWi.xml index d26bfc6..95b7882 100644 --- a/WaWi.xml +++ b/WaWi.xml @@ -5,10 +5,9 @@ www - sharpwawi.WaWi - - - sharpwawi.Parts + sharpwawi.WaWi + templates + true diff --git a/models/Part.cs b/models/Part.cs index 68f4393..075691d 100644 --- a/models/Part.cs +++ b/models/Part.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using mapper.attributes; +using appsrv.attributes; namespace sharpwawi.models { @@ -34,11 +35,22 @@ namespace sharpwawi.models } } + [PublishedMember] + public int Priority => 1; + + [PublishedMember] + public double Rank => 2.345; + + public Assembly CreateAssembly(){ Assembly assembly = new Assembly(this); Assemblies.Add(assembly); return assembly; } + public override string ToString() + { + return String.Format("[{0}] {1}",Key,Name); + } } } diff --git a/sharp-wawi.csproj b/sharp-wawi.csproj index 4c900d3..f7016e8 100644 --- a/sharp-wawi.csproj +++ b/sharp-wawi.csproj @@ -49,6 +49,7 @@ + @@ -72,6 +73,15 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + diff --git a/templates/sharpwawi.Parts.hfrm b/templates/sharpwawi.Parts.hfrm new file mode 100644 index 0000000..6163085 --- /dev/null +++ b/templates/sharpwawi.Parts.hfrm @@ -0,0 +1,14 @@ + + + +
+ +
diff --git a/templates/sharpwawi.models.Part.hfrm b/templates/sharpwawi.models.Part.hfrm new file mode 100644 index 0000000..473e0bc --- /dev/null +++ b/templates/sharpwawi.models.Part.hfrm @@ -0,0 +1,61 @@ + + + +

[ ]

+ +
+ +
+
+
Allgemeine Angaben
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ + +
+ + +
+ +
diff --git a/www/editor.css b/www/editor.css new file mode 100644 index 0000000..22c57f3 --- /dev/null +++ b/www/editor.css @@ -0,0 +1,31 @@ +.block > label { + display: inline-block; + width: 140px; +} + +.editor { + border-radius: 4px; + border: 1px solid #6fb9df; + width: 220px; + height: 14px; + padding: 3px; + + font-size: 12px; + font-family: Courier New, Courier, monospace; + + margin: 2px; +} + +.editor:invalid { + border-radius: 4px; + border: 1px solid #ff897f; + border-width: 1px; + border-style: solid; + + background-color: #FF8080; +} + +.editor.number { + text-align: right; + width: 120px; +} diff --git a/www/layout.hfrm b/www/layout.hfrm index 1f60554..c707294 100644 --- a/www/layout.hfrm +++ b/www/layout.hfrm @@ -1,6 +1,7 @@  WaWi Version [<?=/WaWi/Version ?>] / <?=pagetitle?> +
@@ -12,7 +13,7 @@
Harald Wolff
[ AEVL ]
-
+49 7051 9291 - 410
+
+49 7051 9291 - 412
hwolff@dr-bender.de
Keine Nachrichten
diff --git a/www/navigation.hfrm b/www/navigation.hfrm index 25e5907..bedc8ca 100644 --- a/www/navigation.hfrm +++ b/www/navigation.hfrm @@ -1,7 +1,7 @@