diff --git a/BeWo.Styles/BeWo.Styles.csproj b/BeWo.Styles/BeWo.Styles.csproj
new file mode 100644
index 000000000..4872bf966
--- /dev/null
+++ b/BeWo.Styles/BeWo.Styles.csproj
@@ -0,0 +1,134 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}
+ Library
+ Properties
+ BeWo.Styles
+ BeWo.Styles
+ v4.5.2
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+ {d5e53b0f-bf5a-41e8-93e2-0f32845fc729}
+ Controls
+
+
+ {2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}
+ Shared
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/Colors/Colors.xaml b/BeWo.Styles/Colors/Colors.xaml
new file mode 100644
index 000000000..b8e174425
--- /dev/null
+++ b/BeWo.Styles/Colors/Colors.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/ButtonStyles.xaml b/BeWo.Styles/ControlStyles/ButtonStyles.xaml
new file mode 100644
index 000000000..5e01c9139
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/ButtonStyles.xaml
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/CheckBoxStyles.xaml b/BeWo.Styles/ControlStyles/CheckBoxStyles.xaml
new file mode 100644
index 000000000..9a8a06781
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/CheckBoxStyles.xaml
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/ComboBoxStyles.xaml b/BeWo.Styles/ControlStyles/ComboBoxStyles.xaml
new file mode 100644
index 000000000..f935b3b8f
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/ComboBoxStyles.xaml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/CustomControlsStyles.xaml b/BeWo.Styles/ControlStyles/CustomControlsStyles.xaml
new file mode 100644
index 000000000..b43065eec
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/CustomControlsStyles.xaml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/DateEditStyles.xaml b/BeWo.Styles/ControlStyles/DateEditStyles.xaml
new file mode 100644
index 000000000..9a7c7a5c7
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/DateEditStyles.xaml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/GroupBoxStyles.xaml b/BeWo.Styles/ControlStyles/GroupBoxStyles.xaml
new file mode 100644
index 000000000..fa4852bd1
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/GroupBoxStyles.xaml
@@ -0,0 +1,52 @@
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/LabelStyles.xaml b/BeWo.Styles/ControlStyles/LabelStyles.xaml
new file mode 100644
index 000000000..5e6432acc
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/LabelStyles.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/ListBoxStyles.xaml b/BeWo.Styles/ControlStyles/ListBoxStyles.xaml
new file mode 100644
index 000000000..db8eee48f
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/ListBoxStyles.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/NullItemComboBoxStyles.xaml b/BeWo.Styles/ControlStyles/NullItemComboBoxStyles.xaml
new file mode 100644
index 000000000..603a56e11
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/NullItemComboBoxStyles.xaml
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/RadioButtonStyles.xaml b/BeWo.Styles/ControlStyles/RadioButtonStyles.xaml
new file mode 100644
index 000000000..70e0a0711
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/RadioButtonStyles.xaml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/TextBoxStyles.xaml b/BeWo.Styles/ControlStyles/TextBoxStyles.xaml
new file mode 100644
index 000000000..65b641174
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/TextBoxStyles.xaml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/TextEditStyles.xaml b/BeWo.Styles/ControlStyles/TextEditStyles.xaml
new file mode 100644
index 000000000..f6c7d656b
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/TextEditStyles.xaml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/ControlStyles/ToggleButtonStyles.xaml b/BeWo.Styles/ControlStyles/ToggleButtonStyles.xaml
new file mode 100644
index 000000000..1829f1fff
--- /dev/null
+++ b/BeWo.Styles/ControlStyles/ToggleButtonStyles.xaml
@@ -0,0 +1,149 @@
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/Converters/EnumTranslationConverter.cs b/BeWo.Styles/Converters/EnumTranslationConverter.cs
new file mode 100644
index 000000000..f8293c6fc
--- /dev/null
+++ b/BeWo.Styles/Converters/EnumTranslationConverter.cs
@@ -0,0 +1,37 @@
+using BS.Shared.Core;
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace BeWo.Styles.Converters
+{
+ public class EnumTranslationConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is Enum e)
+ {
+ if (EnumTranslations.Wohnhilfe2Translation.TryGetValue(e, out string v))
+ {
+ return v;
+ }
+ // RE:
+ // EnumTranslationConverter, aber betrachtet nicht alle?
+ // Brauche hier eig nur EnumTranslations.Gkv2Translation
+ if (EnumTranslations.AllTranslations.TryGetValue(e, out string vv))
+ {
+ return vv;
+ }
+
+ return e;
+ }
+
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BeWo.Styles/DataTemplates/ControlTemplates.xaml b/BeWo.Styles/DataTemplates/ControlTemplates.xaml
new file mode 100644
index 000000000..c80f0ce16
--- /dev/null
+++ b/BeWo.Styles/DataTemplates/ControlTemplates.xaml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/DataTemplates/DataTemplates.xaml b/BeWo.Styles/DataTemplates/DataTemplates.xaml
new file mode 100644
index 000000000..e1a69a1f9
--- /dev/null
+++ b/BeWo.Styles/DataTemplates/DataTemplates.xaml
@@ -0,0 +1,4 @@
+
\ No newline at end of file
diff --git a/BeWo.Styles/ModernOrangeBlack.xaml b/BeWo.Styles/ModernOrangeBlack.xaml
new file mode 100644
index 000000000..20f5b9e85
--- /dev/null
+++ b/BeWo.Styles/ModernOrangeBlack.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.Styles/Properties/AssemblyInfo.cs b/BeWo.Styles/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..57e86dd3e
--- /dev/null
+++ b/BeWo.Styles/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die einer Assembly zugeordnet sind.
+[assembly: AssemblyTitle("BeWo.Styles")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BeWo.Styles")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
+// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
+// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("9bab16de-e284-4b57-bd09-763fc5ce521a")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+// indem Sie "*" wie unten gezeigt eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/BeWo/BSLogoControl.xaml b/BeWo/BSLogoControl.xaml
index f90fa44a3..ee16ce0a4 100644
--- a/BeWo/BSLogoControl.xaml
+++ b/BeWo/BSLogoControl.xaml
@@ -1,92 +1,133 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
\ No newline at end of file
diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs
index c26b89f47..22a0c8887 100644
--- a/BeWo/ServiceProxy/Generated.cs
+++ b/BeWo/ServiceProxy/Generated.cs
@@ -2101,9 +2101,9 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvRawDataType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvTransferProtokollDC))]
@@ -2116,6 +2116,7 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC))]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.MemoryStream))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.Stream))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
@@ -5991,9 +5992,9 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
- [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvRawDataType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvTransferProtokollDC))]
@@ -6006,6 +6007,7 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC))]
+ [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.MemoryStream))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.Stream))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))]
@@ -9762,38 +9764,6 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/StorniereInvoiceBases", ReplyAction="http://tempuri.org/IAccountingService/StorniereInvoiceBasesResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/StorniereInvoiceBasesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void StorniereInvoiceBases(System.Collections.Generic.List invoices);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/GetGkvAbrechnungResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungen", ReplyAction="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungenResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- System.Collections.Generic.List GetAllGkvAbrechnungen();
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungen", ReplyAction="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungenResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- System.Collections.Generic.List GetFilteredGkvAbrechnungen(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnungResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateRequestDC request);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/UpdateGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/UpdateGkvAbrechnungResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/UpdateGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC UpdateGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/DeleteGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/DeleteGkvAbrechnungResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/DeleteGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- void DeleteGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/SendNewGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/SendNewGkvAbrechnungResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/SendNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendRequestDC req);
-
- [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/SendGetIKRequest", ReplyAction="http://tempuri.org/IAccountingService/SendGetIKRequestResponse")]
- [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/SendGetIKRequestBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC SendGetIKRequest(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC req);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@@ -9989,6 +9959,84 @@ namespace BeWo.ServiceProxy
{
base.Channel.StorniereInvoiceBases(invoices);
}
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ [System.ServiceModel.ServiceContractAttribute(ConfigurationName="BeWo.ServiceProxy.IGkvAccountingService")]
+ public interface IGkvAccountingService
+ {
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/GetGkvAbrechnung", ReplyAction="http://tempuri.org/IGkvAccountingService/GetGkvAbrechnungResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/GetGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/GetAllGkvAbrechnungen", ReplyAction="http://tempuri.org/IGkvAccountingService/GetAllGkvAbrechnungenResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/GetAllGkvAbrechnungenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List GetAllGkvAbrechnungen();
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/GetFilteredGkvAbrechnungen", ReplyAction="http://tempuri.org/IGkvAccountingService/GetFilteredGkvAbrechnungenResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/GetFilteredGkvAbrechnungenBeWoFaultFault" +
+ "", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List GetFilteredGkvAbrechnungen(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/GetProtokollRawDataString", ReplyAction="http://tempuri.org/IGkvAccountingService/GetProtokollRawDataStringResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/GetProtokollRawDataStringBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ string GetProtokollRawDataString(long oid, BS.Shared.GkvRawDataType gkvRawData);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/CreateNewGkvAbrechnung", ReplyAction="http://tempuri.org/IGkvAccountingService/CreateNewGkvAbrechnungResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/CreateNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateRequestDC request);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/UpdateGkvAbrechnung", ReplyAction="http://tempuri.org/IGkvAccountingService/UpdateGkvAbrechnungResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/UpdateGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC UpdateGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/DeleteGkvAbrechnung", ReplyAction="http://tempuri.org/IGkvAccountingService/DeleteGkvAbrechnungResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/DeleteGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ void DeleteGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/SendNewGkvAbrechnung", ReplyAction="http://tempuri.org/IGkvAccountingService/SendNewGkvAbrechnungResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/SendNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendRequestDC req);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGkvAccountingService/SendGetIKRequest", ReplyAction="http://tempuri.org/IGkvAccountingService/SendGetIKRequestResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IGkvAccountingService/SendGetIKRequestBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC SendGetIKRequest(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC req);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ public interface IGkvAccountingServiceChannel : BeWo.ServiceProxy.IGkvAccountingService, System.ServiceModel.IClientChannel
+ {
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ public partial class GkvAccountingServiceClient : System.ServiceModel.ClientBase, BeWo.ServiceProxy.IGkvAccountingService
+ {
+
+ public GkvAccountingServiceClient()
+ {
+ }
+
+ public GkvAccountingServiceClient(string endpointConfigurationName) :
+ base(endpointConfigurationName)
+ {
+ }
+
+ public GkvAccountingServiceClient(string endpointConfigurationName, string remoteAddress) :
+ base(endpointConfigurationName, remoteAddress)
+ {
+ }
+
+ public GkvAccountingServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(endpointConfigurationName, remoteAddress)
+ {
+ }
+
+ public GkvAccountingServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(binding, remoteAddress)
+ {
+ }
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid)
{
@@ -10005,6 +10053,11 @@ namespace BeWo.ServiceProxy
return base.Channel.GetFilteredGkvAbrechnungen(gkvAbrechnungViewFilter);
}
+ public string GetProtokollRawDataString(long oid, BS.Shared.GkvRawDataType gkvRawData)
+ {
+ return base.Channel.GetProtokollRawDataString(oid, gkvRawData);
+ }
+
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateRequestDC request)
{
return base.Channel.CreateNewGkvAbrechnung(request);
diff --git a/BeWo/ServiceProxy/ServiceFacade.cs b/BeWo/ServiceProxy/ServiceFacade.cs
index 60f6ae8e1..934ca8f88 100644
--- a/BeWo/ServiceProxy/ServiceFacade.cs
+++ b/BeWo/ServiceProxy/ServiceFacade.cs
@@ -6,13 +6,15 @@ using System.ServiceModel;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
-
+using System.Windows.Controls;
+using System.Windows.Threading;
using BeWo.Multitenancy;
using BeWo.Security;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
+using DevExpress.CodeParser;
namespace BeWo.ServiceProxy
{
@@ -59,6 +61,7 @@ namespace BeWo.ServiceProxy
{ typeof(IAnalysisService), new EndpointAddress(_ServerName + "AnalysisService.svc") },
{ typeof(IMailService), new EndpointAddress(_ServerName + "MailService.svc") },
{ typeof(IAccountingService), new EndpointAddress(_ServerName + "AccountingService.svc") },
+ { typeof(IGkvAccountingService), new EndpointAddress(_ServerName + "GkvAccountingService.svc") },
{ typeof(IReportService), new EndpointAddress(_ServerName + "ReportService.svc") }
};
@@ -232,21 +235,19 @@ namespace BeWo.ServiceProxy
return default(T);
}
- public static void DoWohnheimServiceAsync(Func pFunc, Action pCallBack, bool showWaitDialog)
+ #region Wohnheim
+ public static void DoWohnheimServiceAsync(Func pFunc, Action pCallBack, bool showWaitDialog)
{
DoAsync(pFunc, pCallBack, showWaitDialog);
}
-
public static void DoWohnheimServiceAsync(Func pFunc, Action pCallBack)
{
DoAsync(pFunc, pCallBack, true);
}
-
public static void DoWohnheimServiceAsync(Action pAction)
{
DoAsync(pAction, true);
}
-
public static void DoWohnheimServiceSync(Action pAction)
{
try
@@ -258,12 +259,11 @@ namespace BeWo.ServiceProxy
ShowErrorMessage(e);
}
}
-
- public static T DoWohnheimServiceSync(Func pFunc)
+ public static T DoWohnheimServiceSync(Func pFunc)
{
try
{
- return pFunc.Invoke(GetInstance());
+ return pFunc.Invoke(GetInstance());
}
catch (Exception e)
{
@@ -272,8 +272,61 @@ namespace BeWo.ServiceProxy
return default(T);
}
+ #endregion
- public static void DoMailServiceAsync(Func pFunc, Action pCallBack)
+ #region GkvAccounting
+ public static void DoGkvAccountingServiceAsync(Func pFunc, Action pCallBack, bool showWaitDialog)
+ {
+ DoAsync(pFunc, pCallBack, showWaitDialog);
+ }
+ public static void DoGkvAccountingServiceAsync(Func pFunc, Action pCallBack)
+ {
+ DoAsync(pFunc, pCallBack, true);
+ }
+ public static void DoGkvAccountingServiceAsyncGUI(Func pFunc, Action pCallBack, Dispatcher dispatcher)
+ {
+ Action action = (t) => dispatcher.BeginInvoke(
+ DispatcherPriority.Normal,
+ (Action)delegate
+ {
+ pCallBack(t);
+ });
+
+ DoAsync(pFunc, action, true);
+ }
+
+ public static void DoGkvAccountingServiceAsync(Action pAction)
+ {
+ DoAsync(pAction, true);
+ }
+ public static void DoGkvAccountingServiceSync(Action pAction)
+ {
+ try
+ {
+ pAction.Invoke(GetInstance());
+ }
+ catch (Exception e)
+ {
+ ShowErrorMessage(e);
+ }
+ }
+ public static T DoGkvAccountingServiceSync(Func pFunc)
+ {
+ try
+ {
+ return pFunc.Invoke(GetInstance());
+ }
+ catch (Exception e)
+ {
+ ShowErrorMessage(e);
+ }
+
+ return default(T);
+ }
+ #endregion
+
+
+ public static void DoMailServiceAsync(Func pFunc, Action pCallBack)
{
DoAsync(pFunc, pCallBack, true);
}
diff --git a/BeWo/ServiceReferences.bat b/BeWo/ServiceReferences.bat
index a16d0daee..961a31321 100644
--- a/BeWo/ServiceReferences.bat
+++ b/BeWo/ServiceReferences.bat
@@ -1 +1 @@
-svcutil.exe /noConfig /edb /n:*,BeWo.ServiceProxy /out:ServiceProxy\Generated.cs /ct:System.Collections.Generic.List`1 /r:..\Shared\bin\Debug\BS.Shared.dll http://localhost:3777/Host/EmployeeService.svc?wsdl http://localhost:3777/Host/CustomerService.svc?wsdl http://localhost:3777/Host/UserService.svc?wsdl http://localhost:3777/Host/StreamingService.svc?wsdl http://localhost:3777/Host/ValueListService.svc?wsdl http://localhost:3777/Host/DownloadService.svc?wsdl http://localhost:3777/Host/ResourceService.svc?wsdl http://localhost:3777/Host/OperationsService.svc?wsdl http://localhost:3777/Host/AnalysisService.svc?wsdl http://localhost:3777/Host/MailService.svc?wsdl http://localhost:3777/Host/AccountingService.svc?wsdl http://localhost:3777/Host/ReportService.svc?wsdl http://localhost:3777/Host/QueryService.svc?wsdl
+svcutil.exe /noConfig /edb /n:*,BeWo.ServiceProxy /out:ServiceProxy\Generated.cs /ct:System.Collections.Generic.List`1 /r:..\Shared\bin\Debug\BS.Shared.dll http://localhost:3777/Host/EmployeeService.svc?wsdl http://localhost:3777/Host/CustomerService.svc?wsdl http://localhost:3777/Host/UserService.svc?wsdl http://localhost:3777/Host/StreamingService.svc?wsdl http://localhost:3777/Host/ValueListService.svc?wsdl http://localhost:3777/Host/DownloadService.svc?wsdl http://localhost:3777/Host/ResourceService.svc?wsdl http://localhost:3777/Host/OperationsService.svc?wsdl http://localhost:3777/Host/AnalysisService.svc?wsdl http://localhost:3777/Host/MailService.svc?wsdl http://localhost:3777/Host/AccountingService.svc?wsdl http://localhost:3777/Host/GkvAccountingService.svc?wsdl http://localhost:3777/Host/ReportService.svc?wsdl http://localhost:3777/Host/QueryService.svc?wsdl
diff --git a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml.cs b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml.cs
index 651210f38..d32f09161 100644
--- a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml.cs
+++ b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml.cs
@@ -1,4 +1,5 @@
using BeWo.Core;
+using BeWo.ServiceProxy;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BS.Shared.DataContracts.GkvAbrechnung;
@@ -21,86 +22,87 @@ using System.Windows.Shapes;
namespace BeWo.View.Controls
{
- ///
- /// Interaktionslogik für GkvAbrechnungDetailControl.xaml
- ///
- public partial class GkvAbrechnungDetailControl : UserControl
- {
+ ///
+ /// Interaktionslogik für GkvAbrechnungDetailControl.xaml
+ ///
+ public partial class GkvAbrechnungDetailControl : UserControl
+ {
public GkvAbrechnungVM GkvAbrechnungVM { get; set; }
- public Window Window { get; private set; }
+ public Window Window { get; private set; }
- public GkvAbrechnungDetailControl(GkvAbrechnungVM vm, Window window)
- {
- InitializeComponent();
-
- GkvAbrechnungVM = vm;
- DataContext = vm;
-
- Window = window;
- }
-
- private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
- {
- BeWoUtils.NavigateToReportUri(((Hyperlink)sender).NavigateUri.ToString(), "Druckvorschau");
- }
-
- private void gridView_Loaded(object sender, RoutedEventArgs e)
- {
- var tableView = sender as TableView;
- if (tableView != null)
- {
- foreach (var item in tableView.VisibleColumns)
- {
- tableView.BestFitColumn(item);
- }
- }
- }
-
- private void btn_auftragsdatei_Click(object sender, RoutedEventArgs e)
- {
- var vm = datagrid_transfer.GetCurrentValue();
-
- var window = BeWoWindowBuilder.GetTextViewer("Auftragsdatei", vm.Auftragsdatei);
-
- window.Owner = Window;
-
- window.ShowDialog();
- }
-
- private void btn_nutzdatendatei_Click(object sender, RoutedEventArgs e)
- {
- var vm = datagrid_transfer.GetCurrentValue();
-
- var window = BeWoWindowBuilder.GetTextViewer("Nutzdatendatei", vm.Nutzdatendatei);
-
- window.Owner = Window;
-
- window.ShowDialog();
- }
-
- private void button_checkAll_Click(object sender, RoutedEventArgs e)
+ public GkvAbrechnungDetailControl(GkvAbrechnungVM vm, Window window)
{
+ InitializeComponent();
+ GkvAbrechnungVM = vm;
+ DataContext = vm;
+
+ Window = window;
}
- private void button_uncheckAll_Click(object sender, RoutedEventArgs e)
+ private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
-
+ BeWoUtils.NavigateToReportUri(((Hyperlink)sender).NavigateUri.ToString(), "Druckvorschau");
}
- private void gridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
- {
- if (e.Column is null)
- return;
+ private void gridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ var tableView = sender as TableView;
+ if (tableView != null)
+ {
+ foreach (var item in tableView.VisibleColumns)
+ {
+ tableView.BestFitColumn(item);
+ }
+ }
+ }
- if (e.Column.FieldName == nameof(InvoiceBaseVM.IsChecked))
- {
- if (e.Value is bool b && e.Row is InvoiceBaseVM vm)
- {
- vm.IsChecked = b;
- }
- }
- }
- }
+ private void btn_auftragsdatei_Click(object sender, RoutedEventArgs e)
+ {
+ var protokoll = datagrid_transfer.GetCurrentValue();
+
+ var oid = protokoll.GkvTransferProtokollOid.Value;
+
+ ServiceFacade.DoGkvAccountingServiceAsyncGUI(
+ service => service.GetProtokollRawDataString(oid, BS.Shared.GkvRawDataType.Auftragsdatei),
+ callback => ShowTextViewer("Auftragsdatei", callback),
+ Dispatcher);
+ }
+
+ private void btn_nutzdatendatei_Click(object sender, RoutedEventArgs e)
+ {
+ var protokoll = datagrid_transfer.GetCurrentValue();
+
+ var oid = protokoll.GkvTransferProtokollOid.Value;
+
+ ServiceFacade.DoGkvAccountingServiceAsyncGUI(
+ service => service.GetProtokollRawDataString(oid, BS.Shared.GkvRawDataType.Nutzdatendatei),
+ callback => ShowTextViewer("Nutzdatendatei", callback),
+ Dispatcher);
+ }
+
+ private void ShowTextViewer(string title, string text)
+ {
+ var window = BeWoWindowBuilder.GetTextViewer(title, text);
+
+ window.Owner = Window;
+
+ window.ShowDialog();
+ }
+
+ private void gridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
+ {
+ if (e.Column is null)
+ return;
+
+ if (e.Column.FieldName == nameof(InvoiceBaseVM.IsChecked))
+ {
+ if (e.Value is bool b && e.Row is InvoiceBaseVM vm)
+ {
+ vm.IsChecked = b;
+ }
+ }
+ }
+ }
}
diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
index b2791d849..7b4bb6f0b 100644
--- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
+++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
@@ -17,6 +17,7 @@ using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
+using BS.Shared.AppSender;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
@@ -72,7 +73,7 @@ namespace BeWo.View.Detail.Accounting
{
_IsRequesting = true;
- ServiceFacade.DoAccountingServiceAsync(s => s.GetFilteredGkvAbrechnungen(null), UpdateGkvAbrechnungList);
+ ServiceFacade.DoGkvAccountingServiceAsync(s => s.GetFilteredGkvAbrechnungen(null), UpdateGkvAbrechnungList);
}
catch(Exception e)
{
@@ -184,7 +185,7 @@ namespace BeWo.View.Detail.Accounting
SelectedInvoiceBases = checked_invoice_bases.Select(x => x.DataContract.InvoiceBaseOid.Value).ToList()
};
- ServiceFacade.DoAccountingServiceAsync(x => x.CreateNewGkvAbrechnung(gkv_filter),
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.CreateNewGkvAbrechnung(gkv_filter),
cb => Dispatcher.BeginInvoke(DispatcherPriority.Normal,
(Action)delegate
{
@@ -234,7 +235,7 @@ namespace BeWo.View.Detail.Accounting
{
var dc_in = vm.CommitToDataContract();
- ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
{
Dispatcher.Invoke(() => {
vm.UpdateByDataContract(dc_out);
@@ -267,7 +268,7 @@ namespace BeWo.View.Detail.Accounting
{
_Viewmodel.VMList.Remove(vm);
- ServiceFacade.DoAccountingServiceAsync(s => s.DeleteGkvAbrechnung(vm.CommitToDataContract()));
+ ServiceFacade.DoGkvAccountingServiceAsync(s => s.DeleteGkvAbrechnung(vm.CommitToDataContract()));
}
}
private void NewButton_OnClick(object sender, RoutedEventArgs e)
@@ -360,7 +361,7 @@ namespace BeWo.View.Detail.Accounting
dc_in.Bezahlt = b;
- ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
{
Dispatcher.Invoke(() => {
vm.UpdateByDataContract(dc_out);
@@ -374,7 +375,7 @@ namespace BeWo.View.Detail.Accounting
dc_in.UrbelegeGesendet = b;
- ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
{
Dispatcher.Invoke(() => {
vm.UpdateByDataContract(dc_out);
@@ -386,7 +387,7 @@ namespace BeWo.View.Detail.Accounting
{
var dc_in = vm.CommitToDataContract();
- ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), dc_out =>
{
Dispatcher.Invoke(() => {
vm.UpdateByDataContract(dc_out);
diff --git a/BeWo/View/Detail/MandatorView.xaml b/BeWo/View/Detail/MandatorView.xaml
index 91bdc02c1..425b5f56f 100644
--- a/BeWo/View/Detail/MandatorView.xaml
+++ b/BeWo/View/Detail/MandatorView.xaml
@@ -449,8 +449,10 @@
Grid.Row="7"
Grid.ColumnSpan="2"
Margin="3,20,3,5"
+ Checked="EnableArbeitszeiterfassung_Checked"
Content="{markup:Translate Arbeitszeit mit BeWoPlaner erfassen}"
- IsChecked="{Binding Path=EnableArbeitszeiterfassung}" Checked="EnableArbeitszeiterfassung_Checked" Unchecked="EnableArbeitszeiterfassung_Checked"/>
+ IsChecked="{Binding Path=EnableArbeitszeiterfassung}"
+ Unchecked="EnableArbeitszeiterfassung_Checked" />
x.SendGetIKRequest(req), cb => Dispatcher.Invoke(() => IKRequestCallback(req, cb)));
+ ServiceFacade.DoGkvAccountingServiceAsync(x => x.SendGetIKRequest(req), cb => Dispatcher.Invoke(() => IKRequestCallback(req, cb)));
}
private void IKRequestCallback(GkvAbrechnungGetIKRequestDC req, GkvAbrechnungGetIKResponseDC response)
diff --git a/BeWo/ViewModel/GkvAbrechnungVM.cs b/BeWo/ViewModel/GkvAbrechnungVM.cs
index 0c1f84c66..060a417d6 100644
--- a/BeWo/ViewModel/GkvAbrechnungVM.cs
+++ b/BeWo/ViewModel/GkvAbrechnungVM.cs
@@ -452,7 +452,7 @@ namespace BeWo.ViewModel
req.GkvAbrechnungOid = GkvAbrechnungOid.Value;
- ServiceFacade.DoAccountingServiceAsync(s => s.SendNewGkvAbrechnung(req),
+ ServiceFacade.DoGkvAccountingServiceAsync(s => s.SendNewGkvAbrechnung(req),
cb => Application.Current.Dispatch(() => UpdateBySendResponse(cb)), true);
}
public void UpdateBySendResponse(GkvAbrechnungSendResponseDC cb)
diff --git a/BeWo/app.config b/BeWo/app.config
index 4c3bb1ff3..df92ffbac 100644
--- a/BeWo/app.config
+++ b/BeWo/app.config
@@ -43,6 +43,7 @@
+
diff --git a/BeWoDakota.sln b/BeWoDakota.sln
index 8d5ce6861..9e69c4821 100644
--- a/BeWoDakota.sln
+++ b/BeWoDakota.sln
@@ -41,6 +41,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DakotaUnitTest", "DakotaUni
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranslationUnitTest", "TranslationUnitTest\TranslationUnitTest.csproj", "{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{BF0F7058-96E7-492B-8224-7976A32A751C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeWo.Styles", "BeWo.Styles\BeWo.Styles.csproj", "{9BAB16DE-E284-4B57-BD09-763FC5CE521A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KTDReaderGUI", "Tools\KTDReaderGUI\KTDReaderGUI\KTDReaderGUI.csproj", "{F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
@@ -199,6 +205,30 @@ Global
{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Any CPU.Build.0 = Release|Any CPU
{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|.NET.Build.0 = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|.NET.ActiveCfg = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|.NET.Build.0 = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|.NET.Build.0 = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|.NET.ActiveCfg = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|.NET.Build.0 = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -216,6 +246,8 @@ Global
{A959FE9A-1647-4C02-B2EE-6A95EBF6DC9A} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{B1FF561D-1677-4B06-9168-E7B024084B69} = {2AA59C1D-5537-4C49-9F9D-6E7CF827F687}
{83C43FEC-233D-49EF-BD23-BF842A3EBDF5} = {2AA59C1D-5537-4C49-9F9D-6E7CF827F687}
+ {9BAB16DE-E284-4B57-BD09-763FC5CE521A} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
+ {F8EE2279-EDEA-4D4A-9D0F-89B7DA7E6AC2} = {BF0F7058-96E7-492B-8224-7976A32A751C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5352BE53-F2FD-442F-85A8-4157599AA153}
diff --git a/Dakota/Dakota.csproj b/Dakota/Dakota.csproj
index 71bd00cca..934753d08 100644
--- a/Dakota/Dakota.csproj
+++ b/Dakota/Dakota.csproj
@@ -153,12 +153,24 @@
-
-
-
-
-
-
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
\ No newline at end of file
diff --git a/Dakota/KTDatei/AO05Q424.ke0.txt b/Dakota/KTDatei/AO05Q125.ke0.txt
similarity index 99%
rename from Dakota/KTDatei/AO05Q424.ke0.txt
rename to Dakota/KTDatei/AO05Q125.ke0.txt
index 590cfa64e..72a850189 100644
--- a/Dakota/KTDatei/AO05Q424.ke0.txt
+++ b/Dakota/KTDatei/AO05Q125.ke0.txt
@@ -1,5 +1,5 @@
UNA:+,? '
-UNB+UNOC:3+109910000+999999999+240910:1202+00388++AO05Q424ke0'
+UNB+UNOC:3+109910000+999999999+241210:1038+00390++AO05Q125ke0'
UNH+00001+KOTR:02:001:KV'
IDK+100295017+99+gkv informatik'
VDT+19970403'
@@ -318,7 +318,7 @@ VKG+09+104212594+5++28++++63'
VKG+09+101519213+5++28++++65'
VKG+09+104212538+5++28++++66'
VKG+09+104212594+5++28++++67'
-VKG+09+104212594+5++28++++40'
+VKG+09+104212300+5++28++++40'
VKG+09+104212594+5++28++++69'
VKG+09+101519213+5++28++++99'
VKG+03+101519213+5++07++++00'
@@ -1109,7 +1109,7 @@ VKG+09+184212516+5++28++++30'
VKG+03+104212516+5++07++++00'
VKG+09+104212607+5++28++++18'
VKG+09+104212607+5++28++++19'
-VKG+09+104212594+5++28++++40'
+VKG+09+104212300+5++28++++40'
VKG+09+104212607+5++28++++11'
VKG+09+104212607+5++28++++15'
VKG+01+104212505+5++++++00'
@@ -1134,11 +1134,10 @@ UNH+00080+KOTR:02:001:KV'
IDK+104212538+99+AOK Rheinland/Hamburg'
VDT+19970403'
FKT+02'
-NAM+01+AOK Rheinland/Hamburg+Fachbereich Rechnungsprüfung'
-ANS+2+40004+Düsseldorf+101338'
+NAM+01+AOK Rheinland/Hamburg+Rechnungsprüfung Heilmittel'
+ANS+1+40468+Düsseldorf+Wanheimer Str. 72'
ASP+01+02118791/55743++Frau Jacobs-Lange+Heilmittel'
-ASP+02+02118791/55716++Frau Krawzyk+Fahrtkosten'
-UNT+000009+00080'
+UNT+000008+00080'
UNH+00081+KOTR:02:001:KV'
IDK+104212594+99+AOK Rheinland/Hamburg'
VDT+20030915'
@@ -2522,4 +2521,12 @@ FKT+01'
NAM+01+CompetenzCenter Thüringen GmbH'
ANS+1+98528+Suhl+Fröhliche-Mann-Str. 3b'
UNT+000007+00205'
-UNZ+000205+00388'
+UNH+00206+KOTR:02:001:KV'
+IDK+104212300+99+AOK Rheinland/Hamburg'
+VDT+19970403'
+FKT+02'
+NAM+01+AOK Rheinland/Hamburg+Rechnungsprüfung Fahrkosten'
+ANS+1+40468+Düsseldorf+Wanheimer Str. 72'
+ASP+01+02118791/56515++Frau Kromat+Fahrkosten'
+UNT+000008+00206'
+UNZ+000206+00390'
\ No newline at end of file
diff --git a/Dakota/KTDatei/BK05Q424.ke1.txt b/Dakota/KTDatei/BK05Q125.ke3.txt
similarity index 94%
rename from Dakota/KTDatei/BK05Q424.ke1.txt
rename to Dakota/KTDatei/BK05Q125.ke3.txt
index b6d1a7469..265b296c2 100644
--- a/Dakota/KTDatei/BK05Q424.ke1.txt
+++ b/Dakota/KTDatei/BK05Q125.ke3.txt
@@ -1,5 +1,5 @@
UNA:+,? '
-UNB+UNOC:3+104027544+999999999+240909:0000+00235++BK05Q424ke1'
+UNB+UNOC:3+104027544+999999999+250123:1530+00239++BK05Q125KE3'
UNH+00001+KOTR:02:001:KV'
IDK+100820488+99+Brandenburgische BKK'
VDT+20100101'
@@ -1134,38 +1134,19 @@ IDK+103720893+99+Bertelsmann BKK/Ost'
VDT+20070701'
FKT+01'
VKG+01+103720893+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
-VKG+03+104027544+5++07++++76'
-VKG+09+103725342+5++28++++76'
-VKG+09+103725342+5++29++++76'
+VKG+03+104027544+5++07++++90'
VKG+09+103725342+5++28++++90'
VKG+09+103725342+5++29++++90'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+104027544+5++07++++B1'
+VKG+09+103725342+5++28++++B1'
+VKG+09+103725342+5++29++++B1'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Bertelsmann+Betriebskrankenkasse+Gesch.Ber.Neue Bundesländer'
ANS+1+33335+Gütersloh+Carl-Miele-Str. 214'
ANS+2+33311+Gütersloh+170'
-UNT+000037+00074'
+UNT+000018+00074'
UNH+00075+KOTR:02:001:KV'
IDK+103723317+99+BKK MIELE Ost'
VDT+20100401'
@@ -1189,202 +1170,165 @@ IDK+103723896+99+Heimat Krankenkasse/Ost'
VDT+20120101'
FKT+01'
VKG+01+103723896+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+09+103724238+5++28++++75'
-VKG+09+103724238+5++29++++75'
-VKG+03+104027544+5++07++++76'
-VKG+09+103724238+5++28++++76'
-VKG+09+103724238+5++29++++76'
+VKG+03+104027544+5++07++++66'
+VKG+03+103724238+5++28++++66'
+VKG+03+103724238+5++29++++66'
+VKG+03+104027544+5++07++++90'
VKG+09+103724238+5++28++++90'
VKG+09+103724238+5++29++++90'
VKG+03+104027544+5++07++++A0'
VKG+09+103724238+5++28++++A0'
VKG+09+103724238+5++29++++A0'
+VKG+03+104027544+5++07++++B1'
VKG+09+103724238+5++28++++B1'
VKG+09+103724238+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Heimat+Krankenkasse+Gesch.Ber.Neue Bundesländer'
ANS+1+33602+Bielefeld+Herforder Str. 23'
-UNT+000042+00076'
+UNT+000023+00076'
UNH+00077+KOTR:02:001:KV'
IDK+103724238+99+Heimat Krankenkasse'
VDT+20120101'
FKT+01'
VKG+01+103724238+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+09+103724238+5++28++++75'
-VKG+09+103724238+5++29++++75'
-VKG+03+104027544+5++07++++76'
-VKG+09+103724238+5++28++++76'
-VKG+09+103724238+5++29++++76'
+VKG+03+104027544+5++07++++66'
+VKG+03+103724238+5++28++++66'
+VKG+03+103724238+5++29++++66'
+VKG+03+104027544+5++07++++90'
VKG+09+103724238+5++28++++90'
VKG+09+103724238+5++29++++90'
VKG+03+104027544+5++07++++A0'
VKG+09+103724238+5++28++++A0'
VKG+09+103724238+5++29++++A0'
+VKG+03+104027544+5++07++++B1'
VKG+09+103724238+5++28++++B1'
VKG+09+103724238+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Heimat+Krankenkasse'
ANS+1+33602+Bielefeld+Herforder Str. 23'
-UNT+000042+00077'
+UNT+000023+00077'
UNH+00078+KOTR:02:001:KV'
IDK+103724249+99+BKK_DürkoppAdler'
VDT+20120525'
FKT+01'
VKG+01+103724249+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+09+103724249+5++28++++69'
-VKG+09+103724249+5++29++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+09+103724249+5++28++++75'
-VKG+09+103724249+5++29++++75'
-VKG+03+661430035+5++07++++76'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
+VKG+09+107436557+5++07++++69'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+09+107436557+5++07++++75'
+VKG+03+107436557+5++07++++76'
VKG+09+103724249+5++28++++90'
VKG+09+103724249+5++29++++90'
-VKG+09+103724249+5++28++++A0'
-VKG+09+103724249+5++29++++A0'
+VKG+09+107436557+5++07++++A0'
VKG+09+103724249+5++28++++B1'
VKG+09+103724249+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Dürkopp Adler'
+ANS+1+33605+Bielefeld+Stieghorster Str. 66'
ANS+2+33697+Bielefeld+219140'
-UNT+000040+00078'
+UNT+000038+00078'
UNH+00079+KOTR:02:001:KV'
IDK+103724272+99+BKK GILDEMEISTER SEIDENSTICKER'
VDT+20110701'
FKT+01'
VKG+01+103724272+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
-VKG+03+661430035+5++07++++76'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
+VKG+03+107436557+5++07++++69'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+03+107436557+5++07++++75'
+VKG+03+107436557+5++07++++76'
VKG+09+103724272+5++28++++90'
VKG+09+103724272+5++29++++90'
-VKG+09+103724272+5++28++++A0'
-VKG+09+103724272+5++29++++A0'
+VKG+03+107436557+5++07++++A0'
VKG+09+103724272+5++28++++B1'
VKG+09+103724272+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Gildemeister Seidensticker'
ANS+1+33649+Bielefeld+Winterstr. 49'
ANS+2+33621+Bielefeld+140160'
-UNT+000039+00079'
+UNT+000038+00079'
UNH+00080+KOTR:02:001:KV'
IDK+103724294+99+BKK Diakonie'
VDT+20080101'
FKT+01'
VKG+01+103724294+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
VKG+09+103724294+5++28++++69'
VKG+09+103724294+5++29++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+03+107436557+5++07++++75'
VKG+03+104027544+5++07++++76'
VKG+09+103724294+5++28++++76'
VKG+09+103724294+5++29++++76'
+VKG+03+104027544+5++07++++90'
VKG+09+103724294+5++28++++90'
VKG+09+103724294+5++29++++90'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++A0'
+VKG+09+103724294+5++28++++B1'
+VKG+09+103724294+5++29++++B1'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Diakonie'
ANS+1+33617+Bielefeld+Königsweg 8'
ANS+2+33544+Bielefeld+130104'
-UNT+000038+00080'
+UNT+000042+00080'
UNH+00081+KOTR:02:001:KV'
IDK+103724341+99+BKK GILDEMEISTER SEIDENSTICKER'
VDT+20110701'
@@ -1426,38 +1370,19 @@ IDK+103725342+99+Bertelsmann BKK'
VDT+20070701'
FKT+01'
VKG+01+103725342+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
-VKG+03+104027544+5++07++++76'
-VKG+09+103725342+5++28++++76'
-VKG+09+103725342+5++29++++76'
+VKG+03+104027544+5++07++++90'
VKG+09+103725342+5++28++++90'
VKG+09+103725342+5++29++++90'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+104027544+5++07++++B1'
+VKG+09+103725342+5++28++++B1'
+VKG+09+103725342+5++29++++B1'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Bertelsmann+Betriebskrankenkasse'
ANS+1+33335+Gütersloh+Carl-Miele-Str. 214'
ANS+2+33311+Gütersloh+170'
-UNT+000037+00085'
+UNT+000018+00085'
UNH+00086+KOTR:02:001:KV'
IDK+103725364+99+BKK Miele'
VDT+20100401'
@@ -1490,80 +1415,80 @@ IDK+103726081+99+BKK Melitta HMR'
VDT+20100701'
FKT+01'
VKG+01+103726081+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++76'
-VKG+09+103726081+5++28++++69'
-VKG+09+103726081+5++29++++69'
-VKG+09+103726081+5++28++++75'
-VKG+09+103726081+5++29++++75'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+03+107436557+5++07++++75'
+VKG+03+107436557+5++07++++76'
VKG+09+103726081+5++28++++90'
VKG+09+103726081+5++29++++90'
-VKG+09+103726081+5++28++++A0'
-VKG+09+103726081+5++29++++A0'
+VKG+03+107436557+5++07++++A0'
VKG+09+103726081+5++28++++B1'
VKG+09+103726081+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Melitta HMR'
ANS+1+32425+Minden+Marienstr. 122'
ANS+2+32372+Minden+1224'
-UNT+000041+00088'
+UNT+000037+00088'
UNH+00089+KOTR:02:001:KV'
IDK+103729701+99+BKK Diakonie/Ost'
VDT+20080101'
FKT+01'
VKG+01+103729701+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
VKG+09+103724294+5++28++++69'
VKG+09+103724294+5++29++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+03+107436557+5++07++++75'
VKG+03+104027544+5++07++++76'
VKG+09+103724294+5++28++++76'
VKG+09+103724294+5++29++++76'
+VKG+03+104027544+5++07++++90'
VKG+09+103724294+5++28++++90'
VKG+09+103724294+5++29++++90'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++A0'
+VKG+09+103724294+5++28++++B1'
+VKG+09+103724294+5++29++++B1'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Diakonie/Ost+Gesch.Ber.Neue Bundesländer'
ANS+1+33617+Bielefeld+Königsweg 8'
ANS+2+33544+Bielefeld+130104'
-UNT+000038+00089'
+UNT+000042+00089'
UNH+00090+KOTR:02:001:KV'
IDK+103736722+99+BKK HMR/Ost'
VDT+20110101'
@@ -1578,40 +1503,39 @@ IDK+103791489+99+BKK GILDEMEISTER SEIDENST./Ost'
VDT+20110701'
FKT+01'
VKG+01+103791489+5++++++00'
-VKG+03+661430035+5++07++++10'
-VKG+03+661430035+5++07++++20'
-VKG+03+661430035+5++07++++30'
-VKG+03+661430035+5++07++++40'
-VKG+03+661430035+5++07++++50'
-VKG+03+661430035+5++07++++55'
-VKG+03+661430035+5++07++++56'
-VKG+03+661430035+5++07++++57'
-VKG+03+661430035+5++07++++61'
-VKG+03+661430035+5++07++++62'
-VKG+03+661430035+5++07++++63'
-VKG+03+661430035+5++07++++65'
-VKG+03+661430035+5++07++++66'
-VKG+03+661430035+5++07++++67'
-VKG+03+661430035+5++07++++68'
-VKG+03+661430035+5++07++++69'
-VKG+03+661430035+5++07++++71'
-VKG+03+661430035+5++07++++72'
-VKG+03+661430035+5++07++++73'
-VKG+03+661430035+5++07++++74'
-VKG+03+661430035+5++07++++75'
-VKG+03+661430035+5++07++++76'
+VKG+03+107436557+5++07++++10'
+VKG+03+107436557+5++07++++20'
+VKG+03+107436557+5++07++++30'
+VKG+03+107436557+5++07++++40'
+VKG+03+107436557+5++07++++50'
+VKG+03+107436557+5++07++++55'
+VKG+03+107436557+5++07++++56'
+VKG+03+107436557+5++07++++57'
+VKG+03+107436557+5++07++++61'
+VKG+03+107436557+5++07++++62'
+VKG+03+107436557+5++07++++63'
+VKG+03+107436557+5++07++++65'
+VKG+03+107436557+5++07++++66'
+VKG+03+107436557+5++07++++67'
+VKG+03+107436557+5++07++++68'
+VKG+03+107436557+5++07++++69'
+VKG+03+107436557+5++07++++71'
+VKG+03+107436557+5++07++++72'
+VKG+03+107436557+5++07++++73'
+VKG+03+107436557+5++07++++74'
+VKG+03+107436557+5++07++++75'
+VKG+03+107436557+5++07++++76'
VKG+09+103724272+5++28++++90'
VKG+09+103724272+5++29++++90'
-VKG+09+103724272+5++28++++A0'
-VKG+09+103724272+5++29++++A0'
+VKG+03+107436557+5++07++++A0'
VKG+09+103724272+5++28++++B1'
VKG+09+103724272+5++29++++B1'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Betriebskrankenkasse+Gildemeister Seidensticker+Gesch.Ber.Neue Bundesländer'
ANS+1+33649+Bielefeld+Winterstr. 49'
ANS+2+33621+Bielefeld+140160'
-UNT+000039+00091'
+UNT+000038+00091'
UNH+00092+KOTR:02:001:KV'
IDK+103791490+99+BKK GILDEMEISTER SEIDENSTICKER'
VDT+20110701'
@@ -2152,7 +2076,7 @@ VKG+09+104926702+5++29++++66'
VKG+03+104027544+5++07++++67'
VKG+09+104926702+5++28++++67'
VKG+09+104926702+5++29++++67'
-VKG+03+104027544+5++07++++68'
+VKG+03+107436557+5++07++++68'
VKG+09+107436557+5++28++++68'
VKG+09+107436557+5++29++++68'
VKG+03+104027544+5++07++++69'
@@ -2459,67 +2383,55 @@ IDK+105734543+99+BKK Wirtschaft & Finanzen'
VDT+20100101'
FKT+01'
VKG+01+105734543+5++++++00'
-VKG+03+104027544+5++07++++76'
-VKG+09+105734543+5++28++++76'
-VKG+09+105734543+5++29++++76'
VKG+03+104027544+5++07++++90'
VKG+09+105734543+5++28++++90'
VKG+09+105734543+5++29++++90'
-VKG+03+104027544+5++07++++A0'
-VKG+09+105734543+5++28++++A0'
-VKG+09+105734543+5++29++++A0'
VKG+03+104027544+5++07++++B1'
VKG+09+105734543+5++28++++B1'
VKG+09+105734543+5++29++++B1'
-VKG+03+661430035+5++07++++99'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Die BKK für wirschaftsprüfende+und -beratende Berufe'
ANS+1+34212+Melsungen+Bahnhofstr. 19'
ANS+2+34202+Melsungen+1264'
-UNT+000024+00144'
+UNT+000018+00144'
UNH+00145+KOTR:02:001:KV'
-IDK+105734554+99+BKK Wirtschaft & Finanzen WT'
-VDT+20100101'
+IDK+108433204+99+BKK MAN und MTU Muenchen'
+VDT+19560401+20111231'
FKT+01'
-VKG+01+105734543+5++++++00'
-NAM+01+Die BKK für wirschaftsprüfende+und -beratende Berufe+Wahltarif'
-ANS+1+34212+Melsungen+Bahnhofstr. 19'
-ANS+2+34202+Melsungen+1264'
+VKG+01+108534160+5++++++00'
+NAM+01+Betriebskrankenkasse+MAN und MTU München'
+ANS+1+80995+München+Karlsfelder Str. 209e-f'
+ANS+2+80971+München+500144'
UNT+000009+00145'
UNH+00146+KOTR:02:001:KV'
-IDK+105734565+99+BKK Wirtschaft & Finanzen/Ost'
-VDT+20100101'
+IDK+105230383+99+BKK ENKA'
+VDT+20000801+20101231'
FKT+01'
-VKG+01+105792123+5++++++00'
-NAM+01+Die BKK für wirschaftsprüfende+und -beratende Berufe+Wahltarif'
-ANS+1+34212+Melsungen+Bahnhofstr. 19'
-ANS+2+34202+Melsungen+1264'
+VKG+01+105330191+5++++++00'
+NAM+01+Betriebskrankenkasse+ENKA'
+ANS+1+65451+Kelsterbach+Kleiner Kornweg 2'
+ANS+2+65440+Kelsterbach+1110'
UNT+000009+00146'
UNH+00147+KOTR:02:001:KV'
IDK+105792123+99+BKK Wirtschaft & Finanzen/Ost'
VDT+20100101'
FKT+01'
VKG+01+105792123+5++++++00'
-VKG+03+104027544+5++07++++76'
-VKG+09+105792123+5++28++++76'
-VKG+09+105792123+5++29++++76'
VKG+03+104027544+5++07++++90'
VKG+09+105792123+5++28++++90'
VKG+09+105792123+5++29++++90'
-VKG+03+104027544+5++07++++A0'
-VKG+09+105792123+5++28++++A0'
-VKG+09+105792123+5++29++++A0'
VKG+03+104027544+5++07++++B1'
VKG+09+105792123+5++28++++B1'
VKG+09+105792123+5++29++++B1'
-VKG+03+661430035+5++07++++99'
-VKG+09+661430035+5++28++++99'
-VKG+09+661430035+5++29++++99'
+VKG+03+107436557+5++07++++99'
+VKG+09+107436557+5++28++++99'
+VKG+09+107436557+5++29++++99'
NAM+01+Die BKK für wirschaftsprüfende+und -beratende Berufe+Gesch.Ber.Neue Bundesländer'
ANS+1+34212+Melsungen+Bahnhofstr. 19'
ANS+2+34202+Melsungen+1264'
-UNT+000024+00147'
+UNT+000018+00147'
UNH+00148+KOTR:02:001:KV'
IDK+105792190+99+BKK PwC/Ost'
VDT+20090101'
@@ -3656,14 +3568,14 @@ ANS+1+01445+Radebeul+Ledenweg 2'
ANS+2+01439+Radebeul+020108'
UNT+000009+00191'
UNH+00192+KOTR:02:001:KV'
-IDK+108021400+99+WMF Betriebskrankenkasse/OST'
+IDK+108021400+99+WMF BKK/OST'
VDT+20060701'
FKT+01'
VKG+01+108021400+5++++++00'
VKG+03+107436557+5++07++++00'
VKG+09+107436557+5++28++++00'
VKG+09+107436557+5++29++++00'
-NAM+01+WMF Betriebskrankenkasse+Gesch.Ber.Neue Bundesländer'
+NAM+01+WMF BKK+Gesch.Ber.Neue Bundesländer'
ANS+1+73312+Geislingen+Eberhardstr.'
ANS+2+73304+Geislingen+1412'
UNT+000012+00192'
@@ -4108,14 +4020,14 @@ ANS+1+70376+Stuttgart+Pragstr. 26-46'
ANS+2+70369+Stuttgart+500780'
UNT+000018+00220'
UNH+00221+KOTR:02:001:KV'
-IDK+108036441+99+WMF Betriebskrankenkasse'
+IDK+108036441+99+WMF BKK'
VDT+20060701'
FKT+01'
VKG+01+108036441+5++++++00'
VKG+03+107436557+5++07++++00'
VKG+09+107436557+5++28++++00'
VKG+09+107436557+5++29++++00'
-NAM+01+WMF Betriebskrankenkasse'
+NAM+01+WMF BKK'
ANS+1+73312+Geislingen+Eberhardstraße'
ANS+2+73304+Geislingen+1412'
UNT+000012+00221'
@@ -4647,51 +4559,11 @@ UNH+00255+KOTR:02:001:KV'
IDK+108632900+99+BKK Textilgruppe Hof'
VDT+20100401'
FKT+01'
-VKG+01+108632900+5++++++00'
-VKG+03+107436557+5++07++++10'
-VKG+03+107436557+5++07++++20'
-VKG+03+104027544+5++07++++30'
-VKG+09+108632900+5++28++++30'
-VKG+09+108632900+5++29++++30'
-VKG+03+107436557+5++07++++40'
-VKG+09+107436557+5++28++++40'
-VKG+09+107436557+5++29++++40'
-VKG+03+107436557+5++07++++50'
-VKG+03+107436557+5++07++++55'
-VKG+03+107436557+5++07++++56'
-VKG+03+107436557+5++07++++57'
-VKG+03+107436557+5++07++++61'
-VKG+03+107436557+5++07++++62'
-VKG+03+107436557+5++07++++63'
-VKG+03+107436557+5++07++++65'
-VKG+03+107436557+5++07++++66'
-VKG+03+107436557+5++07++++67'
-VKG+03+107436557+5++07++++68'
-VKG+03+107436557+5++07++++69'
-VKG+03+107436557+5++07++++71'
-VKG+03+107436557+5++07++++72'
-VKG+03+107436557+5++07++++73'
-VKG+03+107436557+5++07++++74'
-VKG+03+104027544+5++07++++75'
-VKG+09+108632900+5++28++++75'
-VKG+09+108632900+5++29++++75'
-VKG+03+104027544+5++07++++76'
-VKG+09+108632900+5++28++++76'
-VKG+09+108632900+5++29++++76'
-VKG+03+104027544+5++07++++90'
-VKG+09+108632900+5++28++++90'
-VKG+09+108632900+5++29++++90'
-VKG+03+104027544+5++07++++A0'
-VKG+09+108632900+5++28++++A0'
-VKG+09+108632900+5++29++++A0'
-VKG+09+108632900+5++28++++B1'
-VKG+09+108632900+5++29++++B1'
-VKG+09+107436557+5++28++++99'
-VKG+09+107436557+5++29++++99'
+VKG+01+108035612+5++++++00'
NAM+01+Gemeinsame Betriebskranken-+kasse der Gesellschaften+der textilgruppe hof'
ANS+1+95028+Hof+Fabrikzeile 21'
ANS+2+95014+Hof+1529'
-UNT+000049+00255'
+UNT+000009+00255'
UNH+00256+KOTR:02:001:KV'
IDK+108633433+99+BKK Kassana'
VDT+20110801'
@@ -5897,8 +5769,8 @@ IDK+107436557+99+AZE Emmendingen'
VDT+20000401'
FKT+01'
NAM+01+Abrechnungszentrum Emmendingen'
-ANS+1+79312+Emmendingen+An der B3 Haus-Nr. 6'
-ANS+2+79301+Emmendingen+1167'
+ANS+1+79312+Emmendingen+Bundesstraße 6'
+ANS+2+79312+Emmendingen+An der B3 Haus Nr. 6'
UEM+1+00+I8'
DFU+01+070+++++inbox@tp5.arz-emmendingen.de'
DFU+02+016+++++ftam.arz-emmendingen.de?:9000'
@@ -6151,15 +6023,6 @@ NAM+01+ktp - Betriebskrankenkasse+Gesch.Ber.Neue Bundesl
ANS+1+45138+Essen+Kurfürstenstr. 58'
UNT+000008+00359'
UNH+00360+KOTR:02:001:KV'
-IDK+108433204+99+BKK MAN und MTU Muenchen'
-VDT+19560401+20111231'
-FKT+01'
-VKG+01+108534160+5++++++00'
-NAM+01+Betriebskrankenkasse+MAN und MTU München'
-ANS+1+80995+München+Karlsfelder Str. 209e-f'
-ANS+2+80971+München+500144'
-UNT+000009+00360'
-UNH+00361+KOTR:02:001:KV'
IDK+104625684+99+GBK KOELN'
VDT+20031001+20101231'
FKT+01'
@@ -6167,8 +6030,8 @@ VKG+01+108035612+5++++++00'
NAM+01+Gemeinsame BKK der+Stadt Köln'
ANS+1+50668+Köln+Jakordenstr. 18-20'
ANS+2+50455+Köln+101534'
-UNT+000009+00361'
-UNH+00362+KOTR:02:001:KV'
+UNT+000009+00360'
+UNH+00361+KOTR:02:001:KV'
IDK+104691721+99+GBK KOELN-OST'
VDT+20031001+20101231'
FKT+01'
@@ -6176,8 +6039,8 @@ VKG+01+108034508+5++++++00'
NAM+01+Gemeinsame BKK der+Stadt Köln+Gesch.Ber.Neue Bundesländer'
ANS+1+50668+Köln+Jakordenstr. 18-20'
ANS+2+50455+Köln+101534'
-UNT+000009+00362'
-UNH+00363+KOTR:02:001:KV'
+UNT+000009+00361'
+UNH+00362+KOTR:02:001:KV'
IDK+104826197+99+BKK futur'
VDT+20071101+20111231'
FKT+01'
@@ -6185,24 +6048,24 @@ VKG+01+109723913+5++++++00'
NAM+01+Betriebskrankenkasse+futur'
ANS+1+47803+Krefeld+Girmesgath 5'
ANS+3+70426+Stuttgart'
-UNT+000009+00363'
-UNH+00364+KOTR:02:001:KV'
+UNT+000009+00362'
+UNH+00363+KOTR:02:001:KV'
IDK+104892110+99+BKK futur (Proj. ZOM)'
VDT+20040715+20111231'
FKT+01'
VKG+01+109723913+5++++++00'
NAM+01+Betriebskrankenkasse+futur+Projekt ZOM'
ANS+1+47803+Krefeld+Girmesgath 5'
-UNT+000008+00364'
-UNH+00365+KOTR:02:001:KV'
+UNT+000008+00363'
+UNH+00364+KOTR:02:001:KV'
IDK+104892358+99+BKK futur Mitarbeiterkasse'
VDT+20071101+20111231'
FKT+01'
VKG+01+109723913+5++++++00'
NAM+01+Betriebskrankenkasse+futur+Mitarbeiterkasse'
ANS+2+91701+Gunzenhausen+1101'
-UNT+000008+00365'
-UNH+00366+KOTR:02:001:KV'
+UNT+000008+00364'
+UNH+00365+KOTR:02:001:KV'
IDK+104892369+99+BKK futur/Ost'
VDT+20100601+20111231'
FKT+01'
@@ -6210,14 +6073,5 @@ VKG+01+109737010+5++++++00'
NAM+01+Betriebskrankenkasse+futur+Gesch.Ber.Neue Bundesländer'
ANS+1+47803+Krefeld+Girmesgath 5'
ANS+3+70426+Stuttgart'
-UNT+000009+00366'
-UNH+00367+KOTR:02:001:KV'
-IDK+105230383+99+BKK ENKA'
-VDT+20000801+20101231'
-FKT+01'
-VKG+01+105330191+5++++++00'
-NAM+01+Betriebskrankenkasse+ENKA'
-ANS+1+65451+Kelsterbach+Kleiner Kornweg 2'
-ANS+2+65440+Kelsterbach+1110'
-UNT+000009+00367'
-UNZ+000367+00235'
+UNT+000009+00365'
+UNZ+000365+00239'
diff --git a/Dakota/KTDatei/EK05Q324.ke4.txt b/Dakota/KTDatei/EK05Q125.ke0.txt
similarity index 99%
rename from Dakota/KTDatei/EK05Q324.ke4.txt
rename to Dakota/KTDatei/EK05Q125.ke0.txt
index 79373601d..b6cbedda4 100644
--- a/Dakota/KTDatei/EK05Q324.ke4.txt
+++ b/Dakota/KTDatei/EK05Q125.ke0.txt
@@ -1,5 +1,5 @@
UNA:+,? '
-UNB+UNOC:3+109979990+999999999+240917:1104+00001++EK05Q324KE4'
+UNB+UNOC:3+109979990+999999999+241219:1420+00001++EK05Q125KE0'
UNH+00001+KOTR:02:001:KV'
IDK+100167999+99+DAK+78602'
VDT+19951001'
@@ -1121,7 +1121,7 @@ VKG+03+104940005+5++07++16++A0'
VKG+09+660510336+5++28++99++10'
VKG+09+660510336+5++28++99++20'
VKG+09+104940185+5++28++01++30'
-VKG+09+104940174+5++28++02++30'
+VKG+09+104940185+5++28++02++30'
VKG+09+104940174+5++28++03++30'
VKG+09+104940174+5++28++04++30'
VKG+09+104940174+5++28++05++30'
@@ -1130,14 +1130,14 @@ VKG+09+104940185+5++28++07++30'
VKG+09+104940185+5++28++08++30'
VKG+09+104940185+5++28++09++30'
VKG+09+104940185+5++28++10++30'
-VKG+09+104940174+5++28++11++30'
-VKG+09+104940174+5++28++12++30'
+VKG+09+104940185+5++28++11++30'
+VKG+09+104940185+5++28++12++30'
VKG+09+104940185+5++28++13++30'
VKG+09+104940185+5++28++14++30'
VKG+09+104940185+5++28++15++30'
VKG+09+104940185+5++28++16++30'
VKG+09+108079819+5++28++01++40'
-VKG+09+104940152+5++28++02++40'
+VKG+09+108079819+5++28++02++40'
VKG+09+104940152+5++28++03++40'
VKG+09+104940152+5++28++04++40'
VKG+09+104940152+5++28++05++40'
@@ -1146,8 +1146,8 @@ VKG+09+108079819+5++28++07++40'
VKG+09+108079819+5++28++08++40'
VKG+09+108079819+5++28++09++40'
VKG+09+108079819+5++28++10++40'
-VKG+09+104940152+5++28++11++40'
-VKG+09+104940152+5++28++12++40'
+VKG+09+108079819+5++28++11++40'
+VKG+09+108079819+5++28++12++40'
VKG+09+108079819+5++28++13++40'
VKG+09+108079819+5++28++14++40'
VKG+09+108079819+5++28++15++40'
@@ -1167,7 +1167,7 @@ VKG+09+660510336+5++28++99++74'
VKG+09+660510336+5++28++99++75'
VKG+09+660510336+5++28++99++76'
VKG+09+104940185+5++28++01++A0'
-VKG+09+104940174+5++28++02++A0'
+VKG+09+104940185+5++28++02++A0'
VKG+09+104940174+5++28++03++A0'
VKG+09+104940174+5++28++04++A0'
VKG+09+104940174+5++28++05++A0'
@@ -1176,8 +1176,8 @@ VKG+09+104940185+5++28++07++A0'
VKG+09+104940185+5++28++08++A0'
VKG+09+104940185+5++28++09++A0'
VKG+09+104940185+5++28++10++A0'
-VKG+09+104940174+5++28++11++A0'
-VKG+09+104940174+5++28++12++A0'
+VKG+09+104940185+5++28++11++A0'
+VKG+09+104940185+5++28++12++A0'
VKG+09+104940185+5++28++13++A0'
VKG+09+104940185+5++28++14++A0'
VKG+09+104940185+5++28++15++A0'
diff --git a/Dakota/KTDatei/IK05Q424.ke0.txt b/Dakota/KTDatei/IK05Q125.ke1.txt
similarity index 99%
rename from Dakota/KTDatei/IK05Q424.ke0.txt
rename to Dakota/KTDatei/IK05Q125.ke1.txt
index c7106877a..711df4500 100644
--- a/Dakota/KTDatei/IK05Q424.ke0.txt
+++ b/Dakota/KTDatei/IK05Q125.ke1.txt
@@ -1,5 +1,5 @@
UNA:+,? '
-UNB+UNOC:3+109900019+999999999+240925:1200+00030++IK05Q424KE0'
+UNB+UNOC:3+109900019+999999999+241219:1500+00032++IK05Q125KE1'
UNH+00001+KOTR:02:001:KV'
IDK+100202527+99+IKK Nord (vorm. IKK MV)+78301'
VDT+19950801'
@@ -1579,8 +1579,8 @@ IDK+107436557+99+AZE Emmendingen'
VDT+20000401'
FKT+01'
NAM+01+Abrechenzentrum Emmendingen'
-ANS+1+79312+Emmendingen+An der B3 Haus Nr. 6'
-ANS+2+79301+Emmendingen+1167'
+ANS+1+79312+Emmendingen+Bundesstraße 6'
+ANS+2+79312+Emmendingen+An der B3 Haus Nr. 6'
UEM+1+00+I8'
DFU+01+070+++++inbox@tp5.arz-emmendingen.de'
DFU+02+016+++++ftam.arz-emmendingen.de?:9000'
@@ -2300,4 +2300,4 @@ NAM+01+IKK Classic+c/o DAVASO GmbH'
ANS+1+04316+Leipzig+Sommerfelder Str. 120'
ANS+2+04304+Leipzig+500761'
UNT+000008+00227'
-UNZ+000227+00030'
+UNZ+000227+00032'
diff --git a/DakotaSender/Program.cs b/DakotaSender/Program.cs
index c604b474d..ed486c9f4 100644
--- a/DakotaSender/Program.cs
+++ b/DakotaSender/Program.cs
@@ -18,9 +18,6 @@ namespace DakotaSender
{
class Program
{
- static readonly string TEST_TENANT = "5000000000";
- static readonly string TEST_TENANT_2 = "7375324044";
-
static bool time_in_line = false;
static bool is_dakota_running = false;
@@ -130,7 +127,6 @@ namespace DakotaSender
if (accept)
{
PrintLine("Ok.");
- //PrintLine(message);
}
else
{
diff --git a/DakotaUnitTest/DakotaUnitTest.csproj b/DakotaUnitTest/DakotaUnitTest.csproj
index ce493a03e..7b8cf05e7 100644
--- a/DakotaUnitTest/DakotaUnitTest.csproj
+++ b/DakotaUnitTest/DakotaUnitTest.csproj
@@ -46,11 +46,13 @@
..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
diff --git a/DakotaUnitTest/GkvSumServer.cs b/DakotaUnitTest/GkvSumServer.cs
new file mode 100644
index 000000000..ce3346788
--- /dev/null
+++ b/DakotaUnitTest/GkvSumServer.cs
@@ -0,0 +1,42 @@
+using BS.Shared.AppSender;
+using BS.Shared.DataContracts.GkvAbrechnung;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DakotaUnitTest
+{
+ [TestClass]
+ public class GkvSumServer
+ {
+ [TestInitialize]
+ public void Initialize()
+ {
+
+ }
+
+ [TestMethod]
+ public void Test()
+ {
+
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ var req = new GkvClientSumRequestJson();
+ req.GkvSecretKey = "DfDGNGn72PKfSYxSUsmRdzuBtpR9novewlmYU3gsjiFgSkaZZeylUXlbO42cWNqiKgLdMUFtWUNZT962F1raQDR7HGUzCNYsFeC";
+ req.Tenant = "9005111114";
+ req.Start = new DateTime(2025, 1, 30);
+ req.End = new DateTime(2025, 1, 30, 10, 0, 0);
+
+ var res = AppRequestSender.Send(req, "https://app5.bewoplaner.de/service/GkvAbrechnungClient.aspx");
+
+ var test = res.Sum;
+
+ Assert.IsTrue(res.Success);
+ }
+ }
+}
diff --git a/Data/ASPHibernateSessionManager.cs b/Data/ASPHibernateSessionManager.cs
index 187551ded..bb8ab492b 100644
--- a/Data/ASPHibernateSessionManager.cs
+++ b/Data/ASPHibernateSessionManager.cs
@@ -19,108 +19,108 @@ using NHibernate.Cfg;
namespace BeWo.Data
{
- public class ASPHibernateSessionManager : IHttpModule
- {
- public void Dispose()
- {
- }
+ public class ASPHibernateSessionManager : IHttpModule
+ {
+ public void Dispose()
+ {
+ }
- public void Init(HttpApplication context)
- {
- context.AcquireRequestState += (s, e) =>
- {
- Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
+ public void Init(HttpApplication context)
+ {
+ context.AcquireRequestState += (s, e) =>
+ {
+ Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
- if(ShouldConfigureHibernateSession(context))
- {
- // TEST FOR DEVEXPRESS. PROBLEMS WITH THIS MODULE WHEN USING AJAX!
- if(HttpContext.Current.Session == null)
- {
- return;
- }
+ if (ShouldConfigureHibernateSession(context))
+ {
+ // TEST FOR DEVEXPRESS. PROBLEMS WITH THIS MODULE WHEN USING AJAX!
+ if (HttpContext.Current.Session == null)
+ {
+ return;
+ }
- // ---------------------------------------------------------------
- if(!ConfigureHibernateSession(context))
- {
- return;
- }
+ // ---------------------------------------------------------------
+ if (!ConfigureHibernateSession(context))
+ {
+ return;
+ }
- // throw new Exception("Could not configure database. No tenant parameter found");
- var userLoaded = TryAuthenticateWithRequestParams(context);
+ // throw new Exception("Could not configure database. No tenant parameter found");
+ var userLoaded = TryAuthenticateWithRequestParams(context);
- if(!userLoaded)
- {
- userLoaded = TryAuthenticateWithLoginForm(context);
- }
-
- if(!userLoaded)
- {
- userLoaded = TryAuthenticateWithGkv(context);
- }
+ if (!userLoaded)
+ {
+ userLoaded = TryAuthenticateWithLoginForm(context);
+ }
- if(!userLoaded && !(SessionFacade.LoggedInUser?.Oid is null))
- {
- SessionFacade.LoggedInUser = DAOFactory.GenericDAO.LoadByID(SessionFacade.LoggedInUser.Oid.Value);
- }
- }
- };
+ if (!userLoaded)
+ {
+ userLoaded = TryAuthenticateWithGkv(context);
+ }
- context.EndRequest += (s, e) =>
- {
- if(HttpContext.Current.Items["hibernateSession"] != null)
- {
- ((ISession) HttpContext.Current.Items["hibernateSession"]).Close();
- }
- };
- }
+ if (!userLoaded && !(SessionFacade.LoggedInUser?.Oid is null))
+ {
+ SessionFacade.LoggedInUser = DAOFactory.GenericDAO.LoadByID(SessionFacade.LoggedInUser.Oid.Value);
+ }
+ }
+ };
- private static bool ShouldConfigureHibernateSession(HttpApplication context)
- {
- if (string.IsNullOrEmpty(context.Request.FilePath))
- return false;
+ context.EndRequest += (s, e) =>
+ {
+ if (HttpContext.Current.Items["hibernateSession"] != null)
+ {
+ ((ISession)HttpContext.Current.Items["hibernateSession"]).Close();
+ }
+ };
+ }
- if (context.Request.FilePath.IndexOf("GkvAbrechnungServer.aspx") >= 0)
- return false;
+ private static bool ShouldConfigureHibernateSession(HttpApplication context)
+ {
+ if (string.IsNullOrEmpty(context.Request.FilePath))
+ return false;
- if (context.Request.FilePath.IndexOf("Admin.aspx") >= 0)
- return false;
+ if (context.Request.FilePath.IndexOf("GkvAbrechnungServer.aspx") >= 0)
+ return false;
- return true;
- }
+ if (context.Request.FilePath.IndexOf("Admin.aspx") >= 0)
+ return false;
- private static bool ConfigureHibernateSession(HttpApplication context)
- {
- var lTenant = GetTenant(context);
-
- if(!string.IsNullOrEmpty(lTenant))
- {
- SessionFacade.Tenant = lTenant;
- }
- else
- {
- lTenant = SessionFacade.Tenant;
- }
+ return true;
+ }
- if(string.IsNullOrEmpty(lTenant))
- {
- return false;
- }
-
- var sessionFactory = new Configuration().Configure(context.Server.MapPath(@"Multitenancy\" + lTenant + ".config")).BuildSessionFactory();
-
- XmlConfigurator.Configure();
- if(HttpContext.Current.Items.Contains("hibernateSession"))
- {
- HttpContext.Current.Items.Remove("hibernateSession");
- }
+ private static bool ConfigureHibernateSession(HttpApplication context)
+ {
+ var lTenant = GetTenant(context);
- HttpContext.Current.Items.Add("hibernateSession", sessionFactory.OpenSession());
+ if (!string.IsNullOrEmpty(lTenant))
+ {
+ SessionFacade.Tenant = lTenant;
+ }
+ else
+ {
+ lTenant = SessionFacade.Tenant;
+ }
- return true;
- }
+ if (string.IsNullOrEmpty(lTenant))
+ {
+ return false;
+ }
+
+ var sessionFactory = new Configuration().Configure(context.Server.MapPath(@"Multitenancy\" + lTenant + ".config")).BuildSessionFactory();
+
+ XmlConfigurator.Configure();
+ if (HttpContext.Current.Items.Contains("hibernateSession"))
+ {
+ HttpContext.Current.Items.Remove("hibernateSession");
+ }
+
+ HttpContext.Current.Items.Add("hibernateSession", sessionFactory.OpenSession());
+
+ return true;
+ }
private static String GetTenant(HttpApplication context)
- {
+ {
var lTenant = String.Empty;
String token = context.Request.Params["token"];
@@ -140,201 +140,198 @@ namespace BeWo.Data
lTenant = context.Request.Params["k"];
return lTenant;
- }
+ }
- private static bool TryAuthenticateWithRequestParams(HttpApplication context)
- {
- string lUserName = null;
- string lPassword = null;
+ private static bool TryAuthenticateWithRequestParams(HttpApplication context)
+ {
+ string lUserName = null;
+ string lPassword = null;
- //if (!context.Request.Params.AllKeys.Contains("tenant"))
- // return false;
- var lTenant = GetTenant(context);
+ //if (!context.Request.Params.AllKeys.Contains("tenant"))
+ // return false;
+ var lTenant = GetTenant(context);
- if (!string.IsNullOrEmpty(lTenant))
- {
- if (context.Request.Params.AllKeys.Contains("token"))
- {
- lUserName = GetLoginInfoFromToken(context.Request.Params["token"])["user"];
- lPassword = GetLoginInfoFromToken(context.Request.Params["token"])["password"];
- }
- }
- else
- {
- lUserName = context.Request.Params["username"];
- lPassword = context.Request.Params["token"];
- }
-
- if (!BS.Shared.Core.Utils.IsAnyNullOrEmpty(lUserName, lPassword))
- {
- var ip = context.Request.UserHostAddress;
-
- var lUser = DAOFactory.UserDAO.FindUserByLoginName(lUserName, ip);
-
- if (lUser != null && lUser.CheckRC2Password(lPassword))
- {
- SessionFacade.LoggedInUser = lUser;
- return true;
- }
- }
-
- return false;
- }
-
- private static bool TryAuthenticateWithLoginForm(HttpApplication context)
- {
- var name = context.Request.Params["ctl00$tb_login"];
- var password = context.Request.Params["ctl00$tb_password"];
-
- if (!BS.Shared.Core.Utils.IsAnyNullOrEmpty(name, password))
- {
- ApplicationUser user = DAOFactory.UserDAO.FindUserByLoginName(name);
-
- if (user != null && DAOFactory.UserDAO.CheckPassword(user, password))
- {
- SessionFacade.LoggedInUser = user;
- return true;
- }
- }
-
- return false;
- }
-
- private static bool TryAuthenticateWithGkv(HttpApplication context)
- {
- if (context.Request.FilePath.IndexOf("GkvAbrechnungClient.aspx") == -1)
- return false;
-
- // Eigene IP
- var clientip = GetIP(true);
-
- // App 8 IP
- var appsettingip = System.Configuration.ConfigurationManager.AppSettings["App8IpAddress"];
-
- // Summen Server
- var appsettingip2 = System.Configuration.ConfigurationManager.AppSettings["ServerSumIpAddress"];
-
- if (appsettingip != clientip && appsettingip2 != clientip)
- return false;
-
- if(appsettingip == clientip)
+ if (!string.IsNullOrEmpty(lTenant))
{
- var useroidstr = context.Request.Params["useroid"];
-
- if (!long.TryParse(useroidstr, out long useroid))
- return false;
-
- SessionFacade.LoggedInUser = DAOFactory.GenericDAO.LoadByID(useroid);
- }
+ if (context.Request.Params.AllKeys.Contains("token"))
+ {
+ lUserName = GetLoginInfoFromToken(context.Request.Params["token"])["user"];
+ lPassword = GetLoginInfoFromToken(context.Request.Params["token"])["password"];
+ }
+ }
else
{
- SessionFacade.LoggedInUser = DAOFactory.UserDAO.GetBSUser("BSAdmin", "xyz");
- }
-
- return true;
- }
+ lUserName = context.Request.Params["username"];
+ lPassword = context.Request.Params["token"];
+ }
- private static string GetIP(bool CheckForward = false)
- {
- // https://stackoverflow.com/a/13249280
+ if (!BS.Shared.Core.Utils.IsAnyNullOrEmpty(lUserName, lPassword))
+ {
+ var ip = context.Request.UserHostAddress;
- string ip = null;
- if (CheckForward)
- {
- ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
- }
+ var lUser = DAOFactory.UserDAO.FindUserByLoginName(lUserName, ip);
- if (string.IsNullOrEmpty(ip))
- {
- ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
- }
- else
- { // Using X-Forwarded-For last address
- ip = ip.Split(',')
- .Last()
- .Trim();
- }
+ if (lUser != null && lUser.CheckRC2Password(lPassword))
+ {
+ SessionFacade.LoggedInUser = lUser;
+ return true;
+ }
+ }
- return ip;
- }
+ return false;
+ }
- private static Dictionary GetLoginInfoFromToken(string token)
- {
- if(string.IsNullOrWhiteSpace(token))
- {
- return new Dictionary();
- }
+ private static bool TryAuthenticateWithLoginForm(HttpApplication context)
+ {
+ var name = context.Request.Params["ctl00$tb_login"];
+ var password = context.Request.Params["ctl00$tb_password"];
- string decodedToken;
+ if (!BS.Shared.Core.Utils.IsAnyNullOrEmpty(name, password))
+ {
+ ApplicationUser user = DAOFactory.UserDAO.FindUserByLoginName(name);
- token = token.Replace(' ', '+');
- token = token.Trim(',');
+ if (user != null && DAOFactory.UserDAO.CheckPassword(user, password))
+ {
+ SessionFacade.LoggedInUser = user;
+ return true;
+ }
+ }
- try
- {
- decodedToken = DecryptString(HttpUtility.UrlDecode(token));
- }
- catch (Exception)
- {
- decodedToken = DecryptString(token);
- }
+ return false;
+ }
- if (decodedToken.Split(';')[2].Split('=')[0].Equals("myToken"))
- {
- var b = decodedToken.Split(';');
+ private static bool TryAuthenticateWithGkv(HttpApplication context)
+ {
+ if (context.Request.FilePath.IndexOf("GkvAbrechnungClient.aspx") == -1)
+ return false;
- var a = DecryptString(new Regex(@"[\=]{1}").Split(b[2], 2)[1]);
- decodedToken += ";" + a;
- }
+ if (!IsRequestIPValid("App8IpAddress"))
+ return false;
- var Params = decodedToken.Split(';');
+ var useroidstr = context.Request.Params["useroid"];
- return Params.Select(item => item.Split('=')).Where(a => a[0].Equals("tenant") || a[0].Equals("password") || a[0].Equals("user")).ToDictionary(a => a[0], a => a[1]);
- }
+ if (!long.TryParse(useroidstr, out long useroid))
+ return false;
- private static string DecryptString(string strToDecrypt)
- {
- if(string.IsNullOrWhiteSpace(strToDecrypt))
- {
- return "Beim Decodieren ist leider ein Fehler aufgetreten.";
- }
+ SessionFacade.LoggedInUser = DAOFactory.GenericDAO.LoadByID(useroid);
- strToDecrypt = strToDecrypt.Replace(' ', '+');
+ return true;
+ }
- if(strToDecrypt.Contains(","))
- {
- strToDecrypt = strToDecrypt.Split(',')[0];
- }
+ public static bool IsRequestIPValid(string appsetting)
+ {
+ var clientip = GetRequestIP(true);
+ var appsettingip = System.Configuration.ConfigurationManager.AppSettings[appsetting];
- byte[] _Rc2IV = { 35, 138, 177, 253, 227, 63, 2, 27 };
- byte[] _Rc2Key = { 174, 130, 219, 185, 185, 221, 96, 50, 37, 212, 81, 121, 71, 206, 130, 153 };
- var lRc2CSP = new RC2CryptoServiceProvider();
- var lDecryptor = lRc2CSP.CreateDecryptor(_Rc2Key, _Rc2IV);
+#if DEBUG
+ if (clientip == "::1")
+ return true;
+#endif
- strToDecrypt = strToDecrypt.Replace(' ', '+');
- strToDecrypt = strToDecrypt.Trim(',');
+ return clientip == appsettingip;
+ }
- using (var msDecrypt = new MemoryStream(Convert.FromBase64String(strToDecrypt)))
- {
- using (var csDecrypt = new CryptoStream(msDecrypt, lDecryptor, CryptoStreamMode.Read))
- {
- var bytes = new List();
- int b;
+ private static string GetRequestIP(bool CheckForward = false)
+ {
+ // https://stackoverflow.com/a/13249280
- do
- {
- b = csDecrypt.ReadByte();
+ string ip = null;
+ if (CheckForward)
+ {
+ ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
+ }
- if(b != -1)
- {
- bytes.Add(Convert.ToByte(b));
- }
+ if (string.IsNullOrEmpty(ip))
+ {
+ ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
+ }
+ else
+ { // Using X-Forwarded-For last address
+ ip = ip.Split(',')
+ .Last()
+ .Trim();
+ }
- } while (b != -1);
+ return ip;
+ }
- return Encoding.UTF8.GetString(bytes.ToArray());
- }
- }
- }
- }
+ private static Dictionary GetLoginInfoFromToken(string token)
+ {
+ if (string.IsNullOrWhiteSpace(token))
+ {
+ return new Dictionary();
+ }
+
+ string decodedToken;
+
+ token = token.Replace(' ', '+');
+ token = token.Trim(',');
+
+ try
+ {
+ decodedToken = DecryptString(HttpUtility.UrlDecode(token));
+ }
+ catch (Exception)
+ {
+ decodedToken = DecryptString(token);
+ }
+
+ if (decodedToken.Split(';')[2].Split('=')[0].Equals("myToken"))
+ {
+ var b = decodedToken.Split(';');
+
+ var a = DecryptString(new Regex(@"[\=]{1}").Split(b[2], 2)[1]);
+ decodedToken += ";" + a;
+ }
+
+ var Params = decodedToken.Split(';');
+
+ return Params.Select(item => item.Split('=')).Where(a => a[0].Equals("tenant") || a[0].Equals("password") || a[0].Equals("user")).ToDictionary(a => a[0], a => a[1]);
+ }
+
+ private static string DecryptString(string strToDecrypt)
+ {
+ if (string.IsNullOrWhiteSpace(strToDecrypt))
+ {
+ return "Beim Decodieren ist leider ein Fehler aufgetreten.";
+ }
+
+ strToDecrypt = strToDecrypt.Replace(' ', '+');
+
+ if (strToDecrypt.Contains(","))
+ {
+ strToDecrypt = strToDecrypt.Split(',')[0];
+ }
+
+ byte[] _Rc2IV = { 35, 138, 177, 253, 227, 63, 2, 27 };
+ byte[] _Rc2Key = { 174, 130, 219, 185, 185, 221, 96, 50, 37, 212, 81, 121, 71, 206, 130, 153 };
+ var lRc2CSP = new RC2CryptoServiceProvider();
+ var lDecryptor = lRc2CSP.CreateDecryptor(_Rc2Key, _Rc2IV);
+
+ strToDecrypt = strToDecrypt.Replace(' ', '+');
+ strToDecrypt = strToDecrypt.Trim(',');
+
+ using (var msDecrypt = new MemoryStream(Convert.FromBase64String(strToDecrypt)))
+ {
+ using (var csDecrypt = new CryptoStream(msDecrypt, lDecryptor, CryptoStreamMode.Read))
+ {
+ var bytes = new List();
+ int b;
+
+ do
+ {
+ b = csDecrypt.ReadByte();
+
+ if (b != -1)
+ {
+ bytes.Add(Convert.ToByte(b));
+ }
+
+ } while (b != -1);
+
+ return Encoding.UTF8.GetString(bytes.ToArray());
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Data/Access/DAOFactory.cs b/Data/Access/DAOFactory.cs
index 08cf323e4..4bc433b91 100644
--- a/Data/Access/DAOFactory.cs
+++ b/Data/Access/DAOFactory.cs
@@ -6,6 +6,8 @@
private static GenericDAO _GenericDAO;
+ private static ScriptDAO _ScriptDAO;
+
private static SearchDAO _SearchDAO;
private static UserDAO _UserDAO;
@@ -26,7 +28,15 @@
}
}
- public static SearchDAO SearchDAO
+ public static ScriptDAO ScriptDAO
+ {
+ get
+ {
+ return _ScriptDAO ?? (_ScriptDAO = new ScriptDAO());
+ }
+ }
+
+ public static SearchDAO SearchDAO
{
get
{
diff --git a/Data/Access/ScriptDAO.cs b/Data/Access/ScriptDAO.cs
new file mode 100644
index 000000000..ce9268ace
--- /dev/null
+++ b/Data/Access/ScriptDAO.cs
@@ -0,0 +1,45 @@
+using BS.Shared;
+using DevExpress.XtraPrinting;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Data.Access
+{
+ public class ScriptDAO : AbstractBaseDAO
+ {
+ private string LoadSQLStatement(string statementName)
+ {
+ string sqlStatement = string.Empty;
+
+ string namespacePart = "BeWo.Data.Access.Scripts";
+ string resourceName = namespacePart + "." + statementName;
+
+ using (Stream stm = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
+ {
+ if (stm != null)
+ {
+ sqlStatement = new StreamReader(stm).ReadToEnd();
+ }
+ }
+
+ return sqlStatement;
+ }
+
+ public decimal? GetGkvSumByDateRange(DateTime? start, DateTime? end)
+ {
+ var sql = LoadSQLStatement("GetGkvSumByDateRange.sql");
+
+ var rtn = Session.CreateSQLQuery(sql)
+ .SetParameter(0, start ?? DateTime.MinValue)
+ .SetParameter(1, end ?? DateTime.MaxValue)
+ .UniqueResult();
+
+ return rtn;
+ }
+ }
+}
diff --git a/Data/Access/Scripts/GetGkvSumByDateRange.sql b/Data/Access/Scripts/GetGkvSumByDateRange.sql
new file mode 100644
index 000000000..c83b860e4
--- /dev/null
+++ b/Data/Access/Scripts/GetGkvSumByDateRange.sql
@@ -0,0 +1,12 @@
+SELECT SUM(a1.Betrag)
+FROM gkvtransferprotokoll AS t1
+JOIN gkvabrechnung a1
+ON a1.Oid = t1.GkvAbrechnungOid
+WHERE DATE(t1.ErstelltAm) >= ?
+AND DATE(t1.ErstelltAm) <= ?
+AND t1.Oid = (
+SELECT MIN(Oid)
+FROM gkvtransferprotokoll AS t2
+WHERE t1.GkvAbrechnungOid = t2.GkvAbrechnungOid
+GROUP BY t2.GkvAbrechnungOid
+)
\ No newline at end of file
diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs
index 54bf806a8..648b27db7 100644
--- a/Data/Access/SearchDAO.cs
+++ b/Data/Access/SearchDAO.cs
@@ -27,6 +27,8 @@ using static System.String;
using Appointment = BeWo.Data.Entities.Appointment;
using Login = BeWo.Data.Entities.Login;
using Resource = BeWo.Data.Entities.Resource;
+using System.Reflection;
+using System.IO;
namespace BeWo.Data.Access
{
@@ -6207,5 +6209,28 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{
var q = Session.CreateSQLQuery(sql);
return q.List().First();
}
+
+ public string GetGkvRawData(long oid, GkvRawDataType gkvRawData)
+ {
+ var criteria = CreateCriteria()
+ .Add(Restrictions.Where(x => x.Oid == oid));
+
+ if(gkvRawData == GkvRawDataType.Auftragsdatei)
+ {
+ criteria = criteria.SetProjection(Projections.Property(nameof(GkvTransferProtokoll.Auftragsdatei)));
+ }
+ else if(gkvRawData == GkvRawDataType.Nutzdatendatei)
+ {
+ criteria = criteria.SetProjection(Projections.Property(nameof(GkvTransferProtokoll.Nutzdatendatei)));
+ }
+ else
+ {
+ throw new ArgumentOutOfRangeException(nameof(gkvRawData), $"GkvRawDataType \'{gkvRawData}\' unbekannt.");
+ }
+
+ var t = criteria.List().SingleOrDefault();
+
+ return t;
+ }
}
}
diff --git a/Data/Data.csproj b/Data/Data.csproj
index 5465251e0..76f94eb31 100644
--- a/Data/Data.csproj
+++ b/Data/Data.csproj
@@ -46,6 +46,8 @@
4
AllRules.ruleset
false
+
+
pdbonly
@@ -202,6 +204,7 @@
+
@@ -699,6 +702,7 @@
+
PreserveNewest
diff --git a/Host/AdminService.svc b/Host/AdminService.svc
new file mode 100644
index 000000000..0700e1ca4
--- /dev/null
+++ b/Host/AdminService.svc
@@ -0,0 +1 @@
+<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.AdminServiceImp" %>
diff --git a/Host/GkvAbrechnungClient.aspx.cs b/Host/GkvAbrechnungClient.aspx.cs
index 2e97628ae..411018111 100644
--- a/Host/GkvAbrechnungClient.aspx.cs
+++ b/Host/GkvAbrechnungClient.aspx.cs
@@ -1,4 +1,5 @@
-using BeWo.Data.Access;
+using BeWo.Data;
+using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
@@ -7,6 +8,7 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.Exceptions;
using Newtonsoft.Json;
+using NHibernate.Dialect.Function;
using System;
using System.Collections.Generic;
using System.Configuration;
@@ -19,6 +21,13 @@ using System.Web.UI.WebControls;
namespace Host
{
+ ///
+ ///
+ /// Stellt einen Entpunkt für Clients dar.
+ /// z.B. app2,app3,app4,...
+ ///
+ ///
+ ///
public partial class GkvAbrechnungClient : Page
{
private readonly string INVALID_INPUT = "Bad Request";
@@ -74,15 +83,18 @@ namespace Host
private void ClientResult(GkvClientResultRequestDC req)
{
+ if (!SessionFacade.IsUserLoggedIn())
+ SendErrorResponse(INVALID_INPUT + " 4");
+
if (req.ResultDCs is null || !req.ResultDCs.Any())
- SendInvalidInputResponse();
+ SendErrorResponse(INVALID_INPUT + " 5");
// Response
var response = new GkvResponseDC(false);
try
{
- var service = new AccountingServiceImp();
+ var service = new GkvAccountingServiceImp();
service.HandleGkvServerResults(req.ResultDCs);
@@ -102,30 +114,29 @@ namespace Host
private void ClientSum(GkvClientSumRequestJson req)
{
- if (req.Tenant is null)
- SendInvalidInputResponse();
-
if (req.Start > req.End)
- SendInvalidInputResponse();
+ SendErrorResponse(INVALID_INPUT + " 4");
+
+ if (!ASPHibernateSessionManager.IsRequestIPValid("GkvSumServerIPAdress"))
+ SendErrorResponse(INVALID_INPUT + " 5");
// Response
var response = new GkvClientSumResponseJson();
try
{
- var service = new AccountingServiceImp();
+ var sum = DAOFactory.ScriptDAO.GetGkvSumByDateRange(req.Start, req.End);
- var invoices = service.GetCompactGkvAbrechnungByTransferDateRange(req.Start, req.End);
-
- if(invoices is object && invoices.Count > 0)
+ if(sum is decimal s)
{
- response.CompactGkvAbrechnungen = invoices.ToArray();
- response.Success = true;
+ response.Sum = s;
}
else
{
- response.Message = "no records";
+ response.Message = "sum is null";
}
+
+ response.Success = true;
}
catch (GkvException e)
{
diff --git a/Host/GkvAbrechnungServer.aspx.cs b/Host/GkvAbrechnungServer.aspx.cs
index c6413a3d1..90dfab7db 100644
--- a/Host/GkvAbrechnungServer.aspx.cs
+++ b/Host/GkvAbrechnungServer.aspx.cs
@@ -18,6 +18,13 @@ using Page = System.Web.UI.Page;
namespace Host
{
+ ///
+ ///
+ /// Stellt einen Entpunkt für Server dar.
+ /// Hier: app8
+ ///
+ ///
+ ///
public partial class GkvAbrechnungServer : Page
{
public const int PROCESS_WAITFOREXIT_MS = 10 * 1000;
diff --git a/Host/GkvAccountingService.svc b/Host/GkvAccountingService.svc
new file mode 100644
index 000000000..36e689755
--- /dev/null
+++ b/Host/GkvAccountingService.svc
@@ -0,0 +1 @@
+<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.GkvAccountingServiceImp" %>
\ No newline at end of file
diff --git a/Host/Host.csproj b/Host/Host.csproj
index 5e278ece5..f4e0e7fa0 100644
--- a/Host/Host.csproj
+++ b/Host/Host.csproj
@@ -168,6 +168,8 @@
+
+
diff --git a/Host/Web.config b/Host/Web.config
index 189683d98..3b4b9d78c 100644
--- a/Host/Web.config
+++ b/Host/Web.config
@@ -113,25 +113,16 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -169,6 +160,9 @@
+
+
+
@@ -181,7 +175,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -189,11 +210,19 @@
-
+
+
+
+
+
+
+
+
+
@@ -209,11 +238,20 @@
+
+
+
+
+
+
+
+
+
@@ -245,7 +283,7 @@
-
+
diff --git a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
index 2a59d4991..e2aa84528 100644
--- a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
+++ b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
@@ -13,7 +13,29 @@ namespace BeWo.Service.DCEntityMapper
{
public class GkvAbrechnungDC_GkvAbrechnung : AbstractIDCEntityMapper
{
- public override GkvAbrechnungDC MergeWithDC(GkvAbrechnung pEntity, GkvAbrechnungDC pDataContract)
+ public void ClearRawData(List gkvAbrechnungen)
+ {
+ if ((!gkvAbrechnungen?.Any()) ?? true)
+ return;
+
+ foreach (var gkvAbrechnung in gkvAbrechnungen)
+ {
+ ClearRawData(gkvAbrechnung);
+ }
+ }
+
+ public void ClearRawData(GkvAbrechnungDC gkvAbrechnung)
+ {
+ if ((!gkvAbrechnung.TransferProtokolle?.Any()) ?? true)
+ return;
+
+ foreach (var protokoll in gkvAbrechnung.TransferProtokolle)
+ {
+ MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.ClearRawData(protokoll);
+ }
+ }
+
+ public override GkvAbrechnungDC MergeWithDC(GkvAbrechnung pEntity, GkvAbrechnungDC pDataContract)
{
if(pEntity.InvoiceBases == null || !pEntity.InvoiceBases.Any())
{
diff --git a/Service/DCEntityMapper/GkvTransferProtokollDC_GkvTransferprotokoll.cs b/Service/DCEntityMapper/GkvTransferProtokollDC_GkvTransferprotokoll.cs
index 4043f667f..d004f9a7f 100644
--- a/Service/DCEntityMapper/GkvTransferProtokollDC_GkvTransferprotokoll.cs
+++ b/Service/DCEntityMapper/GkvTransferProtokollDC_GkvTransferprotokoll.cs
@@ -4,6 +4,7 @@ using BeWo.Data.Entities;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
using NHibernate.Linq;
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,7 +12,13 @@ namespace BeWo.Service.DCEntityMapper
{
public class GkvTransferProtokollDC_GkvTransferprotokoll : AbstractIDCEntityMapper
{
- public override GkvTransferProtokollDC MergeWithDC(GkvTransferProtokoll pEntity, GkvTransferProtokollDC pDataContract)
+ public void ClearRawData(GkvTransferProtokollDC gkvTransfer)
+ {
+ gkvTransfer.Auftragsdatei = null;
+ gkvTransfer.Nutzdatendatei = null;
+ }
+
+ public override GkvTransferProtokollDC MergeWithDC(GkvTransferProtokoll pEntity, GkvTransferProtokollDC pDataContract)
{
pDataContract.IKDatenannahmestelle = pEntity.IKDatenannahmestelle;
pDataContract.IKKrankenkasse = pEntity.IKKrankenkasse;
@@ -49,7 +56,7 @@ namespace BeWo.Service.DCEntityMapper
return pDataContract;
}
- public override GkvTransferProtokoll MergeWithEntity(GkvTransferProtokollDC pDataContract, GkvTransferProtokoll pEntity)
+ public override GkvTransferProtokoll MergeWithEntity(GkvTransferProtokollDC pDataContract, GkvTransferProtokoll pEntity)
{
this.ConcurrencyCheck(pDataContract.GkvTransferProtokollVersion, pEntity);
diff --git a/Service/Security/Method2Rights.cs b/Service/Security/Method2Rights.cs
deleted file mode 100644
index fe76dda1d..000000000
--- a/Service/Security/Method2Rights.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Security.Cryptography;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Windows;
-using BeWo.Data;
-using BeWo.Data.Access;
-using BeWo.Data.Entities;
-using BS.Shared;
-using BS.Shared.DataContracts;
-
-namespace BeWo.Service.Security
-{
- public class Method2Rights
- {
-
- public static Dictionary> GetAuthorizedMethodDictionary()
- {
- var dict = new Dictionary>();
-
- dict.Add("DeleteUserGroups", new UserRightType[] { UserRightType.UserGroupView_Delete });
- dict.Add("DeactivateUserGroup", new UserRightType[] { UserRightType.UserGroupView_Delete });
- dict.Add("UpdateUserGroup", new UserRightType[] { UserRightType.UserGroupView_Edit, UserRightType.EditAll });
- dict.Add("InsertNewUserGroup", new UserRightType[] { UserRightType.UserGroupView_Create });
-
- dict.Add("InsertNewUser", new UserRightType[] { UserRightType.UserView_Create });
- dict.Add("DeactivateUser", new UserRightType[] { UserRightType.UserView_Delete });
- dict.Add("DeactivateUsers", new UserRightType[] { UserRightType.UserView_Delete });
- dict.Add("DeleteUsers", new UserRightType[] { UserRightType.UserView_Delete });
- dict.Add("DeleteUser", new UserRightType[] { UserRightType.UserView_Delete });
- dict.Add("UpdateUser", new UserRightType[] { UserRightType.UserView_Edit });
-
-
-
- return dict;
- }
-
- }
-}
-
diff --git a/Service/Security/SecurityContextInitializer.cs b/Service/Security/SecurityContextInitializer.cs
index eaac00332..d81c3604b 100644
--- a/Service/Security/SecurityContextInitializer.cs
+++ b/Service/Security/SecurityContextInitializer.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Net;
+using System.Reflection;
using System.Security;
using System.ServiceModel;
using System.ServiceModel.Channels;
@@ -11,147 +12,157 @@ using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
-
+using BeWo.Service.ServiceContracts;
+using BeWo.Service.ServiceUtils;
+using BS.Shared.Attributes;
using BS.Shared.Extensions;
+using NHibernate.Hql.Ast.ANTLR.Tree;
namespace BeWo.Service.Security
{
- public class SecurityContextInitializer : ICallContextInitializer
- {
- public void AfterInvoke(object pCorrelationState)
- {
- if (pCorrelationState is LoggedInUserOperationContextExt)
- {
- OperationContext.Current.Extensions.Remove((LoggedInUserOperationContextExt)pCorrelationState);
- }
- }
+ public class SecurityContextInitializer : ICallContextInitializer
+ {
+ private readonly string[] ALLOW_ALWAYS = new string[]
+ {
+ //"Download",
+ //"Download2",
+ //"DownloadInfo",
+ //"GetUpdatePlan",
+ //"GetUpdateFile",
+ "ResetAllTenants",
+ "IsUserValid",
+ "IsUserValidTwoFactor",
+ "ResetTenant",
+ "GetEmailForUserName",
+ "GetTranslationDictionary",
+ };
- public object BeforeInvoke(InstanceContext pInstanceContext, IClientChannel pChannel, Message pMessage)
- {
- try
- {
- ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+ private readonly string[] ALLOW_ONLY_WITH_LOGIN = new string[] {
+ "LoadUserByNameAndPassword",
+ "LoadUserByLoginName",
+ "GetMandator",
+ "LoadEmployee",
+ "GetPersonsHavingBirthday",
+ "GetLastLogins",
+ "GetSupportConceptsWithConferenceDate",
+ "GetExpiringSupportConcepts",
+ "GetPublishedNewsItemsForEmployee",
+ "GetAllActiveEmployeesCompact",
+ "GetHomeViewPanels",
+ "LoadCompactEmployee",
+ "GetTranslationDictionary",
+ "ConvertToNewSubstitutionType" };
- var lTemp = pMessage.Headers.Action.Split("/");
- string lMethodName = lTemp[lTemp.Count - 1];
- string lServiceInterface = lTemp[lTemp.Count - 2];
+ public void AfterInvoke(object pCorrelationState)
+ {
+ if (pCorrelationState is LoggedInUserOperationContextExt)
+ {
+ OperationContext.Current.Extensions.Remove((LoggedInUserOperationContextExt)pCorrelationState);
+ }
+ }
- // TODO Hier kann man jetzt etwas bauen wer sich für welchen service autorisieren muss...
- var skip = new string[] { "Download", "Download2", "DownloadInfo", "GetUpdatePlan", "GetUpdateFile", "ResetAllTenants" };
- if (lMethodName == "IsUserValid" || lMethodName == "IsUserValidTwoFactor" || lMethodName == "ResetTenant" || lMethodName == "ResetAllTenant" || lMethodName == "GetEmailForUserName" || lMethodName == "GetTranslationDictionary")
- {
- return null;
- }
- else if (skip.Contains(lMethodName))
- {
- return null;
- }
- else
- {
- // Vergessen neue Methode einzutragen?
- }
+ public object BeforeInvoke(InstanceContext pInstanceContext, IClientChannel pChannel, Message pMessage)
+ {
+ try
+ {
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- string lUserName = null, lPassword = null;
+ var lTemp = pMessage.Headers.Action.Split("/");
+ string lMethodName = lTemp[lTemp.Count - 1];
+ string lServiceInterface = lTemp[lTemp.Count - 2];
- int lSecurityHeaderIndex = pMessage.Headers.FindHeader("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+ // TODO Hier kann man jetzt etwas bauen wer sich für welchen service autorisieren muss...
+ if (ALLOW_ALWAYS.Contains(lMethodName))
+ {
+ return null;
+ }
+ else
+ {
+ // Vergessen neue Methode einzutragen?
+ }
- if (lSecurityHeaderIndex > -1)
- {
- XmlReader lReader = pMessage.Headers.GetReaderAtHeader(lSecurityHeaderIndex);
+ string lUserName = null, lPassword = null;
- if (lReader.ReadToFollowing("Username"))
- {
- lUserName = lReader.ReadString();
- }
+ int lSecurityHeaderIndex = pMessage.Headers.FindHeader("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
- if (lReader.ReadToFollowing("Password"))
- {
- lPassword = lReader.ReadString();
- }
+ if (lSecurityHeaderIndex > -1)
+ {
+ XmlReader lReader = pMessage.Headers.GetReaderAtHeader(lSecurityHeaderIndex);
- ApplicationUser lUser = DAOFactory.UserDAO.FindUserByLoginName(lUserName);
+ if (lReader.ReadToFollowing("Username"))
+ {
+ lUserName = lReader.ReadString();
+ }
- if (lUser != null && DAOFactory.UserDAO.CheckPassword(lUser, lPassword))
- {
- if (!HasMethodAuthorization(lUser, lMethodName))
- {
- throw new SecurityException("Methode nicht autorisiert: " + lMethodName);
- }
-
+ if (lReader.ReadToFollowing("Password"))
+ {
+ lPassword = lReader.ReadString();
+ }
- var lExt = new LoggedInUserOperationContextExt { User = lUser, LoginName = lUserName, UnhashedPassword = lPassword };
- OperationContext.Current.Extensions.Add(lExt);
- return lExt;
- }
- }
+ ApplicationUser lUser = DAOFactory.UserDAO.FindUserByLoginName(lUserName);
- throw new SecurityException("Nicht autorisiert");
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
+ if (lUser != null && DAOFactory.UserDAO.CheckPassword(lUser, lPassword))
+ {
+ if (!HasMethodAuthorization(lUser, lMethodName, pMessage))
+ {
+ throw new SecurityException("Methode nicht autorisiert: " + lMethodName);
+ }
- private bool HasMethodAuthorization(ApplicationUser lUser, string methodName)
- {
- var alwaysAllowed = new string[]
- {
- "LoadUserByNameAndPassword", "LoadUserByLoginName", "GetMandator", "LoadEmployee",
- "GetPersonsHavingBirthday",
- "GetLastLogins",
- "GetSupportConceptsWithConferenceDate",
- "GetExpiringSupportConcepts",
- "GetPublishedNewsItemsForEmployee",
- "GetAllActiveEmployeesCompact",
- "GetHomeViewPanels",
- "LoadCompactEmployee",
- "GetTranslationDictionary",
- "ConvertToNewSubstitutionType"
- };
+ var lExt = new LoggedInUserOperationContextExt { User = lUser, LoginName = lUserName, UnhashedPassword = lPassword };
+ OperationContext.Current.Extensions.Add(lExt);
+ return lExt;
+ }
+ }
- if (alwaysAllowed.Contains(methodName))
- {
- return true;
- }
+ throw new SecurityException("Nicht autorisiert");
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
- var rights = Utils.GetGrantedRights(lUser);
- var dict = Method2Rights.GetAuthorizedMethodDictionary();
+ private bool HasMethodAuthorization(ApplicationUser pUser, string methodName, Message pMessage)
+ {
+ if (ALLOW_ONLY_WITH_LOGIN.Contains(methodName))
+ {
+ return true;
+ }
+ else
+ {
+ // Vergessen neue Methode einzutragen?
+ }
- if (dict.ContainsKey(methodName))
- {
- bool allowed = false;
- var minimumRechte = dict[methodName];
+ var rights = Utils.GetGrantedRights(pUser);
- foreach (var right in minimumRechte)
- {
- if (rights.Contains(right))
- {
- allowed = true;
- }
- }
+ // Finde Action
+ var lTemp = pMessage.Headers.Action?.Split("/");
- return allowed;
- }
- //var dict = Right2Methods.GetAuthorizedMethodDictionary();
+ if (lTemp is null)
+ lTemp = pMessage.Headers.To.Segments.ToList();
- //foreach (var right in rights)
- //{
+ if (lTemp is null)
+ throw new ArgumentException("Kann Action nicht finden");
- // if (dict.ContainsKey(right))
- // {
- // var names = dict[right];
- // if (names.Contains(methodName))
- // {
- // return true;
- // }
+ // Extrahiere MethodeName + ServiceInterface
+ string lMethodName = lTemp[lTemp.Count - 1].Trim('/');
+ string lServiceInterface = lTemp[lTemp.Count - 2].Trim('/');
- // return true;
- // }
- //}
+ try
+ {
+ var attribute = ServiceHelper.GetCustomAttribute(lServiceInterface, lMethodName);
+ if (attribute != null)
+ {
+ return attribute.HasPermission(rights);
+ }
+ }
+ catch (Exception e)
+ {
- return true;
- }
+ }
- }
+ return true;
+ }
+
+ }
}
diff --git a/Service/Service.csproj b/Service/Service.csproj
index 8da0c85a9..a20ad2ead 100644
--- a/Service/Service.csproj
+++ b/Service/Service.csproj
@@ -191,6 +191,7 @@
3.0
+
..\packages\System.Text.Encoding.CodePages.5.0.0\lib\net461\System.Text.Encoding.CodePages.dll
@@ -472,16 +473,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -492,7 +506,9 @@
+
+
@@ -513,6 +529,8 @@
+
+
diff --git a/Service/ServiceBehavior/AdminHibernateBehavior.cs b/Service/ServiceBehavior/AdminHibernateBehavior.cs
new file mode 100644
index 000000000..42608c307
--- /dev/null
+++ b/Service/ServiceBehavior/AdminHibernateBehavior.cs
@@ -0,0 +1,35 @@
+using BeWo.Service.UnitOfWork;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminHibernateBehavior : IEndpointBehavior
+ {
+ public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
+ {
+ }
+
+ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
+ {
+ }
+
+ public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
+ {
+ foreach (DispatchOperation iOperation in endpointDispatcher.DispatchRuntime.Operations)
+ {
+ iOperation.CallContextInitializers.Add(new AdminHibernateContextInitializer());
+ }
+ }
+
+ public void Validate(ServiceEndpoint endpoint)
+ {
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminHibernateBehaviorExtension.cs b/Service/ServiceBehavior/AdminHibernateBehaviorExtension.cs
new file mode 100644
index 000000000..cfb6fc892
--- /dev/null
+++ b/Service/ServiceBehavior/AdminHibernateBehaviorExtension.cs
@@ -0,0 +1,20 @@
+using BeWo.Service.UnitOfWork;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Configuration;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminHibernateBehaviorExtension : BehaviorExtensionElement
+ {
+ public override Type BehaviorType => typeof(AdminHibernateBehavior);
+
+ protected override object CreateBehavior()
+ {
+ return new AdminHibernateBehavior();
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminHibernateContextInitializer.cs b/Service/ServiceBehavior/AdminHibernateContextInitializer.cs
new file mode 100644
index 000000000..045f5c49c
--- /dev/null
+++ b/Service/ServiceBehavior/AdminHibernateContextInitializer.cs
@@ -0,0 +1,49 @@
+using BeWo.Data;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminHibernateContextInitializer : ICallContextInitializer
+ {
+ public void AfterInvoke(object pCorrelationState)
+ {
+ if (pCorrelationState != null)
+ {
+ WCFHibernateSessionManager.CloseSession();
+ OperationContext.Current.Extensions.Remove((SessionOperationContextExt)pCorrelationState);
+ }
+ }
+
+ public object BeforeInvoke(InstanceContext pInstanceContext, IClientChannel pChannel, Message pMessage)
+ {
+ if (MultitenancyOperationContextExt.Current?.Tenant is null)
+ return null;
+
+ try
+ {
+ //System.Threading.Monitor.Enter
+ SessionOperationContextExt lExt = new SessionOperationContextExt();
+ //int c = OperationContext.Current.Extensions.Count;
+ //if (c > 0)
+ //{
+ // int te st = 0;
+ //}
+ OperationContext.Current.Extensions.Add(lExt);
+ WCFHibernateSessionManager.OpenSession();
+ return lExt;
+ }
+ catch (Exception e)
+ {
+ throw new FaultException(e.ToString());
+ return null;
+ }
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminMultitenancyBehavior.cs b/Service/ServiceBehavior/AdminMultitenancyBehavior.cs
new file mode 100644
index 000000000..bd037b4f5
--- /dev/null
+++ b/Service/ServiceBehavior/AdminMultitenancyBehavior.cs
@@ -0,0 +1,36 @@
+using BeWo.Service.Multitenancy;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminMultitenancyBehavior : IEndpointBehavior
+ {
+ public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
+ {
+ }
+
+ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
+ {
+ throw new NotImplementedException("This is a server behavior only");
+ }
+
+ public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
+ {
+ foreach (DispatchOperation iOperation in endpointDispatcher.DispatchRuntime.Operations)
+ {
+ iOperation.CallContextInitializers.Add(new AdminMultitenancyContextInitializer());
+ }
+ }
+
+ public void Validate(ServiceEndpoint endpoint)
+ {
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminMultitenancyBehaviorExtension.cs b/Service/ServiceBehavior/AdminMultitenancyBehaviorExtension.cs
new file mode 100644
index 000000000..ac345391d
--- /dev/null
+++ b/Service/ServiceBehavior/AdminMultitenancyBehaviorExtension.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Configuration;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminMultitenancyBehaviorExtension : BehaviorExtensionElement
+ {
+ public override Type BehaviorType => typeof(AdminMultitenancyBehavior);
+
+ protected override object CreateBehavior()
+ {
+ return new AdminMultitenancyBehavior();
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminMultitenancyContextInitializer.cs b/Service/ServiceBehavior/AdminMultitenancyContextInitializer.cs
new file mode 100644
index 000000000..0b1c0cc02
--- /dev/null
+++ b/Service/ServiceBehavior/AdminMultitenancyContextInitializer.cs
@@ -0,0 +1,97 @@
+using BeWo.Data;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Channels;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web;
+using System.Xml;
+using System.ServiceModel.Dispatcher;
+using BeWo.Service.Core;
+using BS.Shared.Extensions;
+using BeWo.Service.ServiceUtils;
+using BS.Shared.Attributes;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminMultitenancyContextInitializer : ICallContextInitializer
+ {
+ public void AfterInvoke(object pCorrelationState)
+ {
+ if (pCorrelationState is MultitenancyOperationContextExt)
+ {
+ OperationContext.Current.Extensions.Remove((MultitenancyOperationContextExt)pCorrelationState);
+ }
+ }
+
+ public object BeforeInvoke(InstanceContext pInstanceContext, IClientChannel pChannel, Message pMessage)
+ {
+ string lTenant = null;
+
+ // Hole Interface
+ string lInterface = null;
+ var segments = pChannel.LocalAddress.Uri.Segments;
+ for (int i = 0; i < segments.Length; i++)
+ {
+ var seg = segments[i].Trim('/');
+
+ if (seg.EndsWith(".svc"))
+ {
+ lInterface = "I" + seg.Substring(0, seg.Length - 4);
+ }
+ }
+
+ if (string.IsNullOrWhiteSpace(lInterface))
+ {
+ throw new ArgumentException($"Zugriff verweigert. Interface unbekannt");
+ }
+
+
+ // Hole Methode
+ string lMethod = pMessage.Properties[WebHttpDispatchOperationSelector.HttpOperationNamePropertyName] as string;
+ if (string.IsNullOrWhiteSpace(lMethod))
+ {
+ throw new ArgumentException($"Zugriff verweigert. Methode unbekannt");
+ }
+
+
+ // RequireNoTenant
+ var lTemp = ServiceHelper.GetCustomAttribute(lInterface, lMethod);
+ if (lTemp is object)
+ {
+ return null;
+ }
+
+ // Hole tenant aus Query
+ // Wird erstmal nicht benötigt. Per Header besser
+ // Ungefähr auf einem Level wie Username
+ //if (pMessage.Properties?.Via is Uri uri)
+ //{
+ // var query = HttpUtility.ParseQueryString(uri.Query);
+ // var tenant = query["tenant"];
+
+ // lTenant = tenant;
+ //}
+
+ // Hole tenant aus Header
+ if (string.IsNullOrWhiteSpace(lTenant))
+ {
+ var prop = (HttpRequestMessageProperty)pMessage.Properties[HttpRequestMessageProperty.Name];
+ lTenant = prop?.Headers["tenant"];
+ }
+
+ // Wenn kein Tenant gefunden wird,
+ if (string.IsNullOrWhiteSpace(lTenant))
+ {
+ throw new ArgumentException($"Zugriff verweigert. Tenant (\'{lTenant}\') darf nicht leer sein.", nameof(lTenant));
+ }
+
+ var lExt = new MultitenancyOperationContextExt { Tenant = lTenant };
+ OperationContext.Current.Extensions.Add(lExt);
+ return lExt;
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminSecurityBehavior.cs b/Service/ServiceBehavior/AdminSecurityBehavior.cs
new file mode 100644
index 000000000..0e569871f
--- /dev/null
+++ b/Service/ServiceBehavior/AdminSecurityBehavior.cs
@@ -0,0 +1,39 @@
+using BeWo.Data;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Configuration;
+using System.Linq;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminSecurityBehavior : IEndpointBehavior
+ {
+ public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
+ {
+ // Keine zusätzlichen Bindungsparameter erforderlich
+ }
+
+ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
+ {
+ // Verhalten für Clients - hier nicht benötigt
+ }
+
+ public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
+ {
+ // Füge einen Message Inspector hinzu, um eingehende Requests zu überprüfen
+ endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new AdminServiceMessageInspector());
+ }
+
+ public void Validate(ServiceEndpoint endpoint)
+ {
+ // Optional: Endpunktvalidierung (falls erforderlich)
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/AdminSecurityBehaviorExtension.cs b/Service/ServiceBehavior/AdminSecurityBehaviorExtension.cs
new file mode 100644
index 000000000..1f3cfb260
--- /dev/null
+++ b/Service/ServiceBehavior/AdminSecurityBehaviorExtension.cs
@@ -0,0 +1,15 @@
+using System;
+using System.ServiceModel.Configuration;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminSecurityBehaviorExtension : BehaviorExtensionElement
+ {
+ public override Type BehaviorType => typeof(AdminSecurityBehavior);
+
+ protected override object CreateBehavior()
+ {
+ return new AdminSecurityBehavior();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Service/ServiceBehavior/AdminServiceMessageInspector.cs b/Service/ServiceBehavior/AdminServiceMessageInspector.cs
new file mode 100644
index 000000000..c20d32981
--- /dev/null
+++ b/Service/ServiceBehavior/AdminServiceMessageInspector.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+using BeWo.Data;
+
+namespace BeWo.Service.ServiceBehavior
+{
+ public class AdminServiceMessageInspector : IDispatchMessageInspector
+ {
+ public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
+ {
+ // Hole die erlaubte IP aus den appSettings
+ string allowedIP = ConfigurationManager.AppSettings["AdminServiceIPAddress"];
+ string allowedIP2 = ConfigurationManager.AppSettings["AdminServiceIPAddress2"];
+
+ // Extrahiere die RemoteEndpoint-IP-Adresse
+ string remoteIP = request.Properties.ContainsKey(RemoteEndpointMessageProperty.Name)
+ ? ((RemoteEndpointMessageProperty)request.Properties[RemoteEndpointMessageProperty.Name]).Address
+ : null;
+
+ var allowed = string.Equals(remoteIP, allowedIP, StringComparison.OrdinalIgnoreCase);
+ var allowed2 = string.Equals(remoteIP, allowedIP2, StringComparison.OrdinalIgnoreCase);
+
+ // Vergleiche die IPs
+ if (remoteIP == null || !(allowed || allowed2))
+ {
+ throw new UnauthorizedAccessException($"Zugriff verweigert. Remote IP ({remoteIP ?? "Unbekannt"}) ist nicht erlaubt.");
+ }
+
+ // Hole erlaubten API Key aus den appSettings
+ string allowedApikey = ConfigurationManager.AppSettings["AdminServiceAPIKey"];
+
+ // Extrahiert den API Key von Remote
+ var prop = (HttpRequestMessageProperty)request.Properties[HttpRequestMessageProperty.Name];
+ var remoteApikey = prop?.Headers["admin-service-api-key"];
+
+ // Vergleicht die API Keys
+ if(remoteApikey == null || !string.Equals(remoteApikey, allowedApikey, StringComparison.Ordinal))
+ {
+ throw new UnauthorizedAccessException($"Zugriff verweigert. API Key ({remoteApikey ?? "Unbekannt"}) ist nicht erlaubt.");
+ }
+
+ return null; // Keine Zustandsinformationen erforderlich
+ }
+
+ public void BeforeSendReply(ref Message reply, object correlationState)
+ {
+ // Keine zusätzliche Logik erforderlich vor dem Senden der Antwort
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/JsonError/JsonErrorBehavior.cs b/Service/ServiceBehavior/JsonError/JsonErrorBehavior.cs
new file mode 100644
index 000000000..dd95f21c3
--- /dev/null
+++ b/Service/ServiceBehavior/JsonError/JsonErrorBehavior.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior.JsonError
+{
+ internal class JsonErrorBehavior : IEndpointBehavior
+ {
+ public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
+ {
+ }
+
+ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
+ {
+ }
+
+ public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
+ {
+ endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add(new JsonErrorHandler());
+ }
+
+ public void Validate(ServiceEndpoint endpoint)
+ {
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/JsonError/JsonErrorBehaviorExtension.cs b/Service/ServiceBehavior/JsonError/JsonErrorBehaviorExtension.cs
new file mode 100644
index 000000000..274368d1e
--- /dev/null
+++ b/Service/ServiceBehavior/JsonError/JsonErrorBehaviorExtension.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel.Configuration;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceBehavior.JsonError
+{
+ public class JsonErrorBehaviorExtension : BehaviorExtensionElement
+ {
+ public override Type BehaviorType => typeof(JsonErrorBehavior);
+
+ protected override object CreateBehavior()
+ {
+ return new JsonErrorBehavior();
+ }
+ }
+}
diff --git a/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs b/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs
new file mode 100644
index 000000000..76788e8ba
--- /dev/null
+++ b/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace BeWo.Service.ServiceBehavior.JsonError
+{
+ [DataContract]
+ public class JsonError
+ {
+ [DataMember]
+ public string Message { get; set; }
+
+ [DataMember]
+ public string StackTrace { get; set; }
+
+ [DataMember]
+ public string ExceptionType { get; set; }
+ }
+
+ public class JsonErrorHandler : IErrorHandler
+ {
+ public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
+ {
+ // Erstelle eine JSON-Fehlermeldung
+ var jsonError = new JsonError
+ {
+ Message = error.Message,
+ ExceptionType = error.GetType().Name
+ };
+
+ // Fügt StackTrace hinzu (AppSettings)
+ string val = ConfigurationManager.AppSettings["AdminServiceEnableStackTrace"];
+ if(bool.TryParse(val, out bool res) && res)
+ {
+ jsonError.StackTrace = error.StackTrace;
+ }
+
+ // Serialisiere das JSON-Objekt
+ var serializer = new DataContractJsonSerializer(typeof(JsonError));
+ using (var stream = new MemoryStream())
+ {
+ serializer.WriteObject(stream, jsonError);
+ stream.Position = 0;
+ using (var reader = new StreamReader(stream))
+ {
+ string jsonString = reader.ReadToEnd();
+ fault = Message.CreateMessage(version, null, new JsonBodyWriter(jsonString));
+ }
+ }
+
+ // Setze den Content-Type auf application/json
+ var webBodyFormat = WebBodyFormatMessageProperty.Name;
+ if (!fault.Properties.ContainsKey(webBodyFormat))
+ {
+ fault.Properties.Add(webBodyFormat, new WebBodyFormatMessageProperty(WebContentFormat.Raw));
+ }
+
+ var httpResponse = new HttpResponseMessageProperty
+ {
+ StatusCode = System.Net.HttpStatusCode.InternalServerError,
+ StatusDescription = "Internal Server Error",
+ };
+ httpResponse.Headers["Content-Type"] = "application/json";
+ fault.Properties.Add(HttpResponseMessageProperty.Name, httpResponse);
+ }
+
+ public bool HandleError(Exception error)
+ {
+ // Gib an, ob der Fehler behandelt wurde
+ return true;
+ }
+ }
+
+ public class JsonBodyWriter : BodyWriter
+ {
+ private readonly string _json;
+
+ public JsonBodyWriter(string json) : base(true)
+ {
+ _json = json;
+ }
+
+ protected override void OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer)
+ {
+ writer.WriteStartElement("Binary");
+ byte[] jsonBytes = Encoding.UTF8.GetBytes(_json);
+ writer.WriteBase64(jsonBytes, 0, jsonBytes.Length);
+ writer.WriteEndElement();
+ }
+ }
+}
diff --git a/Service/ServiceContracts/IAccountingService.cs b/Service/ServiceContracts/IAccountingService.cs
index 90f31269e..cfde99dbf 100644
--- a/Service/ServiceContracts/IAccountingService.cs
+++ b/Service/ServiceContracts/IAccountingService.cs
@@ -140,37 +140,5 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void StorniereInvoiceBases(List invoices);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- GkvAbrechnungDC GetGkvAbrechnung(long oid);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- List GetAllGkvAbrechnungen();
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req);
-
- [FaultContract(typeof(BeWoFault))]
- [OperationContract]
- GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req);
}
}
\ No newline at end of file
diff --git a/Service/ServiceContracts/IAdminService.cs b/Service/ServiceContracts/IAdminService.cs
new file mode 100644
index 000000000..89fe621ee
--- /dev/null
+++ b/Service/ServiceContracts/IAdminService.cs
@@ -0,0 +1,30 @@
+using BS.Shared.Attributes;
+using BS.Shared.DataContracts.AdminService;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
+using System.ServiceModel.Web;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceContracts
+{
+ [ServiceContract]
+ public interface IAdminService
+ {
+ [OperationContract]
+ [WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)]
+ [RequireNoTenant]
+ string Test();
+
+ [OperationContract]
+ [WebInvoke(UriTemplate = "/Echo/{echo}", Method ="POST", ResponseFormat = WebMessageFormat.Json)]
+ [RequireNoTenant]
+ string Echo(string echo);
+
+ [OperationContract]
+ [WebInvoke(UriTemplate = "/GetGkvSum", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
+ object GetGkvAbrechnungSumme(AdminServiceSumReqDC request);
+ }
+}
diff --git a/Service/ServiceContracts/IGkvAccountingService.cs b/Service/ServiceContracts/IGkvAccountingService.cs
new file mode 100644
index 000000000..c31877f33
--- /dev/null
+++ b/Service/ServiceContracts/IGkvAccountingService.cs
@@ -0,0 +1,63 @@
+using BS.Shared;
+using BS.Shared.Attributes;
+using BS.Shared.DataContracts.GkvAbrechnung;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceContracts
+{
+ [ServiceContract]
+ public interface IGkvAccountingService
+ {
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_View)]
+ GkvAbrechnungDC GetGkvAbrechnung(long oid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_View)]
+ List GetAllGkvAbrechnungen();
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_View)]
+ List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_View)]
+ string GetProtokollRawDataString(long oid, GkvRawDataType gkvRawData);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_Create)]
+ GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_Create)]
+ GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_Delete)]
+ void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_Send)]
+ GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ [RequirePermission(UserRightType.Finance_Gkv_View)]
+ GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req);
+ }
+}
diff --git a/Service/ServiceContracts/IUserService.cs b/Service/ServiceContracts/IUserService.cs
index e3c959186..47bf25c5b 100644
--- a/Service/ServiceContracts/IUserService.cs
+++ b/Service/ServiceContracts/IUserService.cs
@@ -5,6 +5,7 @@ using BeWo.Data.Entities;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared;
+using BS.Shared.Attributes;
namespace BeWo.Service.ServiceContracts
{
@@ -21,31 +22,38 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
+ [RequirePermission(UserRightType.UserView_Delete)]
void DeactivateUser(long pOid, long pVersion);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
+ [RequirePermission(UserRightType.UserGroupView_Delete)]
void DeactivateUserGroup(long pOid, long pVersion);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- void DeactivateUsers(Dictionary pOid2Version);
+ [RequirePermission(UserRightType.UserView_Delete)]
+ void DeactivateUsers(Dictionary pOid2Version);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- void DeleteUser(long pOid, long pVersion);
+ [RequirePermission(UserRightType.UserView_Delete)]
+ void DeleteUser(long pOid, long pVersion);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- void DeleteUserGroup(long pOid, long pVersion);
+ [RequirePermission(UserRightType.UserGroupView_Delete)]
+ void DeleteUserGroup(long pOid, long pVersion);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
+ [RequirePermission(UserRightType.UserGroupView_Delete)]
void DeleteUserGroups(Dictionary pOid2Version);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- void DeleteUsers(Dictionary pOid2Version);
+ [RequirePermission(UserRightType.UserView_Delete)]
+ void DeleteUsers(Dictionary pOid2Version);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
@@ -69,10 +77,12 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- long InsertNewUser(UserDC pUser);
+ [RequirePermission(UserRightType.UserGroupView_Create)]
+ long InsertNewUser(UserDC pUser);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
+ [RequirePermission(UserRightType.UserGroupView_Create)]
long InsertNewUserGroup(UserGroupDC pUserGroup);
[FaultContract(typeof(BeWoFault))]
@@ -105,6 +115,7 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
+ [RequirePermission(UserRightType.UserGroupView_Edit, UserRightType.EditAll)]
long UpdateUserGroup(UserGroupDC pUserGroup);
[FaultContract(typeof(BeWoFault))]
diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs
index ad8d0250a..ebe9ce08b 100644
--- a/Service/ServiceImplementations/AccountingServiceImp.cs
+++ b/Service/ServiceImplementations/AccountingServiceImp.cs
@@ -745,628 +745,5 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
- #region GKV
- public GkvAbrechnungDC GetGkvAbrechnung(long oid)
- {
- try
- {
- var gkv = DAOFactory.GenericDAO.GetByID(oid);
-
- var dc = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkv);
-
- return dc;
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
- public List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter)
- {
- try
- {
- if (gkvAbrechnungViewFilter == null || !gkvAbrechnungViewFilter.FilterTime)
- return GetAllGkvAbrechnungen();
-
- var start = gkvAbrechnungViewFilter.Start;
- var end = gkvAbrechnungViewFilter.End;
- var filter = gkvAbrechnungViewFilter.FilterForInvoiceDate;
-
- return GetGkvAbrechnungen(() => DAOFactory.SearchDAO.GetGkvAbrechnungen(start, end, filter));
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
- public List GetAllGkvAbrechnungen()
- {
- try
- {
- return GetGkvAbrechnungen(() => DAOFactory.GenericDAO.GetAllActive());
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
- private List GetGkvAbrechnungen(Func> get_entities)
- {
- var entities = get_entities();
-
- var dcs = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDCs(entities);
-
- var updateables = dcs.Where(x => x.IsWaiting()).ToArray();
-
- if (!updateables.Any())
- return dcs;
-
- var isUpToDate = SendApp8GetStatusRequest(updateables);
-
- if (isUpToDate)
- return dcs;
-
- entities = get_entities();
-
- dcs = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDCs(entities);
-
- return dcs;
- }
- public List GetCompactGkvAbrechnungByTransferDateRange(DateTime? start, DateTime? end)
- {
- try
- {
- var entities = DAOFactory.SearchDAO.GetGkvTransferProtokollByDateRange(start, end);
-
- var filter = entities.Where(x => x.SentDakotaSuccess);
-
- var oids = filter.Select(x => x.GkvAbrechnungOid).Distinct();
-
- if (!oids.Any())
- return null;
-
- var list = new List();
-
- foreach (var oid in oids)
- {
- var abrechnung = DAOFactory.GenericDAO.LoadByID(oid);
- list.Add(abrechnung);
- }
-
- return MapperFactory.CompactGkvAbrechnungDC_GkvAbrechnung.MapToNewDCs(list);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
-
- public GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request)
- {
- var response = new GkvAbrechnungCreateResponseDC();
-
- try
- {
- var invoice_bases = DAOFactory.GenericDAO.LoadByIDs(request.SelectedInvoiceBases);
-
- ValidatorExtended.ValidateGkvAbrechnung(request.GkvAbrechnungDC, invoice_bases);
-
- var gkv_abrechnung = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewEntity(request.GkvAbrechnungDC);
-
- if (gkv_abrechnung.AbrechnungsZeitraumEnde.Value.Hour == 0)
- {
- gkv_abrechnung.AbrechnungsZeitraumEnde = gkv_abrechnung.AbrechnungsZeitraumEnde.Value.Date.AddDays(1).AddMilliseconds(-1);
- }
-
- var orga = gkv_abrechnung.Organisation;
-
- gkv_abrechnung.Verfahrensstufe = orga.Verfahrensstufe;
-
- decimal gesamt = 0;
- foreach (var invoicebase_oid in request.SelectedInvoiceBases)
- {
- var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase_oid);
-
- foreach (var peroid in service.ServiceInvoicePeriodList)
- {
- foreach (var invoice in peroid.InvoiceItemList)
- {
- gesamt += invoice.AmountTotal.Value;
- }
- }
- }
-
- gkv_abrechnung.Betrag = gesamt;
- gkv_abrechnung.Bezahlt = false;
-
- gkv_abrechnung.ErstelltAm = DateTime.Now;
-
- DAOFactory.GenericDAO.Insert(gkv_abrechnung);
-
- var gkv_abrechnung_dc = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkv_abrechnung);
-
- response.Success = true;
- response.GkvAbrechnungDC = gkv_abrechnung_dc;
- }
- catch (GkvException exc)
- {
- MailUtils.SendGkvModuleErrorMail("CreateNewGkvAbrechnung", exc, Tenant);
-
- if (exc.Title.IsNotNullOrWhiteSpace())
- response.TitleMessage = exc.Title;
- response.Message = exc.Message;
- }
- catch (Exception e)
- {
- MailUtils.SendGkvModuleErrorMail("CreateNewGkvAbrechnung", e, Tenant);
-
- throw Utils.CreateBeWoFaultException(e);
- }
-
- return response;
- }
- public GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung)
- {
- try
- {
- var entity = DAOFactory.GenericDAO.GetByID(abrechnung.GkvAbrechnungOid.Value);
-
- MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MergeWithEntity(abrechnung, entity);
-
- foreach (var invoice in entity.InvoiceBases)
- {
- invoice.IsPaid = entity.Bezahlt;
- }
-
- DAOFactory.GenericDAO.Update(entity);
-
- return MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(entity);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
- public void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung)
- {
- try
- {
- ServiceLogic.SetActivationType(abrechnung.GkvAbrechnungOid.Value, abrechnung.GkvAbrechnungVersion.Value, ActivationTypeId.Deleted);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
-
- public GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req)
- {
- var response = new GkvAbrechnungSendResponseDC();
-
- var oid = req.GkvAbrechnungOid;
-
- var entity = DAOFactory.GenericDAO.LoadByID(oid);
-
- var state = entity.GetState();
-
- if (entity.IsWaiting() || state == GkvState.Paid)
- {
- response.Message = "Validierung fehlgeschlagen";
- return response;
- }
-
- var protokoll = CreateGkvTransferProtokoll(entity, out var error);
- if (error is object)
- {
- MailUtils.SendGkvModuleErrorMail("SendNewGkvAbrechnung - CreateGkvTransferProtokoll", error, Tenant);
-
- response.TitleMessage = "Protokoll Erstellung";
- response.Message = error;
- return response;
- }
-
- if (entity.GkvTransferProtokolle is null)
- entity.GkvTransferProtokolle = new List();
-
- entity.GkvTransferProtokolle.Add(protokoll);
-
- // Protokoll braucht Oid
- DAOFactory.GenericDAO.Update(entity);
-
- try
- {
- var app8_response = SendApp8SendNewRequest(protokoll);
-
- var app8_protokoll = app8_response.GkvTransferProtokollDC;
-
- MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MergeWithEntity(app8_protokoll, protokoll);
-
- response.Success = app8_response.Success;
- response.Message = app8_response.Message;
- }
- catch (GkvException de)
- {
- protokoll.ResultType = GkvTransferResultType.FailSoft;
- protokoll.Fehlerdatum = DateTime.Now;
- protokoll.Fehlernachricht = de.Message;
- protokoll.Fehlertitel = de.Title ?? "Default";
- }
- catch (Exception e)
- {
- protokoll.ResultType = GkvTransferResultType.FailFatal;
- protokoll.Fehlerdatum = DateTime.Now;
- protokoll.Fehlernachricht = e.ToString();
- protokoll.Fehlertitel = "Erstellung (kritisch)";
- }
-
- DAOFactory.GenericDAO.Update(entity);
-
- response.TransferProtokoll = MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MapToNewDC(protokoll);
- response.GkvAbrechnungDC = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(entity);
-
- return response;
- }
- public GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req)
- {
- try
- {
- var app8req = new GkvServerGetIKRequestDC
- {
- IKKrankenkasse = req.IKKrankenkasse,
- Leistungserbringergruppe = req.Leistungserbringergruppe,
- Abrechnungscode = DakotaUtils.GetAbrechnungscode(req.Leistungserbringergruppe),
- Tarifkennzeichen = DakotaUtils.GetTarifkennzeichen(req.Leistungserbringergruppe)
- };
-
- var app8res = SendApp8Request(app8req);
-
- // Erstelle Response
- var res = new GkvAbrechnungGetIKResponseDC
- {
- BezDatenannahmestelle = app8res.BezDatenannahmestelle,
- Gefunden = app8res.Gefunden,
- IKDatenannahmestelle = app8res.IKDatenannahmestelle,
- IKKostentrager = app8res.IKKostentrager,
- IKKrankenkasse = app8res.IKKrankenkasse,
- Message = app8res.Message,
- Success = app8res.Success
- };
-
- // Schaue, ob IK Krankenkassen bereits bei einer anderen Organisation hinterlegt ist
- if (res.Gefunden)
- {
- // Holt alle Organisationen
- var orgas = DAOFactory.SearchDAO.GetAllOrganisationByIKKrankenkasse(req.IKKrankenkasse);
-
- // Entfernt sich selber
- if (req.OrganisationOid is long oid)
- {
- orgas.RemoveAll(x => x.Oid == oid);
- }
-
- if (orgas.Any())
- {
- res.BereitsEnthalten = true;
- res.BereitsEnthaltenBei = orgas.Select(x => x.Name).ToList();
- }
- }
-
- return res;
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
-
- private GkvTransferProtokoll CreateGkvTransferProtokoll(GkvAbrechnung gkvAbrechnung, out string error)
- {
- var protokoll = new GkvTransferProtokoll
- {
- ErstelltAm = DateTime.Now,
- GkvAbrechnungOid = gkvAbrechnung.Oid.Value
- };
-
- error = null;
-
- try
- {
- ValidatorExtended.ValidateGkvAbrechnung(gkvAbrechnung, gkvAbrechnung.InvoiceBases);
-
- var manager = new DakotaManager();
- var mandatordc = new OperationsServiceImp().GetMandator();
-
- Validator.ValidateMandator(mandatordc);
-
- var gkvAbrechnungDC = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkvAbrechnung);
- var orgadc = gkvAbrechnungDC.Organisation;
-
- Validator.ValidateOrganisation(orgadc);
-
- var datenannahmestelle = orgadc.IKDatenannahmestelle;
- var (datenaustauschreferenz, transfernummer) = GetNextDatenaustauschreferenzTransfernummer(gkvAbrechnung, datenannahmestelle);
- var (dat_short, tra_short) = ClearDatenaustauschreferenzTransfernummer(datenaustauschreferenz, transfernummer);
-
- var first_cost = gkvAbrechnung.InvoiceBases.First().CostBearer2SupportConcept.SupportConcept.Customer;
-
- var plugin = PluginLoader.FindClass();
- var addressInfo = plugin.GetAddressInformation(first_cost.Oid);
-
- foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
- {
- var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
-
- var addressInfo2 = plugin.GetAddressInformation(customer.Oid);
-
- if (addressInfo.IKLeistungserbringer != addressInfo2.IKLeistungserbringer)
- {
- throw new GkvException($"Klient '{first_cost.Person.LastNameFirstName}' ({addressInfo.IKLeistungserbringer}) und '{customer.Person.LastNameFirstName}' ({addressInfo2.IKLeistungserbringer}) verweisen auf unterschiedliche Leistungserbringer.");
- }
- }
-
- foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
- {
- var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase.Oid.Value);
- var orga2 = invoicebase.CostBearer2SupportConcept.CostBearer.Organisation;
- var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
-
- var invoicebase_dc = MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(invoicebase);
-
- var servicedc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(service);
- var customerdc = MapperFactory.CustomerDC_Customer.MapToNewDC(customer);
-
- Validator.ValidateCustomer(customerdc);
-
- manager.Add(servicedc, orgadc, customerdc, addressInfo, dat_short, tra_short);
- }
-
- manager.Apply();
-
- if (manager.DakotaFileDict.Count != 1 || manager.DakotaFileDict.First().Value.GetKostenträgerCount() != 1)
- {
- var msg = "Unerwartete Anzahl an Dakota Files berechnet.";
-
- throw new GkvException(msg);
- }
-
- var file_from_manager = manager.DakotaFileDict.First().Value;
-
- var nutzdatendatei = file_from_manager.GetNutzdatendatei();
-
- // https://dev.mysql.com/doc/refman/8.3/en/string-type-syntax.html
- // A TEXT column with a maximum length of 16,777,215 (224 − 1) characters.
- // The effective maximum length is less if the value contains multibyte characters.
- // Each MEDIUMTEXT value is stored using a 3-byte length prefix that indicates the number of bytes in the value.
- //
- // Type | Maximum length
- // -----------+-------------------------------------
- // TINYTEXT | 255(2^8−1) bytes
- // TEXT | 65,535(2^16−1) bytes = 64 KiB
- // MEDIUMTEXT | 16,777,215(2^24−1) bytes = 16 MiB
- // LONGTEXT | 4,294,967,295(2^32−1) bytes = 4 GiB
- if (nutzdatendatei.Length > 16777215)
- {
- var msg = $"nutzdatendatei - Länger als 16777215: {nutzdatendatei.Length}";
-
- throw new GkvException(msg);
- }
-
- protokoll.Datenaustauschreferenz = datenaustauschreferenz;
- protokoll.Transfernummer = transfernummer;
-
- protokoll.IKDatenannahmestelle = file_from_manager.GetIKDatenannahmestelle();
- protokoll.IKKostentrager = file_from_manager.GetIKKostenträger();
- protokoll.IKLeistungserbringer = file_from_manager.GetIKLeistungserbringer();
- protokoll.IKKrankenkasse = file_from_manager.GetIKVersichertenKarte();
-
- protokoll.Rechnungsnummer = file_from_manager.GetRechnungsnummer();
- protokoll.Auftragsdatei = file_from_manager.GetAuftragsdatei();
- protokoll.Nutzdatendatei = nutzdatendatei;
- protokoll.Transfername = file_from_manager.GetTransferName();
- protokoll.Dateigrosse = nutzdatendatei.Length;
-
- protokoll.Dateityp = "Nutzdatendatei";
- protokoll.Dateiname = protokoll.Transfername;
-
- protokoll.AbsenderBezeichnung = "ownSoft GmbH";
- protokoll.EmpfangerBezeichnung = orgadc.BezDatenannahmestelle;
-
- return protokoll;
- }
- catch (GkvException de)
- {
- error = de.ToString();
- }
- catch (Exception e)
- {
- error = e.ToString();
- }
-
- return null;
- }
-
- private Tuple GetNextDatenaustauschreferenzTransfernummer(GkvAbrechnung gkvAbrechnung, string datenannahmestelle)
- {
- var datenaustauschref = DAOFactory.SearchDAO.GetNextDatenaustauschreferenz(datenannahmestelle);
- int transfernummer;
-
- var state = gkvAbrechnung.GetState();
-
- if (state == GkvState.NoSend)
- {
- transfernummer = DAOFactory.SearchDAO.GetNextTransfernummer(datenannahmestelle);
- }
- else if (state == GkvState.ErrorSoft || state == GkvState.ErrorFatal || state == GkvState.ErrorFolgefehler)
- {
- transfernummer = gkvAbrechnung.GkvTransferProtokolle.Last().Transfernummer;
- }
- else
- {
- throw new ArgumentException($"Versucht Transfernummer zu laden, invalid state: {state}", nameof(state));
- }
-
- return new Tuple(datenaustauschref, transfernummer);
- }
- private Tuple ClearDatenaustauschreferenzTransfernummer(int datenaustauschreferenz, int transfernummer)
- {
- int d = datenaustauschreferenz % 99999;
- int t = transfernummer % 1000;
-
- if (d == 0)
- {
- d = 99999;
- }
-
- return new Tuple(d, t);
- }
-
- private GkvServerSendNewResponseDC SendApp8SendNewRequest(GkvTransferProtokoll protokoll)
- {
- var gkv_transfer_dc = MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MapToNewDC(protokoll);
-
- var request_app8 = new GkvServerSendNewRequestDC
- {
- Protokoll = gkv_transfer_dc
- };
-
- var response_app8 = SendApp8Request(request_app8);
-
- if (!response_app8.Success)
- throw new GkvException(response_app8.Message);
-
- return response_app8;
- }
- ///
- ///
- ///
- ///
- ///
- ///
- /// Returns true, if the states are all up to date. False otherwise.
- private bool SendApp8GetStatusRequest(GkvAbrechnungDC[] updateables)
- {
- var updateables_len = updateables.Count();
-
- var request = new GkvServerGetStatusRequestDC
- {
- Tenant = MultitenancyOperationContextExt.Current.Tenant,
- Oids = new long[updateables_len]
- };
-
- for (int id = 0; id < updateables_len; id++)
- {
- var gkv_abrechnung = updateables[id];
- var gkv_transfer = gkv_abrechnung.TransferProtokolle.Last();
-
- request.Oids[id] = gkv_transfer.GkvTransferProtokollOid.Value;
- }
-
- GkvServerGetStatusResponseDC response_app8;
- try
- {
- response_app8 = SendApp8Request(request);
- }
- catch (Exception e)
- {
- MailUtils.SendGkvModuleErrorMail("GkvServerGetStatusRequest Error", e, Tenant);
-
- return true;
- }
-
- if (!response_app8.Success)
- throw new GkvException("Success false - " + response_app8.Message);
-
- if (response_app8.Results is null)
- throw new GkvException("Result null - " + response_app8.Message);
-
- var results = response_app8.Results.Where(x => x is object);
-
- if (!results.Any())
- return true;
-
- HandleGkvServerResults(results);
-
- return false;
- }
-
- public void HandleGkvServerResults(IEnumerable results)
- {
- var protokolls = new List();
- foreach (var result in results)
- {
- var protokoll = DAOFactory.GenericDAO.GetByID(result.ProtokollOid);
-
- protokoll.ResultType = result.ResultType;
- protokoll.Fehlertitel = result.Titel;
- protokoll.Fehlerdatum = result.Datum;
- protokoll.Fehlernachricht = result.Nachricht;
-
- switch (result.ResultType)
- {
- case GkvTransferResultType.Success:
- protokoll.SentDakotaSuccess = true;
- break;
- case GkvTransferResultType.FailSoft:
- protokoll.SentApp8Success = false;
- break;
- case GkvTransferResultType.FailFatal:
- protokoll.SentApp8Success = false;
- break;
- case GkvTransferResultType.FailFollowUp:
- protokoll.SentApp8Success = false;
- break;
- }
-
- protokolls.Add(protokoll);
- }
-
- if (protokolls.Any())
- DAOFactory.GenericDAO.Update(protokolls);
-
- var follows = results.Where(x => x.ResultType == GkvTransferResultType.FailFollowUp);
-
- if (follows.Any())
- {
- foreach (var follow in follows)
- {
- var protokoll_oid = follow.ProtokollOid;
- var protokoll = DAOFactory.GenericDAO.LoadByID(protokoll_oid);
- var abrechnung_oid = protokoll.GkvAbrechnungOid;
-
- var new_req = new GkvAbrechnungSendRequestDC()
- {
- GkvAbrechnungOid = abrechnung_oid
- };
-
- var res = SendNewGkvAbrechnung(new_req);
-
- if (!res.Success)
- throw new GkvException("Success - " + res.Message);
- }
- }
- }
-
- private Res SendApp8Request(Req request) where Req : GkvServerRequestDC where Res : GkvResponseDC
- {
- var user = LoggedInUserOperationContextExt.Current?.User ?? SessionFacade.LoggedInUser;
- if (user == null)
- {
- throw new GkvException("User unbekannt", "KundenApp");
- }
-
- request.Username = user.LoginName;
- request.Password = user.BCryptPassword;
- request.Tenant = MultitenancyOperationContextExt.Current.Tenant;
-
- if (request is GkvServerSendNewRequestDC send_new_req)
- {
- send_new_req.ApplicationUserOid = user.Oid.Value;
- }
-
- return GkvSender.SendApp8Request(request, request.Tenant);
- }
-
- #endregion
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/AdminServiceImp.cs b/Service/ServiceImplementations/AdminServiceImp.cs
new file mode 100644
index 000000000..d9d7490e9
--- /dev/null
+++ b/Service/ServiceImplementations/AdminServiceImp.cs
@@ -0,0 +1,50 @@
+using BeWo.Data.Access;
+using BeWo.Service.ServiceContracts;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.AdminService;
+using DevExpress.Pdf.Native.BouncyCastle.Ocsp;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceImplementations
+{
+ [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
+ public class AdminServiceImp : IAdminService
+ {
+ public string Test()
+ {
+ return "Test erfolgreich!";
+ }
+
+ public string Echo(string echo)
+ {
+ return echo;
+ }
+
+ public object GetGkvAbrechnungSumme(AdminServiceSumReqDC request)
+ {
+ if (request == null)
+ {
+ throw new ArgumentException("request darf nicht null sein");
+ }
+
+ if(!Utils.TryParseISO8601(request.Start, out var start))
+ {
+ throw new ArgumentException("start entspricht nicht ISO8601 Norm.");
+ }
+
+ if (!Utils.TryParseISO8601(request.End, out var end))
+ {
+ throw new ArgumentException("end entspricht nicht ISO8601 Norm.");
+ }
+
+ var sum = DAOFactory.ScriptDAO.GetGkvSumByDateRange(start, end);
+
+ return sum?.ToString("0.00");
+ }
+ }
+}
diff --git a/Service/ServiceImplementations/GkvAccountingServiceImp.cs b/Service/ServiceImplementations/GkvAccountingServiceImp.cs
new file mode 100644
index 000000000..20854b9cb
--- /dev/null
+++ b/Service/ServiceImplementations/GkvAccountingServiceImp.cs
@@ -0,0 +1,669 @@
+using BeWo.Data;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.Core;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Plugins;
+using BeWo.Service.ServiceContracts;
+using BS.Shared;
+using BS.Shared.AppSender;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.GkvAbrechnung;
+using BS.Shared.Exceptions;
+using BS.Shared.Extensions;
+using Dakota;
+using Dakota.Logic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+
+using Utils = BeWo.Service.Core.Utils;
+
+namespace BeWo.Service.ServiceImplementations
+{
+ [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
+ public class GkvAccountingServiceImp : IGkvAccountingService
+ {
+ public string Tenant => MultitenancyOperationContextExt.Current?.Tenant;
+
+ public GkvAbrechnungDC GetGkvAbrechnung(long oid)
+ {
+ try
+ {
+ var gkv = DAOFactory.GenericDAO.GetByID(oid);
+
+ var dc = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkv);
+
+ MapperFactory.GkvAbrechnungDC_GkvAbrechnung.ClearRawData(dc);
+
+ return dc;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+ public List GetFilteredGkvAbrechnungen(GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter)
+ {
+ try
+ {
+ if (gkvAbrechnungViewFilter == null || !gkvAbrechnungViewFilter.FilterTime)
+ return GetAllGkvAbrechnungen();
+
+ var start = gkvAbrechnungViewFilter.Start;
+ var end = gkvAbrechnungViewFilter.End;
+ var filter = gkvAbrechnungViewFilter.FilterForInvoiceDate;
+
+ return GetGkvAbrechnungen(() => DAOFactory.SearchDAO.GetGkvAbrechnungen(start, end, filter));
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+ public List GetAllGkvAbrechnungen()
+ {
+ try
+ {
+ return GetGkvAbrechnungen(() => DAOFactory.GenericDAO.GetAllActive());
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+ private List GetGkvAbrechnungen(Func> get_entities)
+ {
+ var entities = get_entities();
+
+ var dcs = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDCs(entities);
+
+ MapperFactory.GkvAbrechnungDC_GkvAbrechnung.ClearRawData(dcs);
+
+ var updateables = dcs.Where(x => x.IsWaiting()).ToArray();
+
+ if (!updateables.Any())
+ return dcs;
+
+ var isUpToDate = SendApp8GetStatusRequest(updateables);
+
+ if (isUpToDate)
+ return dcs;
+
+ entities = get_entities();
+
+ dcs = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDCs(entities);
+
+ MapperFactory.GkvAbrechnungDC_GkvAbrechnung.ClearRawData(dcs);
+
+ return dcs;
+ }
+ public string GetProtokollRawDataString(long oid, GkvRawDataType gkvRawData)
+ {
+ try
+ {
+ if (oid <= 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(oid), $"oid \'{oid}\' nicht positiv");
+ }
+
+ var str = DAOFactory.SearchDAO.GetGkvRawData(oid, gkvRawData);
+
+ return str;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(GkvAbrechnungCreateRequestDC request)
+ {
+ var response = new GkvAbrechnungCreateResponseDC();
+
+ try
+ {
+ var invoice_bases = DAOFactory.GenericDAO.LoadByIDs(request.SelectedInvoiceBases);
+
+ ValidatorExtended.ValidateGkvAbrechnung(request.GkvAbrechnungDC, invoice_bases);
+
+ var gkv_abrechnung = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewEntity(request.GkvAbrechnungDC);
+
+ if (gkv_abrechnung.AbrechnungsZeitraumEnde.Value.Hour == 0)
+ {
+ gkv_abrechnung.AbrechnungsZeitraumEnde = gkv_abrechnung.AbrechnungsZeitraumEnde.Value.Date.AddDays(1).AddMilliseconds(-1);
+ }
+
+ var orga = gkv_abrechnung.Organisation;
+
+ gkv_abrechnung.Verfahrensstufe = orga.Verfahrensstufe;
+
+ decimal gesamt = 0;
+ foreach (var invoicebase_oid in request.SelectedInvoiceBases)
+ {
+ var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase_oid);
+
+ foreach (var peroid in service.ServiceInvoicePeriodList)
+ {
+ foreach (var invoice in peroid.InvoiceItemList)
+ {
+ gesamt += invoice.AmountTotal.Value;
+ }
+ }
+ }
+
+ gkv_abrechnung.Betrag = gesamt;
+ gkv_abrechnung.Bezahlt = false;
+
+ gkv_abrechnung.ErstelltAm = DateTime.Now;
+
+ DAOFactory.GenericDAO.Insert(gkv_abrechnung);
+
+ var gkv_abrechnung_dc = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkv_abrechnung);
+
+ response.Success = true;
+ response.GkvAbrechnungDC = gkv_abrechnung_dc;
+ }
+ catch (GkvException exc)
+ {
+ MailUtils.SendGkvModuleErrorMail("CreateNewGkvAbrechnung", exc, Tenant);
+
+ if (exc.Title.IsNotNullOrWhiteSpace())
+ response.TitleMessage = exc.Title;
+ response.Message = exc.Message;
+ }
+ catch (Exception e)
+ {
+ MailUtils.SendGkvModuleErrorMail("CreateNewGkvAbrechnung", e, Tenant);
+
+ throw Utils.CreateBeWoFaultException(e);
+ }
+
+ return response;
+ }
+ public GkvAbrechnungDC UpdateGkvAbrechnung(GkvAbrechnungDC abrechnung)
+ {
+ try
+ {
+ var entity = DAOFactory.GenericDAO.GetByID(abrechnung.GkvAbrechnungOid.Value);
+
+ if(entity.Notice != abrechnung.Notice)
+ entity.Notice = abrechnung.Notice;
+
+ if (entity.UrbelegeGesendet != abrechnung.UrbelegeGesendet)
+ entity.UrbelegeGesendet = abrechnung.UrbelegeGesendet;
+
+ if (entity.Bezahlt != abrechnung.Bezahlt)
+ {
+ entity.Bezahlt = abrechnung.Bezahlt;
+
+ foreach (var invoice in entity.InvoiceBases)
+ {
+ invoice.IsPaid = entity.Bezahlt;
+ }
+ }
+
+ DAOFactory.GenericDAO.Update(entity);
+
+ var dc = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(entity);
+
+ MapperFactory.GkvAbrechnungDC_GkvAbrechnung.ClearRawData(dc);
+
+ return dc;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+ public void DeleteGkvAbrechnung(GkvAbrechnungDC abrechnung)
+ {
+ try
+ {
+ ServiceLogic.SetActivationType(abrechnung.GkvAbrechnungOid.Value, abrechnung.GkvAbrechnungVersion.Value, ActivationTypeId.Deleted);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ ///
+ /// Erstellt GkvTransferProtokoll
+ ///
+ ///
+ ///
+ public GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(GkvAbrechnungSendRequestDC req)
+ {
+ var response = new GkvAbrechnungSendResponseDC();
+
+ var oid = req.GkvAbrechnungOid;
+
+ var entity = DAOFactory.GenericDAO.LoadByID(oid);
+
+ var state = entity.GetState();
+
+ if (entity.IsWaiting() || state == GkvState.Paid)
+ {
+ response.Message = "Validierung fehlgeschlagen";
+ return response;
+ }
+
+ var protokoll = CreateGkvTransferProtokoll(entity, out var error);
+ if (error is object)
+ {
+ MailUtils.SendGkvModuleErrorMail("SendNewGkvAbrechnung - CreateGkvTransferProtokoll", error, Tenant);
+
+ response.TitleMessage = "Protokoll Erstellung";
+ response.Message = error;
+ return response;
+ }
+
+ if (entity.GkvTransferProtokolle is null)
+ entity.GkvTransferProtokolle = new List();
+
+ entity.GkvTransferProtokolle.Add(protokoll);
+
+ // Protokoll braucht Oid
+ DAOFactory.GenericDAO.Update(entity);
+
+ try
+ {
+ var app8_response = SendApp8SendNewRequest(protokoll);
+
+ var app8_protokoll = app8_response.GkvTransferProtokollDC;
+
+ MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MergeWithEntity(app8_protokoll, protokoll);
+
+ response.Success = app8_response.Success;
+ response.Message = app8_response.Message;
+ }
+ catch (GkvException de)
+ {
+ protokoll.ResultType = GkvTransferResultType.FailSoft;
+ protokoll.Fehlerdatum = DateTime.Now;
+ protokoll.Fehlernachricht = de.Message;
+ protokoll.Fehlertitel = de.Title ?? "Default";
+ }
+ catch (Exception e)
+ {
+ protokoll.ResultType = GkvTransferResultType.FailFatal;
+ protokoll.Fehlerdatum = DateTime.Now;
+ protokoll.Fehlernachricht = e.ToString();
+ protokoll.Fehlertitel = "Erstellung (kritisch)";
+ }
+
+ DAOFactory.GenericDAO.Update(entity);
+
+ response.TransferProtokoll = MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MapToNewDC(protokoll);
+ response.GkvAbrechnungDC = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(entity);
+
+ MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.ClearRawData(response.TransferProtokoll);
+ MapperFactory.GkvAbrechnungDC_GkvAbrechnung.ClearRawData(response.GkvAbrechnungDC);
+
+ return response;
+ }
+ public GkvAbrechnungGetIKResponseDC SendGetIKRequest(GkvAbrechnungGetIKRequestDC req)
+ {
+ try
+ {
+ var app8req = new GkvServerGetIKRequestDC
+ {
+ IKKrankenkasse = req.IKKrankenkasse,
+ Leistungserbringergruppe = req.Leistungserbringergruppe,
+ Abrechnungscode = DakotaUtils.GetAbrechnungscode(req.Leistungserbringergruppe),
+ Tarifkennzeichen = DakotaUtils.GetTarifkennzeichen(req.Leistungserbringergruppe)
+ };
+
+ var app8res = SendApp8Request(app8req);
+
+ // Erstelle Response
+ var res = new GkvAbrechnungGetIKResponseDC
+ {
+ BezDatenannahmestelle = app8res.BezDatenannahmestelle,
+ Gefunden = app8res.Gefunden,
+ IKDatenannahmestelle = app8res.IKDatenannahmestelle,
+ IKKostentrager = app8res.IKKostentrager,
+ IKKrankenkasse = app8res.IKKrankenkasse,
+ Message = app8res.Message,
+ Success = app8res.Success
+ };
+
+ // Schaue, ob IK Krankenkassen bereits bei einer anderen Organisation hinterlegt ist
+ if (res.Gefunden)
+ {
+ // Holt alle Organisationen
+ var orgas = DAOFactory.SearchDAO.GetAllOrganisationByIKKrankenkasse(req.IKKrankenkasse);
+
+ // Entfernt sich selber
+ if (req.OrganisationOid is long oid)
+ {
+ orgas.RemoveAll(x => x.Oid == oid);
+ }
+
+ if (orgas.Any())
+ {
+ res.BereitsEnthalten = true;
+ res.BereitsEnthaltenBei = orgas.Select(x => x.Name).ToList();
+ }
+ }
+
+ return res;
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ private GkvTransferProtokoll CreateGkvTransferProtokoll(GkvAbrechnung gkvAbrechnung, out string error)
+ {
+ var protokoll = new GkvTransferProtokoll
+ {
+ ErstelltAm = DateTime.Now,
+ GkvAbrechnungOid = gkvAbrechnung.Oid.Value
+ };
+
+ error = null;
+
+ try
+ {
+ ValidatorExtended.ValidateGkvAbrechnung(gkvAbrechnung, gkvAbrechnung.InvoiceBases);
+
+ var manager = new DakotaManager();
+ var mandatordc = new OperationsServiceImp().GetMandator();
+
+ Validator.ValidateMandator(mandatordc);
+
+ var gkvAbrechnungDC = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkvAbrechnung);
+ var orgadc = gkvAbrechnungDC.Organisation;
+
+ Validator.ValidateOrganisation(orgadc);
+
+ var datenannahmestelle = orgadc.IKDatenannahmestelle;
+ var (datenaustauschreferenz, transfernummer) = GetNextDatenaustauschreferenzTransfernummer(gkvAbrechnung, datenannahmestelle);
+ var (dat_short, tra_short) = ClearDatenaustauschreferenzTransfernummer(datenaustauschreferenz, transfernummer);
+
+ var first_cost = gkvAbrechnung.InvoiceBases.First().CostBearer2SupportConcept.SupportConcept.Customer;
+
+ var plugin = PluginLoader.FindClass();
+ var addressInfo = plugin.GetAddressInformation(first_cost.Oid);
+
+ foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
+ {
+ var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
+
+ var addressInfo2 = plugin.GetAddressInformation(customer.Oid);
+
+ if (addressInfo.IKLeistungserbringer != addressInfo2.IKLeistungserbringer)
+ {
+ throw new GkvException($"Klient '{first_cost.Person.LastNameFirstName}' ({addressInfo.IKLeistungserbringer}) und '{customer.Person.LastNameFirstName}' ({addressInfo2.IKLeistungserbringer}) verweisen auf unterschiedliche Leistungserbringer.");
+ }
+ }
+
+ foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
+ {
+ var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase.Oid.Value);
+ var orga2 = invoicebase.CostBearer2SupportConcept.CostBearer.Organisation;
+ var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
+
+ var invoicebase_dc = MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(invoicebase);
+
+ var servicedc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(service);
+ var customerdc = MapperFactory.CustomerDC_Customer.MapToNewDC(customer);
+
+ Validator.ValidateCustomer(customerdc);
+
+ manager.Add(servicedc, orgadc, customerdc, addressInfo, dat_short, tra_short);
+ }
+
+ manager.Apply();
+
+ if (manager.DakotaFileDict.Count != 1 || manager.DakotaFileDict.First().Value.GetKostenträgerCount() != 1)
+ {
+ var msg = "Unerwartete Anzahl an Dakota Files berechnet.";
+
+ throw new GkvException(msg);
+ }
+
+ var file_from_manager = manager.DakotaFileDict.First().Value;
+
+ var nutzdatendatei = file_from_manager.GetNutzdatendatei();
+
+ // https://dev.mysql.com/doc/refman/8.3/en/string-type-syntax.html
+ // A TEXT column with a maximum length of 16,777,215 (224 − 1) characters.
+ // The effective maximum length is less if the value contains multibyte characters.
+ // Each MEDIUMTEXT value is stored using a 3-byte length prefix that indicates the number of bytes in the value.
+ //
+ // Type | Maximum length
+ // -----------+-------------------------------------
+ // TINYTEXT | 255(2^8−1) bytes
+ // TEXT | 65,535(2^16−1) bytes = 64 KiB
+ // MEDIUMTEXT | 16,777,215(2^24−1) bytes = 16 MiB
+ // LONGTEXT | 4,294,967,295(2^32−1) bytes = 4 GiB
+ if (nutzdatendatei.Length > 16777215)
+ {
+ var msg = $"nutzdatendatei - Länger als 16777215: {nutzdatendatei.Length}";
+
+ throw new GkvException(msg);
+ }
+
+ protokoll.Datenaustauschreferenz = datenaustauschreferenz;
+ protokoll.Transfernummer = transfernummer;
+
+ protokoll.IKDatenannahmestelle = file_from_manager.GetIKDatenannahmestelle();
+ protokoll.IKKostentrager = file_from_manager.GetIKKostenträger();
+ protokoll.IKLeistungserbringer = file_from_manager.GetIKLeistungserbringer();
+ protokoll.IKKrankenkasse = file_from_manager.GetIKVersichertenKarte();
+
+ protokoll.Rechnungsnummer = file_from_manager.GetRechnungsnummer();
+ protokoll.Auftragsdatei = file_from_manager.GetAuftragsdatei();
+ protokoll.Nutzdatendatei = nutzdatendatei;
+ protokoll.Transfername = file_from_manager.GetTransferName();
+ protokoll.Dateigrosse = nutzdatendatei.Length;
+
+ protokoll.Dateityp = "Nutzdatendatei";
+ protokoll.Dateiname = protokoll.Transfername;
+
+ protokoll.AbsenderBezeichnung = "ownSoft GmbH";
+ protokoll.EmpfangerBezeichnung = orgadc.BezDatenannahmestelle;
+
+ return protokoll;
+ }
+ catch (GkvException de)
+ {
+ error = de.ToString();
+ }
+ catch (Exception e)
+ {
+ error = e.ToString();
+ }
+
+ return null;
+ }
+
+ private Tuple GetNextDatenaustauschreferenzTransfernummer(GkvAbrechnung gkvAbrechnung, string datenannahmestelle)
+ {
+ var datenaustauschref = DAOFactory.SearchDAO.GetNextDatenaustauschreferenz(datenannahmestelle);
+ int transfernummer;
+
+ var state = gkvAbrechnung.GetState();
+
+ if (state == GkvState.NoSend)
+ {
+ transfernummer = DAOFactory.SearchDAO.GetNextTransfernummer(datenannahmestelle);
+ }
+ else if (state == GkvState.ErrorSoft || state == GkvState.ErrorFatal || state == GkvState.ErrorFolgefehler)
+ {
+ transfernummer = gkvAbrechnung.GkvTransferProtokolle.Last().Transfernummer;
+ }
+ else
+ {
+ throw new ArgumentException($"Versucht Transfernummer zu laden, invalid state: {state}", nameof(state));
+ }
+
+ return new Tuple(datenaustauschref, transfernummer);
+ }
+ private Tuple ClearDatenaustauschreferenzTransfernummer(int datenaustauschreferenz, int transfernummer)
+ {
+ int d = datenaustauschreferenz % 99999;
+ int t = transfernummer % 1000;
+
+ if (d == 0)
+ {
+ d = 99999;
+ }
+
+ return new Tuple(d, t);
+ }
+
+ private GkvServerSendNewResponseDC SendApp8SendNewRequest(GkvTransferProtokoll protokoll)
+ {
+ var gkv_transfer_dc = MapperFactory.GkvTransferProtokollDC_GkvTransferprotokoll.MapToNewDC(protokoll);
+
+ var request_app8 = new GkvServerSendNewRequestDC
+ {
+ Protokoll = gkv_transfer_dc
+ };
+
+ var response_app8 = SendApp8Request(request_app8);
+
+ if (!response_app8.Success)
+ throw new GkvException(response_app8.Message);
+
+ return response_app8;
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Returns true, if the states are all up to date. False otherwise.
+ private bool SendApp8GetStatusRequest(GkvAbrechnungDC[] updateables)
+ {
+ var updateables_len = updateables.Count();
+
+ var request = new GkvServerGetStatusRequestDC
+ {
+ Tenant = MultitenancyOperationContextExt.Current.Tenant,
+ Oids = new long[updateables_len]
+ };
+
+ for (int id = 0; id < updateables_len; id++)
+ {
+ var gkv_abrechnung = updateables[id];
+ var gkv_transfer = gkv_abrechnung.TransferProtokolle.Last();
+
+ request.Oids[id] = gkv_transfer.GkvTransferProtokollOid.Value;
+ }
+
+ GkvServerGetStatusResponseDC response_app8;
+ try
+ {
+ response_app8 = SendApp8Request(request);
+ }
+ catch (Exception e)
+ {
+ MailUtils.SendGkvModuleErrorMail("GkvServerGetStatusRequest Error", e, Tenant);
+
+ return true;
+ }
+
+ if (!response_app8.Success)
+ throw new GkvException("Success false - " + response_app8.Message);
+
+ if (response_app8.Results is null)
+ throw new GkvException("Result null - " + response_app8.Message);
+
+ var results = response_app8.Results.Where(x => x is object);
+
+ if (!results.Any())
+ return true;
+
+ HandleGkvServerResults(results);
+
+ return false;
+ }
+
+ public void HandleGkvServerResults(IEnumerable results)
+ {
+ var protokolls = new List();
+ foreach (var result in results)
+ {
+ var protokoll = DAOFactory.GenericDAO.GetByID(result.ProtokollOid);
+
+ protokoll.ResultType = result.ResultType;
+ protokoll.Fehlertitel = result.Titel;
+ protokoll.Fehlerdatum = result.Datum;
+ protokoll.Fehlernachricht = result.Nachricht;
+
+ switch (result.ResultType)
+ {
+ case GkvTransferResultType.Success:
+ protokoll.SentDakotaSuccess = true;
+ break;
+ case GkvTransferResultType.FailSoft:
+ protokoll.SentApp8Success = false;
+ break;
+ case GkvTransferResultType.FailFatal:
+ protokoll.SentApp8Success = false;
+ break;
+ case GkvTransferResultType.FailFollowUp:
+ protokoll.SentApp8Success = false;
+ break;
+ }
+
+ protokolls.Add(protokoll);
+ }
+
+ if (protokolls.Any())
+ DAOFactory.GenericDAO.Update(protokolls);
+
+ var follows = results.Where(x => x.ResultType == GkvTransferResultType.FailFollowUp);
+
+ if (follows.Any())
+ {
+ foreach (var follow in follows)
+ {
+ var protokoll_oid = follow.ProtokollOid;
+ var protokoll = DAOFactory.GenericDAO.LoadByID(protokoll_oid);
+ var abrechnung_oid = protokoll.GkvAbrechnungOid;
+
+ var new_req = new GkvAbrechnungSendRequestDC()
+ {
+ GkvAbrechnungOid = abrechnung_oid
+ };
+
+ var res = SendNewGkvAbrechnung(new_req);
+
+ if (!res.Success)
+ throw new GkvException("Success - " + res.Message);
+ }
+ }
+ }
+
+ private Res SendApp8Request(Req request) where Req : GkvServerRequestDC where Res : GkvResponseDC
+ {
+ var user = LoggedInUserOperationContextExt.Current?.User ?? SessionFacade.LoggedInUser;
+ if (user == null)
+ {
+ throw new GkvException("User unbekannt", "KundenApp");
+ }
+
+ request.Username = user.LoginName;
+ request.Password = user.BCryptPassword;
+ request.Tenant = MultitenancyOperationContextExt.Current.Tenant;
+
+ if (request is GkvServerSendNewRequestDC send_new_req)
+ {
+ send_new_req.ApplicationUserOid = user.Oid.Value;
+ }
+
+ return GkvSender.SendApp8Request(request, request.Tenant);
+ }
+ }
+}
diff --git a/Service/ServiceUtils/ServiceHelper.cs b/Service/ServiceUtils/ServiceHelper.cs
new file mode 100644
index 000000000..476262ff6
--- /dev/null
+++ b/Service/ServiceUtils/ServiceHelper.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.IdentityModel.Claims;
+using System.Linq;
+using System.Reflection;
+using System.ServiceModel.Channels;
+using System.Text;
+using System.Threading.Tasks;
+using BeWo.Service.ServiceContracts;
+using BS.Shared.Attributes;
+using BS.Shared.Extensions;
+using NHibernate.Hql.Ast.ANTLR.Tree;
+
+namespace BeWo.Service.ServiceUtils
+{
+ public static class ServiceHelper
+ {
+ public static T GetCustomAttribute(Uri baseAddress, Uri request) where T : Attribute
+ {
+ // Hole Interface
+ string lInterface = null;
+ var segments = baseAddress.Segments;
+ for (int i = 0; i < segments.Length; i++)
+ {
+ var seg = segments[i].Trim('/');
+
+ if (seg.EndsWith(".svc"))
+ {
+ lInterface = seg.Substring(0, seg.Length - 4);
+ }
+ }
+
+ // Falls kein Interface gefunden wird
+ if (string.IsNullOrWhiteSpace(lInterface) )
+ {
+ throw new ArgumentException($"Zugriff verweigert. Interface unbekannt");
+ }
+
+ // Wird für URLTemplate != Methodname verwendet
+ var name = $"BeWo.Service.ServiceContracts.I{lInterface}";
+ var t = Type.GetType(name);
+ var resolver = new UriTemplateResolver(baseAddress, t);
+ var method = resolver.ResolveMethod(request.AbsoluteUri);
+ var methodInfo = t.GetMethod(method);
+
+ // Rückgabe
+ return getCustomAttribute(methodInfo);
+ }
+
+ public static T GetCustomAttribute(string pServiceInterface, string pMethodName) where T : Attribute
+ {
+ MethodInfo methodInfo = null;
+
+ try
+ {
+ // Hole entsprechende Methode
+ var name = $"BeWo.Service.ServiceContracts.{pServiceInterface}";
+ var t = Type.GetType(name);
+ methodInfo = t.GetMethod(pMethodName);
+ }
+ catch (Exception)
+ {
+ throw new ArgumentException($"Zugriff verweigert. Interface oder Methode unbekannt");
+ }
+
+ return getCustomAttribute(methodInfo);
+ }
+
+ private static T getCustomAttribute(MethodInfo methodInfo) where T : Attribute
+ {
+ if (methodInfo == null)
+ {
+ throw new ArgumentException($"Zugriff verweigert. Interface oder Methode unbekannt");
+ }
+
+ // Hole Custome Attribute
+ var attribute = methodInfo.GetCustomAttribute();
+
+ return attribute;
+ }
+ }
+}
diff --git a/Service/ServiceUtils/UriTemplateResolver.cs b/Service/ServiceUtils/UriTemplateResolver.cs
new file mode 100644
index 000000000..6bd3f170b
--- /dev/null
+++ b/Service/ServiceUtils/UriTemplateResolver.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.ServiceModel.Web;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Service.ServiceUtils
+{
+ public class UriTemplateResolver
+ {
+ private UriTemplateTable _uriTemplateTable;
+
+ public UriTemplateResolver(Uri baseAddress, Type serviceType)
+ {
+ _uriTemplateTable = new UriTemplateTable(baseAddress);
+
+ foreach (var method in serviceType.GetMethods())
+ {
+ var webGet = method.GetCustomAttribute();
+ var webInvoke = method.GetCustomAttribute();
+
+ if (webGet != null)
+ {
+ _uriTemplateTable.KeyValuePairs.Add(new KeyValuePair(
+ new UriTemplate(webGet.UriTemplate), method.Name));
+ }
+ else if (webInvoke != null)
+ {
+ _uriTemplateTable.KeyValuePairs.Add(new KeyValuePair(
+ new UriTemplate(webInvoke.UriTemplate), method.Name));
+ }
+ }
+
+ _uriTemplateTable.MakeReadOnly(false);
+ }
+
+ public string ResolveMethod(string requestUri)
+ {
+ var match = _uriTemplateTable.MatchSingle(new Uri(requestUri));
+ return match?.Data as string;
+ }
+ }
+
+}
diff --git a/Shared/AppSender/AppRequestSender.cs b/Shared/AppSender/AppRequestSender.cs
index c89969c39..97f68cba0 100644
--- a/Shared/AppSender/AppRequestSender.cs
+++ b/Shared/AppSender/AppRequestSender.cs
@@ -38,13 +38,14 @@ namespace BS.Shared.AppSender
}
}
- public static Res Send(Req request, string url, string tenant) where Req : AppRequestDC where Res : AppResponseDC
+ public static Res Send(Req request, string url, string tenant = null) where Req : AppRequestDC where Res : AppResponseDC
{
- request.Tenant = tenant;
+ if (tenant != null)
+ request.Tenant = tenant;
var data = JsonConvert.SerializeObject(request);
- var response_app8_str = Send(url, data, tenant);
+ var response_app8_str = Send(url, data, request.Tenant);
if (string.IsNullOrEmpty(response_app8_str))
return null;
@@ -101,7 +102,7 @@ namespace BS.Shared.AppSender
response = await client.UploadStringTaskAsync(url, "POST", dataString);
}
-
+
return response;
}
}
diff --git a/Shared/Attributes/RequireNoTenantAttribute.cs b/Shared/Attributes/RequireNoTenantAttribute.cs
new file mode 100644
index 000000000..ec3a1be3f
--- /dev/null
+++ b/Shared/Attributes/RequireNoTenantAttribute.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.Attributes
+{
+ [AttributeUsage(AttributeTargets.Method, Inherited = true)]
+ public class RequireNoTenantAttribute : Attribute
+ {
+ public RequireNoTenantAttribute()
+ {
+
+ }
+ }
+}
diff --git a/Shared/Attributes/RequirePermissionAttribute.cs b/Shared/Attributes/RequirePermissionAttribute.cs
new file mode 100644
index 000000000..bf8407079
--- /dev/null
+++ b/Shared/Attributes/RequirePermissionAttribute.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.Attributes
+{
+ [AttributeUsage(AttributeTargets.Method, Inherited = true)]
+ public class RequirePermissionAttribute : Attribute
+ {
+ public UserRightType[] Permissions { get; }
+
+ public RequirePermissionAttribute(params UserRightType[] permissions)
+ {
+ Permissions = permissions;
+ }
+
+ public bool HasPermission(IEnumerable rights)
+ {
+ if (Permissions is null || Permissions.Length == 0)
+ return true;
+
+ foreach (var right in rights)
+ {
+ if (HasPermission(right))
+ return true;
+ }
+
+ return false;
+ }
+
+ public bool HasPermission(UserRightType right)
+ {
+ if (Permissions is null || Permissions.Length == 0)
+ return true;
+
+ for (var i = 0; i < Permissions.Length; i++)
+ {
+ var permission = Permissions[i];
+ if (right == permission) return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index bf6664b1c..d5434be8a 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -1317,4 +1317,10 @@ namespace BS.Shared
EmployeeMonthlySignature,
BargeldkasseneinzahlungsSignature
}
+
+ public enum GkvRawDataType
+ {
+ Auftragsdatei,
+ Nutzdatendatei
+ }
}
\ No newline at end of file
diff --git a/Shared/Core/Utils.cs b/Shared/Core/Utils.cs
index e3ce8f05d..90508005e 100644
--- a/Shared/Core/Utils.cs
+++ b/Shared/Core/Utils.cs
@@ -1160,6 +1160,11 @@ namespace BS.Shared.Core
return age;
}
+
+ public static bool TryParseISO8601(string iso8601String, out DateTime date)
+ {
+ return DateTime.TryParse(iso8601String, out date);
+ }
}
public struct NullCompareResult
diff --git a/Shared/DataContracts/AdminService/AdminServiceSumReqDC.cs b/Shared/DataContracts/AdminService/AdminServiceSumReqDC.cs
new file mode 100644
index 000000000..160e5d15a
--- /dev/null
+++ b/Shared/DataContracts/AdminService/AdminServiceSumReqDC.cs
@@ -0,0 +1,20 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.DataContracts.AdminService
+{
+ [DataContract]
+ public class AdminServiceSumReqDC : IAdminServiceDC
+ {
+ [DataMember(Name = "end", IsRequired = true)]
+ public string End { get; set; }
+
+ [DataMember(Name = "start", IsRequired = true)]
+ public string Start { get; set; }
+ }
+}
diff --git a/Shared/DataContracts/AdminService/IAdminServiceDC.cs b/Shared/DataContracts/AdminService/IAdminServiceDC.cs
new file mode 100644
index 000000000..a67146897
--- /dev/null
+++ b/Shared/DataContracts/AdminService/IAdminServiceDC.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.DataContracts.AdminService
+{
+ public interface IAdminServiceDC : IDataContract
+ {
+ }
+}
diff --git a/Shared/DataContracts/GkvAbrechnung/GkvClientSumResponseJson.cs b/Shared/DataContracts/GkvAbrechnung/GkvClientSumResponseJson.cs
index 84b69f2c5..57c9164a7 100644
--- a/Shared/DataContracts/GkvAbrechnung/GkvClientSumResponseJson.cs
+++ b/Shared/DataContracts/GkvAbrechnung/GkvClientSumResponseJson.cs
@@ -16,7 +16,7 @@ namespace BS.Shared.DataContracts.GkvAbrechnung
}
- [JsonProperty("gkvinvoices")]
- [DataMember] public CompactGkvAbrechnungDC[] CompactGkvAbrechnungen { get; set; }
+ [JsonProperty("sum")]
+ [DataMember] public decimal Sum { get; set; }
}
}
diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj
index d4f1b8aea..4bff5217a 100644
--- a/Shared/Shared.csproj
+++ b/Shared/Shared.csproj
@@ -133,6 +133,8 @@
+
+
@@ -168,6 +170,8 @@
+
+
@@ -539,6 +543,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/MainWindow.xaml.cs b/Tools/KTDReaderGUI/KTDReaderGUI/MainWindow.xaml.cs
new file mode 100644
index 000000000..ee35d0378
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/MainWindow.xaml.cs
@@ -0,0 +1,95 @@
+using Dakota.Logic;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace KTDReaderGUI
+{
+ ///
+ /// Interaktionslogik für MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private string KostentragerdateiFolderPath { get; set; } = ConfigurationManager.AppSettings.Get("GkvKostentragerdateiFolderPath");
+
+ private DakotaKTDReader Reader;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+
+ try
+ {
+ load();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ }
+
+ private void load()
+ {
+ var path = KostentragerdateiFolderPath;
+
+ if (string.IsNullOrEmpty(path))
+ {
+ var root = Directory.GetCurrentDirectory();
+
+ path = System.IO.Path.Combine(root, "KTDatei");
+ }
+
+ input_file.Text = path;
+
+ Reader = new DakotaKTDReader(path);
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ calc();
+ }
+ catch(Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ }
+
+ private void calc()
+ {
+ var ikkrankenkasse = input_krankenkasse.Text;
+ var leistungsgruppe = input_leistungsgruppe.Text;
+
+ if (ikkrankenkasse.Length != 9 || leistungsgruppe.Length != 7)
+ return;
+
+ var rtn = Reader.Resolve(ikkrankenkasse, leistungsgruppe.Substring(0, 2), leistungsgruppe.Substring(2, 5));
+
+ if (rtn is null)
+ {
+ MessageBox.Show("Eingabe konnte nicht gefunden werden.");
+ }
+ else
+ {
+ out_ikkrankenkasse.Text = rtn.Item3;
+ out_ikkostentrager.Text = rtn.Item2;
+ out_ikdatenannahmestelle.Text = rtn.Item1;
+ out_bezdatenannahmestelle.Text = rtn.Item4;
+ }
+ }
+ }
+}
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/Properties/AssemblyInfo.cs b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..72e84f1f9
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die einer Assembly zugeordnet sind.
+[assembly: AssemblyTitle("KTDReaderGUI")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("KTDReaderGUI")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
+// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
+// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
+[assembly: ComVisible(false)]
+
+//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie
+//ImCodeVerwendeteKultur in der .csproj-Datei
+//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch
+//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung
+//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile,
+//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher
+ //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird,
+ // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.)
+ ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs
+ //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird,
+ // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.)
+)]
+
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+// indem Sie "*" wie unten gezeigt eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.Designer.cs b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.Designer.cs
new file mode 100644
index 000000000..deaffeb71
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.Designer.cs
@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+//
+// Dieser Code wurde von einem Tool generiert.
+// Laufzeitversion: 4.0.30319.42000
+//
+// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
+// der Code erneut generiert wird.
+//
+//------------------------------------------------------------------------------
+
+
+namespace KTDReaderGUI.Properties
+{
+ ///
+ /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
+ ///
+ // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
+ // über ein Tool wie ResGen oder Visual Studio automatisch generiert.
+ // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
+ // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KTDReaderGUI.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
+ /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.resx b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.resx
new file mode 100644
index 000000000..af7dbebba
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.Designer.cs b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.Designer.cs
new file mode 100644
index 000000000..96afb62b1
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.Designer.cs
@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+namespace KTDReaderGUI.Properties
+{
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.settings b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.settings
new file mode 100644
index 000000000..033d7a5e9
--- /dev/null
+++ b/Tools/KTDReaderGUI/KTDReaderGUI/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file