diff --git a/.gitignore b/.gitignore
index f0936d6a1..3e6e010ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -626,9 +626,13 @@ obj
/DakotaSender/obj
/DakotaUnitTest/bin
/DakotaUnitTest/obj
+/WohneinheitUnitTest/bin
+/WohneinheitUnitTest/obj
/BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Debug
/BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Release
/ReportImp/TestLWV
+
+/TranslationUnitTest/bin
/ReportImp/demo_Sozio/Invoicing/CustomInvoiceFactory.cs
/ReportImp/demo_Sozio/Invoicing/SoziotherapieInvoiceCreation.cs
/ReportImp/demo_Sozio/LeistungsnachweisSoziotherapie.cs
diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 55268c179..b48e52c0f 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -269,6 +269,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -319,6 +323,62 @@
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
+
MSBuild:Compile
Designer
@@ -836,12 +896,15 @@
+
+
+
@@ -850,12 +913,16 @@
+
+
+
+
@@ -868,6 +935,7 @@
+
EnterTenantDialog.xaml
@@ -1039,6 +1107,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1141,6 +1225,48 @@
+
+ CustomerVermittlungArbeitControl.xaml
+
+
+ CustomerWohnhilfeControl.xaml
+
+
+ CustomerVermittlungArbeitView.xaml
+
+
+ CustomerWohnhilfeView.xaml
+
+
+ WohneinheitBelegungEditPopup.xaml
+
+
+ WohneinheitBelegungSchedulerView.xaml
+
+
+ WohneinheitBelegungTableView.xaml
+
+
+ WohneinheitEditPopup.xaml
+
+
+ CustomerFalldatenView.xaml
+
+
+ WohneinheitBelegungEditControl.xaml
+
+
+ WohneinheitBelegungWindow.xaml
+
+
+ WohneinheitGrundrissModalPopup.xaml
+
+
+ WohneinheitVerwaltungViewV1.xaml
+
+
+ WohneinheitVerwaltungViewV2.xaml
+
HilfeplanImportView.xaml
@@ -3213,6 +3339,7 @@
+
diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml
index b3f8d1735..918ea6043 100644
--- a/BeWo/BeWoApp.xaml
+++ b/BeWo/BeWoApp.xaml
@@ -47,6 +47,7 @@
+
@@ -62,12 +63,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/Styles/Office2007Silver.xaml b/BeWo/Styles/Office2007Silver.xaml
index 25375866b..e072b77f6 100644
--- a/BeWo/Styles/Office2007Silver.xaml
+++ b/BeWo/Styles/Office2007Silver.xaml
@@ -1 +1,4 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/BeWo/Styles/OrangeBlack.xaml b/BeWo/Styles/OrangeBlack.xaml
index a53795b28..65dfeeecb 100644
--- a/BeWo/Styles/OrangeBlack.xaml
+++ b/BeWo/Styles/OrangeBlack.xaml
@@ -1,125 +1,126 @@
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- M 0 0 L 3.5 4 L 7 0 Z
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ M 0 0 L 3.5 4 L 7 0 Z
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
+
+
+
-
+
+
+
+
+
-
+
+
-
+
+
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/BeWo/Styles/PrototypeStyles.xaml b/BeWo/Styles/PrototypeStyles.xaml
new file mode 100644
index 000000000..c88d016bb
--- /dev/null
+++ b/BeWo/Styles/PrototypeStyles.xaml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml b/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml
index 02467eb14..f4935274e 100644
--- a/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml
+++ b/BeWo/View/Controls/BehinderungsartenSelectionControl.xaml
@@ -1,35 +1,58 @@
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml b/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml
new file mode 100644
index 000000000..b976d8a30
--- /dev/null
+++ b/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml
@@ -0,0 +1,324 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml.cs b/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml.cs
new file mode 100644
index 000000000..59c8f7784
--- /dev/null
+++ b/BeWo/View/Controls/CustomerVermittlungArbeitControl.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Controls
+{
+ ///
+ /// Interaktionslogik für CustomerVermittlungArbeitControl.xaml
+ ///
+ public partial class CustomerVermittlungArbeitControl : UserControl
+ {
+ public CustomerVermittlungArbeitControl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BeWo/View/Controls/MerkzeichenSelectionControl.xaml b/BeWo/View/Controls/MerkzeichenSelectionControl.xaml
index 7af1db528..27351dac0 100644
--- a/BeWo/View/Controls/MerkzeichenSelectionControl.xaml
+++ b/BeWo/View/Controls/MerkzeichenSelectionControl.xaml
@@ -1,35 +1,58 @@
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Controls/MonthPicker.xaml b/BeWo/View/Controls/MonthPicker.xaml
index f5485105e..f32502cae 100644
--- a/BeWo/View/Controls/MonthPicker.xaml
+++ b/BeWo/View/Controls/MonthPicker.xaml
@@ -1,11 +1,16 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml
new file mode 100644
index 000000000..304e50148
--- /dev/null
+++ b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml
@@ -0,0 +1,575 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wohnungslosenhilfe
+ Straffälligenhilfe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ zu Partner/Partnerin
+ zu eigenen minderjährigen Kindern
+ zu volljährigen Kindern, Eltern, Verwandten
+ zu Freunden/Freundinnen, Bekannten
+ zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.
+ sonstige
+
+
+
+ zu Partner/Partnerin
+ zu eigenen minderjährigen Kindern
+ zu volljährigen Kindern, Eltern, Verwandten
+ zu Freunden/Freundinnen, Bekannten
+ zu Selbsthilfeorganisationen, Nachbarn, Vereinen, Kirchengemeinden u. ä.
+ sonstige
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs
new file mode 100644
index 000000000..d26716b6a
--- /dev/null
+++ b/BeWo/View/Controls/Wohnhilfe/CustomerWohnhilfeControl.xaml.cs
@@ -0,0 +1,120 @@
+using BeWo.ViewModel;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Controls.Wohnhilfe
+{
+ ///
+ /// Interaktionslogik für CustomerWohnhilfeControl.xaml
+ ///
+ public partial class CustomerWohnhilfeControl : UserControl
+ {
+ public bool IsLarge
+ {
+ get { return (bool)GetValue(IsLargeProperty); }
+ set
+ {
+ SetValue(IsLargeProperty, value);
+ }
+ }
+
+ // Using a DependencyProperty as the backing store for IsLarge. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty IsLargeProperty =
+ DependencyProperty.Register("IsLarge", typeof(bool), typeof(CustomerWohnhilfeControl),
+ new PropertyMetadata(false, OnIsLargeChanged));
+
+ public double MinWidthGrid { get; set; }
+
+ public double ParentWidth
+ {
+ get { return (double)GetValue(ParentWidthProperty); }
+ set { SetValue(ParentWidthProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for ParentWidth. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty ParentWidthProperty =
+ DependencyProperty.Register("ParentWidth", typeof(double), typeof(CustomerWohnhilfeControl), new PropertyMetadata(0.0d));
+
+ public CustomerWohnhilfeControl()
+ {
+ InitializeComponent();
+
+ root_usercontrol.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
+
+ var size = root_usercontrol.DesiredSize;
+
+ MinWidthGrid = size.Width;
+ }
+
+ private static void OnIsLargeChanged(DependencyObject defectImageControl, DependencyPropertyChangedEventArgs eventArgs)
+ {
+ var control = defectImageControl as CustomerWohnhilfeControl;
+
+ if(control is null)
+ {
+ return;
+ }
+
+ if (control.IsLarge)
+ {
+ control.SetLarge();
+ }
+ else
+ {
+ control.SetSmall();
+ }
+ }
+
+ private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ if (e.WidthChanged)
+ {
+ var parent_width = ParentWidth;
+ if (parent_width > MinWidthGrid + 50)
+ {
+ IsLarge = true;
+ }
+ else
+ {
+ IsLarge = false;
+ }
+ }
+ }
+
+ private void SetLarge()
+ {
+ grid_secondcolumn.Width = new GridLength(2, GridUnitType.Star);
+
+ Grid.SetColumn(groupbox_2, 1);
+ Grid.SetRow(groupbox_2, 0);
+ Grid.SetColumn(groupbox_3, 0);
+ Grid.SetRow(groupbox_3, 1);
+ Grid.SetColumn(groupbox_4, 1);
+ Grid.SetRow(groupbox_4, 1);
+ }
+
+ private void SetSmall()
+ {
+ grid_secondcolumn.Width = new GridLength(0);
+
+ Grid.SetColumn(groupbox_2, 0);
+ Grid.SetRow(groupbox_2, 1);
+ Grid.SetColumn(groupbox_3, 0);
+ Grid.SetRow(groupbox_3, 2);
+ Grid.SetColumn(groupbox_4, 0);
+ Grid.SetRow(groupbox_4, 3);
+ }
+ }
+}
diff --git a/BeWo/View/Detail/AbsenceTimesView.xaml b/BeWo/View/Detail/AbsenceTimesView.xaml
index 269873f83..63d4baa5d 100644
--- a/BeWo/View/Detail/AbsenceTimesView.xaml
+++ b/BeWo/View/Detail/AbsenceTimesView.xaml
@@ -1,18 +1,19 @@
-
-
-
-
+
+
@@ -24,8 +25,14 @@
-
-
+
+
@@ -45,26 +52,85 @@
-
-
+
+
-
+
-
-
+
+
-
+
- Ganztägig
+
+ Ganztägig
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/CustomerFalldatenView.xaml.cs b/BeWo/View/Detail/CustomerFalldatenView.xaml.cs
new file mode 100644
index 000000000..11c1230c1
--- /dev/null
+++ b/BeWo/View/Detail/CustomerFalldatenView.xaml.cs
@@ -0,0 +1,85 @@
+using BeWo.ViewModel;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail
+{
+ ///
+ /// Interaktionslogik für CustomerFalldatenView.xaml
+ ///
+ public partial class CustomerFalldatenView : UserControl
+ {
+ private CustomerFalldatenVM _ViewModel;
+
+ public CustomerFalldatenVM ViewModel
+ {
+ get { return _ViewModel; }
+ set
+ {
+ _ViewModel = value;
+ DataContext = value;
+ }
+ }
+
+ public CustomerFalldatenView(CustomerFalldatenVM vM)
+ {
+ InitializeComponent();
+
+ ViewModel = vM;
+
+ combobox_bearbeitungsstatus.ItemsSource = Enum.GetValues(typeof(FalldatenBearbeitungsstatus));
+
+ foreach (var label in FindVisualChildren
+
- Position
- Position
+
- Mögliche Werte
+ Mögliche Werte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Hinzufügen
-
+ Hinzufügen
+
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Übernehmen
-
-
+ Übernehmen
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs
index 96b02fee8..4e23e8131 100644
--- a/BeWo/View/Detail/CustomerView.xaml.cs
+++ b/BeWo/View/Detail/CustomerView.xaml.cs
@@ -199,7 +199,6 @@ namespace BeWo.View.Detail
return;
}
-
var p = e.GetPosition(btnSave);
if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
{
@@ -275,6 +274,13 @@ namespace BeWo.View.Detail
}
Img.EditValueChanged += Image_EditValueChanged;
+
+#if DEBUG
+ if(DebugConfig.CurrentConfig is object && DebugConfig.CurrentConfig.DebugConfigMode == DebugConfigMode.FeatureWohnhilfe)
+ {
+ tabroot.SelectedItem = tabitem_gemeinnutzigearbeit;
+ }
+#endif
}
void Image_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
@@ -328,11 +334,17 @@ namespace BeWo.View.Detail
view.ViewModel = value.Arbeitszeiten;
view.RefreshView();
}
- } else if(tabitem_stundenplan.Content != null && tabitem_stundenplan.Content is StundenplanView stundenplanView)
+ }
+ else if(tabitem_stundenplan.Content != null && tabitem_stundenplan.Content is StundenplanView stundenplanView)
{
stundenplanView.ViewModel = value.Arbeitszeiten;
stundenplanView.RefreshView();
}
+
+ if (tabitem_falldaten.Content != null && tabitem_falldaten.Content is CustomerFalldatenView falldatenView)
+ {
+ falldatenView.ViewModel = value.CustomerFalldatenVM;
+ }
_saveInProgress = false;
@@ -1081,6 +1093,14 @@ namespace BeWo.View.Detail
}
}
+ private void tabitem_falldaten_Selected(object sender, RoutedEventArgs e)
+ {
+ if (tabitem_falldaten.Content == null)
+ {
+ tabitem_falldaten.Content = new CustomerFalldatenView(ViewModel.CustomerFalldatenVM);
+ }
+ }
+
private void tabitem_notizen_Selected(object sender, RoutedEventArgs e)
{
if (ViewModel.IsNew)
diff --git a/BeWo/View/Detail/CustomerWohnhilfeView.xaml b/BeWo/View/Detail/CustomerWohnhilfeView.xaml
new file mode 100644
index 000000000..f9174da6a
--- /dev/null
+++ b/BeWo/View/Detail/CustomerWohnhilfeView.xaml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Groß
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs b/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs
new file mode 100644
index 000000000..77350cd0d
--- /dev/null
+++ b/BeWo/View/Detail/CustomerWohnhilfeView.xaml.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail
+{
+ ///
+ /// Interaktionslogik für CustomerWohnhilfeView.xaml
+ ///
+ public partial class CustomerWohnhilfeView : UserControl
+ {
+ public bool PermissionCustomerWohnhilfeCreate { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Create);
+ public bool PermissionCustomerWohnhilfeEdit { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Edit);
+ public bool PermissionCustomerWohnhilfeDelete { get; } = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_Wohnhilfe_Delete);
+
+ public CustomerWohnhilfeView()
+ {
+ InitializeComponent();
+ }
+
+ private void Wohnhilfe_Display_Edit_Button_Click(object sender, RoutedEventArgs e)
+ {
+ popup_Wohnhilfe_Displayname_Edit.IsOpen = true;
+ }
+
+ private void popup_Wohnhilfe_Displayname_Edit_Opened(object sender, EventArgs e)
+ {
+ Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Input, new Action(Textbox_SelectAll));
+ }
+
+ private void Textbox_SelectAll()
+ {
+ txt_Wohnhilfe_Displayname_Edit.Focus();
+ txt_Wohnhilfe_Displayname_Edit.SelectAll();
+ }
+ }
+}
diff --git a/BeWo/View/Detail/MandatorView.xaml.cs b/BeWo/View/Detail/MandatorView.xaml.cs
index 267593afd..605e14faa 100644
--- a/BeWo/View/Detail/MandatorView.xaml.cs
+++ b/BeWo/View/Detail/MandatorView.xaml.cs
@@ -61,9 +61,16 @@ namespace BeWo.View.Detail
#if DEBUG
- var url2 = ServiceFacade.DoOperationsServiceSync(s => s.GetOwnChatSettingsUrl());
- HyperlinkOwnChatSettings.NavigateUri = new Uri(url2);
- GroupOwnChatSettings.Visibility = Visibility.Visible;
+ try
+ {
+ var url2 = ServiceFacade.DoOperationsServiceSync(s => s.GetOwnChatSettingsUrl());
+ HyperlinkOwnChatSettings.NavigateUri = new Uri(url2);
+ GroupOwnChatSettings.Visibility = Visibility.Visible;
+ }
+ catch(Exception e)
+ {
+
+ }
#endif
}
diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml
index 958286d2e..38a8dd400 100644
--- a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml
+++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml
@@ -1,17 +1,36 @@
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
index 1c81b6164..a0481658b 100644
--- a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
+++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
@@ -489,7 +489,6 @@ namespace BeWo.View.Detail.Report
}
}
-
linkPdfExport.NavigateUri = new Uri(url);
}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml
new file mode 100644
index 000000000..def9ae7d5
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Klient
+
+
+
+
+ Wohneinheit
+
+
+
+
+ Beginn
+
+
+ Ende
+
+
+
+
+
+ Hinzufügen
+ Abbrechen
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs
new file mode 100644
index 000000000..a1dda3700
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditControl.xaml.cs
@@ -0,0 +1,79 @@
+using BeWo.ViewModel;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.Compact;
+using DevExpress.Xpf.Scheduling;
+using DevExpress.Xpf.Scheduling.VisualData;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitBelegungControl.xaml
+ ///
+ public partial class WohneinheitBelegungEditControl : UserControl
+ {
+ public EventHandler EventHandler2 { get; set; }
+
+ public WohnheimVM ViewModel => DataContext as WohnheimVM;
+
+ public WohneinheitBelegungEditControl()
+ {
+ InitializeComponent();
+ }
+
+ private void Save_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitBelegungListVM.AddNewVMToList();
+
+ Window.GetWindow(this).Close();
+ }
+
+ private void Cancel_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitBelegungListVM.CloseNewVM();
+
+ Window.GetWindow(this).Close();
+ }
+
+ private void CustomerSelectionControl_ItemSelected(object sender, EventArgs e)
+ {
+ var customer = e.Data;
+
+ ViewModel.WohneinheitBelegungListVM.CurrentVM.Customer = customer;
+ }
+
+ private void root_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ return;
+
+ var avm = e.NewValue as AppointmentWindowViewModel;
+
+ if(avm.Appointment.SourceObject is WohneinheitBelegungVM vm)
+ {
+ groupbox_newBelegung.Header = avm.IsNewAppointment ? "Belegung erstellen" : "Belegung bearbeiten";
+ btn_save.Visibility = avm.IsNewAppointment ? Visibility.Visible : Visibility.Collapsed;
+ btn_cancel.Visibility = avm.IsNewAppointment ? Visibility.Visible : Visibility.Collapsed;
+
+ if (vm.Customer is object)
+ {
+ customer_selection_control.SelectedItem = vm.Customer;
+ //customer_selection_control.SetSelectedCustomerOid(vm.Customer.CustomerOid);
+ }
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml
new file mode 100644
index 000000000..65ad5ac7c
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Klient
+
+
+
+
+ Wohneinheit
+
+
+
+
+ Beginn
+
+
+ Ende
+
+
+
+
+
+ Hinzufügen
+ Abbrechen
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs
new file mode 100644
index 000000000..12e9f31c4
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml.cs
@@ -0,0 +1,115 @@
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.Compact;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitBelegungEditPopup.xaml
+ ///
+ public partial class WohneinheitBelegungEditPopup : Popup
+ {
+ public static readonly DependencyProperty ViewModelProperty =
+ DependencyProperty.Register("ViewModel", typeof(WohnheimVM), typeof(WohneinheitBelegungEditPopup), new PropertyMetadata(null));
+
+ public WohnheimVM ViewModel
+ {
+ get { return DataContext as WohnheimVM; }
+ set { DataContext = value; }
+ }
+
+ public bool AddMode { get; set; }
+
+ public WohneinheitBelegungEditPopup()
+ {
+ InitializeComponent();
+ }
+
+ private void Save_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitBelegungListVM.AddNewVMToList();
+
+ IsOpen = false;
+ }
+
+ private void Cancel_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitBelegungListVM.CloseNewVM();
+
+ IsOpen = false;
+ }
+
+ private void Popup_Opened(object sender, EventArgs e)
+ {
+ var listvm = ViewModel.WohneinheitBelegungListVM;
+
+ AddMode = listvm.EditVM is null;
+
+ if (AddMode)
+ {
+ btn_cancel.Visibility = Visibility.Visible;
+ btn_save.Visibility = Visibility.Visible;
+ StaysOpen = true;
+ groupbox_newBelegung.Header = "Belegung erstellen";
+
+ customer_selection_control.SelectedItem = null;
+ }
+ else
+ {
+ btn_cancel.Visibility = Visibility.Collapsed;
+ btn_save.Visibility = Visibility.Collapsed;
+ StaysOpen = false;
+ groupbox_newBelegung.Header = "Belegung bearbeiten";
+
+ if (listvm.CurrentVM.Customer is object)
+ {
+ customer_selection_control.SetSelectedCustomerOid(listvm.CurrentVM.Customer.CustomerOid);
+ }
+ }
+ }
+
+ private void CustomerSelectionControl_ItemSelected(object sender, EventArgs e)
+ {
+ var customer = e.Data;
+
+ ViewModel.WohneinheitBelegungListVM.CurrentVM.Customer = customer;
+ }
+
+ private void root_Popup_Closed(object sender, EventArgs e)
+ {
+ var vmlist = ViewModel.WohneinheitBelegungListVM;
+ var currentvm = vmlist.CurrentVM;
+
+ root_Popup.Focus();
+
+ if (currentvm is object)
+ {
+ if (AddMode)
+ {
+ vmlist.CloseNewVM();
+ }
+ else
+ {
+ vmlist.CloseEditVM();
+ }
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml
new file mode 100644
index 000000000..56ac0bad5
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs
new file mode 100644
index 000000000..e19377313
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml.cs
@@ -0,0 +1,283 @@
+using BeWo.ViewModel;
+using BS.Shared.Translation;
+using DevExpress.Mvvm;
+using DevExpress.Xpf.Bars;
+using DevExpress.Xpf.Core;
+using DevExpress.Xpf.Scheduling;
+using DevExpress.XtraScheduler.Native;
+using System;
+using System.Collections.Generic;
+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;
+using ViewBase = DevExpress.Xpf.Scheduling.ViewBase;
+
+namespace BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitBelegungSchedulerControl.xaml
+ ///
+ public partial class WohneinheitBelegungSchedulerView : UserControl
+ {
+ public WohnheimVM ViewModel => DataContext as WohnheimVM;
+
+ private Window _BelegungPopupWindow;
+
+ public WohneinheitBelegungSchedulerView()
+ {
+ InitializeComponent();
+
+ InitScheduler();
+ }
+
+ private void InitScheduler()
+ {
+ radioButtonYear.IsChecked = true;
+
+ timelineViewYear.IsActive = true;
+
+ timelineViewYear.TimeScales.Clear();
+ timelineViewYear.TimeScales.AddRange(new List() {
+ new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 }
+ });
+
+ timelineViewQuartal.TimeScales.Clear();
+ timelineViewQuartal.TimeScales.AddRange(new List() {
+ new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Quarter) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Day) { MinWidth = 0}
+ });
+
+ timelineViewMonth.TimeScales.Clear();
+ timelineViewMonth.TimeScales.AddRange(new List() {
+ new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 }
+ });
+
+ timelineView4Week.TimeScales.Clear();
+ timelineView4Week.TimeScales.AddRange(new List() {
+ new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 }
+ });
+
+ timelineViewWeek.TimeScales.Clear();
+ timelineViewWeek.TimeScales.AddRange(new List() {
+ new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 },
+ new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 }
+ });
+ }
+
+ void scheduler_ActiveViewChanged(object sender, ValueChangedEventArgs e)
+ {
+ if (e.NewValue == null) return;
+ var selectionStart = scheduler_buchungsplan.SelectedInterval.Start;
+ var dates = new List() { selectionStart.Date };
+ if (!CoerceDateNavigatorSelectedDates(dates))
+ {
+ return;
+ }
+
+ try
+ {
+ UpdateSelectionView();
+ }
+ catch (Exception)
+ {
+ UpdateSelectionView();
+ }
+
+ var min = dates.Min();
+ scheduler_buchungsplan.Start = min;
+ var intervalDuration = dates.Max().AddDays(1) - min;
+
+ var timeline = (TimelineView)e.NewValue;
+ timeline.IntervalDuration = intervalDuration;
+ timeline.ViewportStart = min;
+ timeline.Zoom = TimeSpan.MinValue;
+ timeline.Zoom = TimeSpan.MaxValue;
+
+ scheduler_buchungsplan.SelectedInterval = new DateTimeRange(selectionStart, TimeSpan.Zero);
+ }
+
+ private void UpdateSelectionView()
+ {
+ if (timelineViewWeek.IsActive)
+ {
+ dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ }
+ else if (timelineView4Week.IsActive)
+ {
+ dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ }
+ else if (timelineViewMonth.IsActive)
+ {
+ dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ }
+ else if (timelineViewQuartal.IsActive)
+ {
+ dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Month;
+ }
+ else if (timelineViewYear.IsActive)
+ {
+ dateNavigator.CalendarView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Years;
+ dateNavigator.SelectionView = DevExpress.Xpf.Editors.DateNavigator.DateNavigatorCalendarView.Years;
+ }
+ }
+
+ void dateNavigatorSettings_CustomizeSelectedDates(object sender, CustomizeSelectedDatesEventArgs e)
+ {
+ e.Handled = CoerceDateNavigatorSelectedDates(e.Dates);
+
+ if (scheduler_buchungsplan.ActiveView is TimelineView timeline)
+ {
+ var intervalDuration = e.Dates.Max().AddDays(1) - e.Dates.Min();
+
+ if (!ViewModel.IntervalChanging && timeline.IntervalDuration != intervalDuration)
+ {
+ ViewModel.IntervalChanging = true;
+
+ timeline.IntervalDuration = intervalDuration;
+ timeline.Zoom = TimeSpan.MinValue;
+ timeline.Zoom = TimeSpan.MaxValue;
+
+ ViewModel.IntervalChanging = false;
+ }
+ }
+ }
+ bool CoerceDateNavigatorSelectedDates(IList dates)
+ {
+ if (dates.Count == 0) return false;
+ var start = dates.Min();
+ var end = dates.Max();
+ if (timelineViewWeek.IsActive)
+ {
+ var actualStart = DateTimeHelper.GetStartOfWeekUI(start, scheduler_buchungsplan.FirstDayOfWeek);
+ var actualEnd = actualStart.AddDays(7);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineView4Week.IsActive)
+ {
+ var actualStart = DateTimeHelper.GetStartOfWeekUI(start, scheduler_buchungsplan.FirstDayOfWeek);
+ var actualEnd = actualStart.AddDays(28);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineViewMonth.IsActive)
+ {
+ var actualStart = new DateTime(start.Year, start.Month, 1);
+ var actualEnd = actualStart.AddMonths(1);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineViewYear.IsActive)
+ {
+ var actualStart = new DateTime(start.Year, 1, 1);
+ var actualEnd = actualStart.AddYears(1);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineViewQuartal.IsActive)
+ {
+ var actualStart = new DateTime(start.Year, start.Month, 1);
+ var actualEnd = actualStart.AddMonths(3);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private void scheduler_buchungsplan_PopupMenuShowing(object sender, DevExpress.Xpf.Scheduling.PopupMenuShowingEventArgs e)
+ {
+ var accept = new ContextMenuType[] { ContextMenuType.AppointmentContextMenu, ContextMenuType.CellContextMenu };
+
+ if (!accept.Contains(e.MenuType))
+ {
+ e.Cancel = true;
+ return;
+ }
+
+ PopupMenu menu = (PopupMenu)e.Menu;
+ foreach (var menuItem in menu.Items)
+ {
+ var barItem = menuItem as BarItem;
+
+ if (barItem is null)
+ continue;
+
+ barItem.Content = Translator.TranslateKey(barItem.Name, "???");
+ }
+ }
+
+ private void scheduler_buchungsplan_AppointmentWindowShowing(object sender, AppointmentWindowShowingEventArgs e)
+ {
+ if (_BelegungPopupWindow is object && _BelegungPopupWindow.IsVisible)
+ {
+ e.Handled = true;
+ e.Cancel = true;
+ return;
+ }
+
+ var vm = e.Appointment.SourceObject as WohneinheitBelegungVM;
+
+ bool success = vm.IsNew ? ViewModel.AddBelegung(e.Appointment.ResourceId, e.Appointment.Start.Date) : ViewModel.EditBelegung(vm);
+
+ if (success)
+ {
+ _BelegungPopupWindow = e.Window;
+
+ e.Window.DataContext = ViewModel;
+ }
+ else
+ {
+ e.Cancel = true;
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml
new file mode 100644
index 000000000..e35c8acdb
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml.cs
new file mode 100644
index 000000000..bb7ef6790
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml.cs
@@ -0,0 +1,87 @@
+using BeWo.ViewModel;
+using BS.Shared.Extensions;
+using DevExpress.Xpf.Grid;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitBelegungTableView.xaml
+ ///
+ public partial class WohneinheitBelegungTableView : UserControl
+ {
+ public WohnheimVM ViewModel => DataContext as WohnheimVM;
+
+ public WohneinheitBelegungTableView()
+ {
+ InitializeComponent();
+ }
+
+ private void Button_NewBelegung_Click(object sender, RoutedEventArgs e)
+ {
+ if (popup_newBelegung.IsOpen)
+ return;
+
+ var success = ViewModel.AddBelegung();
+
+ if (success)
+ popup_newBelegung.IsOpen = true;
+ }
+
+ private void btn_belegung_delete_Click(object sender, RoutedEventArgs e)
+ {
+ if (!ViewModel.PermissionWohneinheitBelegungDelete)
+ return;
+
+ var listvm = ViewModel.WohneinheitBelegungListVM;
+
+ if (listvm.EditVM is object)
+ return;
+
+ var vm = datagrid_belegung.GetCurrentValue();
+
+ _ = listvm.VMList.Remove(vm);
+
+ e.Handled = true;
+ }
+
+ private void datagridview2_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
+ {
+ if (popup_newBelegung.IsOpen)
+ return;
+
+ var vm = datagrid_belegung.GetCurrentValue();
+
+ var success = ViewModel.EditBelegung(vm);
+
+ if (success)
+ popup_newBelegung.IsOpen = true;
+ }
+
+ private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue is WohnheimVM vm)
+ {
+ vm.WohneinheitBelegungListVM.PropertyChanged -= (s, args) => datagridview2.BestFitColumns();
+ }
+
+ if (e.NewValue is WohnheimVM vm2)
+ {
+ vm2.WohneinheitBelegungListVM.PropertyChanged += (s, args) => datagridview2.BestFitColumns();
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml
new file mode 100644
index 000000000..1bf24546c
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml.cs
new file mode 100644
index 000000000..2ac98576d
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungWindow.xaml.cs
@@ -0,0 +1,28 @@
+using DevExpress.Xpf.Core;
+using System;
+using System.Collections.Generic;
+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.Shapes;
+
+namespace BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitBelegungWindow.xaml
+ ///
+ public partial class WohneinheitBelegungWindow : ThemedWindow
+ {
+ public WohneinheitBelegungWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml
new file mode 100644
index 000000000..7de41f971
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wohnungsname
+
+
+ Zimmername
+
+
+ Baujahr
+
+
+
+
+
+ Fläche
+
+
+ Kaution
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Miete
+
+
+ Heizung
+
+
+ Strom
+
+
+ Betriebskosten
+
+
+ Sonstige Kosten
+
+
+ Brutto
+
+
+
+
+
+
+
+
+
+ Hinzufügen
+ Abbrechen
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs
new file mode 100644
index 000000000..0278fffda
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml.cs
@@ -0,0 +1,141 @@
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared.Extensions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitEditControl.xaml
+ ///
+ public partial class WohneinheitEditPopup : Popup
+ {
+ public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(
+ "ViewModel", typeof(WohnheimVM),
+ typeof(WohneinheitEditPopup),
+ new PropertyMetadata(null)
+ );
+
+ public WohnheimVM ViewModel
+ {
+ get => (WohnheimVM)GetValue(ViewModelProperty);
+ set => SetValue(ViewModelProperty, value);
+ }
+
+ public bool AddMode { get; set; }
+
+ public WohneinheitEditPopup()
+ {
+ InitializeComponent();
+ }
+
+ private void Save_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitListVM.AddNewVMToList();
+
+ IsOpen = false;
+ }
+
+ private void Cancel_Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitListVM.ResetNewVM();
+
+ IsOpen = false;
+ }
+
+ private void Popup_Opened(object sender, EventArgs e)
+ {
+ var vmlist = ViewModel.WohneinheitListVM;
+
+ AddMode = vmlist.EditVM is null;
+
+ if (AddMode)
+ {
+ btn_cancel.Visibility = Visibility.Visible;
+ btn_save.Visibility = Visibility.Visible;
+ StaysOpen = true;
+ groupbox_newWohneinheit.Header = "Wohneinheit erstellen";
+ }
+ else
+ {
+ btn_cancel.Visibility = Visibility.Collapsed;
+ btn_save.Visibility = Visibility.Collapsed;
+ StaysOpen = false;
+ groupbox_newWohneinheit.Header = "Wohneinheit bearbeiten";
+
+ var current = vmlist.CurrentVM;
+ if (!string.IsNullOrEmpty(current.Wohnname) && combobox_wohnungsname.Items.Contains(current.Wohnname))
+ {
+ combobox_wohnungsname.SelectedItem = current.Wohnname;
+ }
+ else
+ {
+ combobox_wohnungsname.SelectedItem = null;
+ }
+ }
+ }
+
+ private void Popup_Closed(object sender, EventArgs e)
+ {
+ var vmlist = ViewModel.WohneinheitListVM;
+ var currentvm = vmlist.CurrentVM;
+
+ if (currentvm is object)
+ {
+ if (AddMode)
+ {
+ vmlist.CurrentVM = null;
+ vmlist.NewVM = null;
+ }
+ else
+ {
+ vmlist.CloseEditVM();
+ }
+ }
+ }
+
+ private void SetValuesFromParent(WohneinheitVM vm, WohneinheitVM parent_vm)
+ {
+ if (vm is null || parent_vm is null)
+ return;
+
+ if (vm.Stock.IsNullOrEmpty() && parent_vm.Stock.IsNotNullOrEmpty())
+ {
+ vm.Stock = parent_vm.Stock;
+ }
+
+ if (!vm.Baujahr.HasValue && parent_vm.Baujahr.HasValue)
+ {
+ vm.Baujahr = parent_vm.Baujahr;
+ }
+ }
+
+ private void combobox_wohnungsname_DropDownClosed(object sender, EventArgs e)
+ {
+ var vm = ViewModel.WohneinheitListVM.CurrentVM;
+
+ if (vm is null)
+ return;
+
+ var selected_item = combobox_wohnungsname.SelectedItem as string;
+
+ var selected_vm = ViewModel.WohneinheitListVM.VMList.FirstOrDefault(x => x.Wohnname == selected_item);
+
+ SetValuesFromParent(vm, selected_vm);
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml
new file mode 100644
index 000000000..94381ecfb
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs
new file mode 100644
index 000000000..5fb24859d
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs
@@ -0,0 +1,99 @@
+using BeWo.Core;
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared.DataContracts;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitGrundrissControl.xaml
+ ///
+ public partial class WohneinheitGrundrissModalPopup : BeWoView
+ {
+ public ImageListVM Images { get; set; }
+
+ public WohneinheitGrundrissModalPopup(ImageListVM images)
+ {
+ InitializeComponent();
+
+ this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close,
+ (s, e) =>
+ {
+ BeWoApp.MainControl.CloseCurrentPopUp();
+ }));
+
+ Images = images;
+
+ DataContext = Images.VMList;
+ }
+
+ private void MenuItem_Add_Click(object sender, RoutedEventArgs e)
+ {
+ var dialog = new Microsoft.Win32.OpenFileDialog();
+ dialog.Title = "Wähle einen Grundriss aus";
+ dialog.Filter = "ALL supported Graphics| *.jpeg; *.jpg;*.png;";
+
+ // Show open file dialog box
+ bool? result = dialog.ShowDialog();
+
+ if (result != true)
+ return;
+
+ var info = new FileInfo(dialog.FileName);
+
+ if (!info.Exists)
+ return;
+
+ var vm = new ImageVM();
+
+ vm.Filename = info.Name;
+ vm.Fullname = info.FullName;
+ vm.Original = File.ReadAllBytes(info.FullName);
+
+ Images.VMList.Add(vm);
+ }
+
+ private void MenuItem_Del_Click(object sender, RoutedEventArgs e)
+ {
+ var t = PhotosListBox.SelectedItem as ImageVM;
+
+ if (t is null)
+ return;
+
+ Images.VMList.Remove(t);
+ }
+
+ private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ var stackpanel = sender as StackPanel;
+
+ var image = stackpanel?.Children?[0] as Image;
+
+ var image_source = image?.Source;
+
+ if (image_source is object)
+ {
+ if(e.ClickCount >= 2)
+ {
+ BeWoUtils.ShowImageForm(image_source);
+ }
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml
new file mode 100644
index 000000000..89cf58dfe
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml.cs
new file mode 100644
index 000000000..508243d5e
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV1.xaml.cs
@@ -0,0 +1,103 @@
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared.Extensions;
+using DevExpress.Xpf.Grid;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitVerwaltungControlV1.xaml
+ ///
+ public partial class WohneinheitVerwaltungViewV1 : UserControl
+ {
+ public WohnheimVM ViewModel => DataContext as WohnheimVM;
+
+ public WohneinheitVerwaltungViewV1()
+ {
+ InitializeComponent();
+ }
+
+ private void Button_NewWohneinheit_Click(object sender, RoutedEventArgs e)
+ {
+ if (popup_newWohneinheit.IsOpen)
+ return;
+
+ var success = ViewModel.AddWohneinheit();
+
+ if (success)
+ popup_newWohneinheit.IsOpen = true;
+ }
+
+ private void datagridview_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
+ {
+ if (popup_newWohneinheit.IsOpen)
+ return;
+
+ var vm = datagrid_wohneinheiten.GetCurrentValue();
+
+ var success = ViewModel.EditWohneinheit(vm);
+
+ if (success)
+ popup_newWohneinheit.IsOpen = true;
+ }
+
+ private void btn_delete_Click(object sender, RoutedEventArgs e)
+ {
+ if (!ViewModel.PermissionWohneinheitDelete)
+ return;
+
+ if (ViewModel.WohneinheitListVM.EditVM is object)
+ return;
+
+ var vm = datagrid_wohneinheiten.GetCurrentValue();
+
+ ViewModel.WohneinheitListVM.AskRemoveVM(vm);
+
+ e.Handled = true;
+ }
+
+ private void btn_gallery_Click(object sender, RoutedEventArgs e)
+ {
+ if (!ViewModel.PermissionWohneinheitGallery)
+ return;
+
+ if (BeWoApp.MainControl.IsModalPopupOpen)
+ return;
+
+ var vm = datagrid_wohneinheiten.GetCurrentValue();
+
+ var control = new WohneinheitGrundrissModalPopup(vm.ImageListVM);
+
+ BeWoApp.MainControl.ShowControlAsModalPopup(control);
+
+ e.Handled = true;
+ }
+
+ private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if(e.OldValue is WohnheimVM vm)
+ {
+ vm.WohneinheitListVM.PropertyChanged -= (s, args) => datagridview.BestFitColumns();
+ }
+
+ if (e.NewValue is WohnheimVM vm2)
+ {
+ vm2.WohneinheitListVM.PropertyChanged += (s, args) => datagridview.BestFitColumns();
+ }
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
new file mode 100644
index 000000000..2107c4fef
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wohnungsname
+
+
+ Zimmername
+
+
+ Baujahr
+
+
+
+
+
+ Fläche
+
+
+ Kaution
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Miete
+
+
+ Heizung
+
+
+ Strom
+
+
+ Betriebskosten
+
+
+ Sonstige Kosten
+
+
+ Brutto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml.cs
new file mode 100644
index 000000000..53001612c
--- /dev/null
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml.cs
@@ -0,0 +1,72 @@
+using BeWo.ViewModel;
+using BS.Shared.Extensions;
+using System;
+using System.Collections.Generic;
+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 BeWo.View.Detail.Wohneinheit
+{
+ ///
+ /// Interaktionslogik für WohneinheitVerwaltungControl.xaml
+ ///
+ public partial class WohneinheitVerwaltungViewV2 : UserControl
+ {
+ public WohnheimVM ViewModel => DataContext as WohnheimVM;
+
+ public WohneinheitVerwaltungViewV2()
+ {
+ InitializeComponent();
+ }
+
+ private void SetValuesFromParent(WohneinheitVM vm, WohneinheitVM parent_vm)
+ {
+ if (vm is null || parent_vm is null)
+ return;
+
+ if (vm.Stock.IsNullOrEmpty() && parent_vm.Stock.IsNotNullOrEmpty())
+ {
+ vm.Stock = parent_vm.Stock;
+ }
+
+ if (!vm.Baujahr.HasValue && parent_vm.Baujahr.HasValue)
+ {
+ vm.Baujahr = parent_vm.Baujahr;
+ }
+ }
+
+ private void combobox_wohnungsname_DropDownClosed(object sender, EventArgs e)
+ {
+ var vm = ViewModel.WohneinheitListVM.CurrentVM;
+
+ if (vm is null)
+ return;
+
+ var selected_item = combobox_wohnungsname.SelectedItem as string;
+
+ var selected_vm = ViewModel.WohneinheitListVM.VMList.FirstOrDefault(x => x.Wohnname == selected_item);
+
+ SetValuesFromParent(vm, selected_vm);
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitListVM.AddNewVMToList(true);
+ }
+
+ private void Button_Click_1(object sender, RoutedEventArgs e)
+ {
+ ViewModel.WohneinheitListVM.AskRemoveEditVM();
+ }
+ }
+}
diff --git a/BeWo/View/Detail/WohnheimView.xaml b/BeWo/View/Detail/WohnheimView.xaml
index 95df978ff..6d8f1944a 100644
--- a/BeWo/View/Detail/WohnheimView.xaml
+++ b/BeWo/View/Detail/WohnheimView.xaml
@@ -1,15 +1,31 @@
+ VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus" >
@@ -35,7 +51,7 @@
-
+
@@ -101,7 +117,7 @@
-
+
@@ -110,14 +126,14 @@
-
+
-
+
@@ -130,7 +146,7 @@
-
+
@@ -141,7 +157,7 @@
-
+
@@ -154,7 +170,7 @@
-
+
-
+
@@ -199,13 +215,13 @@
-
+
-
+
@@ -297,7 +313,7 @@
-
+
@@ -308,6 +324,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/WohnheimView.xaml.cs b/BeWo/View/Detail/WohnheimView.xaml.cs
index 28cde476c..f55a34b87 100644
--- a/BeWo/View/Detail/WohnheimView.xaml.cs
+++ b/BeWo/View/Detail/WohnheimView.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.ServiceModel;
using System.Text.RegularExpressions;
using System.Windows;
@@ -10,58 +11,65 @@ using BeWo.Core;
using BeWo.Core.Service;
using BeWo.ServiceProxy;
using BeWo.Validation;
+using BeWo.View.Detail.Wohneinheit;
using BeWo.ViewModel;
-
+using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Translation;
+using DevExpress.Mvvm;
+using DevExpress.Xpf.Bars;
+using DevExpress.Xpf.Core;
using DevExpress.Xpf.Editors;
using DevExpress.Xpf.Grid;
-
+using DevExpress.Xpf.Scheduling;
+using DevExpress.XtraGrid.Views.Grid;
+using DevExpress.XtraScheduler.Native;
namespace BeWo.View.Detail
{
- public partial class WohnheimView : BeWoView
- {
- private WohnheimVM _ViewModel;
+ public partial class WohnheimView : BeWoView
+ {
+ private WohnheimVM _ViewModel;
+ private List _Customers;
- private bool initTabIndex;
+ private bool initTabIndex;
private List regelmaessigeDiensteVonMitarbeiternLoeschen;
private CompactTeamDC gewaehltesTeam;
- public WohnheimView(WohnheimVM pWohnheimDC)
- {
- InitializeComponent();
- ViewModel = pWohnheimDC;
+ private int _WohneinheitTabitemIndex;
+
+ public WohnheimView(WohnheimVM vm)
+ {
+ SchedulerControl.AllowInfiniteSize = true;
+
+ ViewModel = vm;
+
+ _Customers = vm.Customers;
+
+ InitializeComponent();
+
regelmaessigeDiensteVonMitarbeiternLoeschen = new List();
-
- // HACK: Force the devexpress grid to end editing when the mouse is over savebutton
- // by setting the focus to another element.
- MouseMove += (s, e) =>
- {
- if ((grid_EmployeeRelation == null || !grid_EmployeeRelation.IsVisible) &&
- (grid_CustomerRelation == null || !grid_CustomerRelation.IsVisible))
- {
- return;
- }
-
- var p = e.GetPosition(btnSave);
-
- if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
- {
- root.Focus();
- }
- };
-
- //ich glaub es ist alles gesagt
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Wohnheim_AllowArchiving))
+ // HACK: Force the devexpress grid to end editing when the mouse is over savebutton
+ // by setting the focus to another element.
+ MouseMove += (s, e) =>
{
- lblArchiviert.Visibility = Visibility.Hidden;
- chkArchiviert.Visibility = Visibility.Hidden;
- }
+ if ((grid_EmployeeRelation == null || !grid_EmployeeRelation.IsVisible) &&
+ (grid_CustomerRelation == null || !grid_CustomerRelation.IsVisible))
+ {
+ return;
+ }
+
+ var p = e.GetPosition(btnSave);
+
+ if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
+ {
+ root.Focus();
+ }
+ };
var b = Convert.ToBoolean(ViewModel.PflichtbesetzungEinblenden);
if (!b)
@@ -80,8 +88,12 @@ namespace BeWo.View.Detail
combobox_Sortierungsarten.ItemsSource = sortierungsartenFuerCombobox;
if (combobox_Sortierungsarten.SelectedIndex == -1)
combobox_Sortierungsarten.SelectedIndex = 0;
+
+ //popup_newBelegung.Wohneinheiten = ViewModel.WohneinheitListVM.VMList;
+
+ InitUserRights();
}
-
+
private void UserControl_GotFocus(object sender, RoutedEventArgs e)
{
if (e.OriginalSource.Equals(this))
@@ -90,59 +102,61 @@ namespace BeWo.View.Detail
}
}
- public override bool IsDirty
- {
- get { return ViewModel != null && ViewModel.IsDirty; }
- }
+ public override bool IsDirty
+ {
+ get { return ViewModel != null && ViewModel.IsDirty; }
+ }
- public override string Title
- {
- get { return Translator.Translate("Wohnprojekt"); }
- }
+ public override string Title
+ {
+ get { return Translator.Translate("Wohnprojekt"); }
+ }
- internal override DependencyObject ValidationOnSaveRootElement
- {
- get { return grid_details; }
- }
+ internal override DependencyObject ValidationOnSaveRootElement
+ {
+ get { return grid_details; }
+ }
- internal WohnheimVM ViewModel
- {
- get { return _ViewModel; }
+ internal WohnheimVM ViewModel
+ {
+ get { return _ViewModel; }
- set
- {
+ set
+ {
_ViewModel = value;
DataContext = value;
- }
- }
+ }
+ }
- protected override UserRightType[] GetSaveDemands()
- {
- return ViewModel.IsNew ? new[] {UserRightType.CreateAll, UserRightType.WohnheimView_Create} : new[] {UserRightType.EditAll, UserRightType.WohnheimView_Edit};
- }
+ protected override UserRightType[] GetSaveDemands()
+ {
+ return ViewModel.IsNew ? new[] { UserRightType.CreateAll, UserRightType.WohnheimView_Create } : new[] { UserRightType.EditAll, UserRightType.WohnheimView_Edit };
+ }
- protected override void Save()
- {
- var lDataContract = ViewModel.CommitToDataContract();
+ protected override void Save()
+ {
+ var lDataContract = ViewModel.CommitToDataContract();
//Abfrage if Name is null or empty -> Message Bitte den Namen eingeben
- if(textbox_first.Text.Equals("")){
- textbox_first.Focus();
+ if (textbox_first.Text.Equals(""))
+ {
+ textbox_first.Focus();
MessageBox.Show("Bitte dem Wohnprojekt einen Namen geben.");
}
- else{
- //sonst
- try
- {
- if (ViewModel.IsNew)
- {
- IsDoneWithInsertOrUpdate = false;
+ else
+ {
+ //sonst
+ try
+ {
+ if (ViewModel.IsNew)
+ {
+ IsDoneWithInsertOrUpdate = false;
ServiceFacade.DoCustomerServiceAsync(s => s.InsertNewWohnheim(lDataContract), ReloadViewModel);
- }
- else
- {
- IsDoneWithInsertOrUpdate = false;
+ }
+ else
+ {
+ IsDoneWithInsertOrUpdate = false;
ServiceFacade.DoCustomerServiceAsync(s => s.UpdateWohnheim(lDataContract, regelmaessigeDiensteVonMitarbeiternLoeschen), ReloadViewModel);
}
//if (regelmaessigeDiensteVonMitarbeiternLoeschen.Count > 0 && ViewModel.DataContract.WohnheimOid != null)
@@ -150,41 +164,54 @@ namespace BeWo.View.Detail
// ServiceFacade.DoOperationsServiceSync(s => s.DeleteRegelmaessigeDiensteOfRemovedEmployee(regelmaessigeDiensteVonMitarbeiternLoeschen, (long)ViewModel.DataContract.WohnheimOid));
//}
- Cache.GetInstance().ClearEmployees();
- BeWoApp.MainControl.ResetView(UIContext.Wohnheim);
- }
- catch (FaultException)
- {
- MessageBox.Show(
- "Dieser Datensatz wurde in der Zwischenzeit von " + Translator.Translate("einem anderen Benutzer") + " geändert. Klicken Sie Ok um den Datensatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
- ReloadViewModel(lDataContract.WohnheimOid.Value);
- }
+ Cache.GetInstance().ClearEmployees();
+ BeWoApp.MainControl.ResetView(UIContext.Wohnheim);
+ }
+ catch (FaultException)
+ {
+ MessageBox.Show(
+ "Dieser Datensatz wurde in der Zwischenzeit von " + Translator.Translate("einem anderen Benutzer") + " geändert. Klicken Sie Ok um den Datensatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
+ ReloadViewModel(lDataContract.WohnheimOid.Value);
+ }
}
- }
+ }
- private void ReloadViewModel(long pOid)
- {
- VMFactory.CreateWohnheimVMAsync(pOid, cb => this.Dispatch(delegate { ViewModel = cb; }));
-
- IsDoneWithInsertOrUpdate = true;
- }
+ private void InitUserRights()
+ {
+ //ich glaub es ist alles gesagt
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Wohnheim_AllowArchiving))
+ {
+ lblArchiviert.Visibility = Visibility.Hidden;
+ chkArchiviert.Visibility = Visibility.Hidden;
+ }
+ else
+ {
+ lblArchiviert.Visibility = Visibility.Visible;
+ chkArchiviert.Visibility = Visibility.Visible;
+ }
+ }
+
+ private void ReloadViewModel(long pOid)
+ {
+ VMFactory.CreateWohnheimVMAsync(pOid, _Customers, cb => this.Dispatch(delegate { ViewModel = cb; })); ;
- private void button_addMitarbeiterRelation_Klick(object sender, RoutedEventArgs e)
- {
+ IsDoneWithInsertOrUpdate = true;
+ }
+
+ private void button_addMitarbeiterRelation_Klick(object sender, RoutedEventArgs e)
+ {
popup_newEmployeeRel.IsOpen = true;
- }
-
+ }
private void button_addKlientRelation_Klick(object sender, RoutedEventArgs e)
{
popup_newKlientRel.IsOpen = true;
}
-
private void button_addEmployeeRelation_Click(object sender, RoutedEventArgs e)
{
if (ValidationTrigger.Validate(groupbox_newEmployeeRel))
{
-
+
bool contains = false;
foreach (var item in ViewModel.WohnheimEmployeeRelations.VMList)
{
@@ -225,7 +252,7 @@ namespace BeWo.View.Detail
continue;
ViewModel.WohnheimEmployeeRelations.NewVM.Employee = emp;
- ViewModel.WohnheimEmployeeRelations.NewVM.Notice= notice;
+ ViewModel.WohnheimEmployeeRelations.NewVM.Notice = notice;
ViewModel.WohnheimEmployeeRelations.AddNewVMToList();
}
@@ -235,7 +262,6 @@ namespace BeWo.View.Detail
{
popup_newTeamRel.IsOpen = true;
}
-
private void button_cancelEmployeeRelation_Click(object sender, RoutedEventArgs e)
{
popup_newEmployeeRel.IsOpen = false;
@@ -252,13 +278,11 @@ namespace BeWo.View.Detail
ViewModel.WohnheimEmployeeRelations.NewVM.Employee = e.Data;
popup_employee.Focus();
}
-
private void popupedit_EmployeeRelations_PopUpClick(object sender, RoutedEventArgs e)
{
employeesearchview.ItemSelected += Employeesearchview_EnvironmentEmployeeSelected;
popup_employee.IsOpen = true;
}
-
private void Teamsearchview_EnvironmentTeamSelected(object sender, EventArgs e)
{
popup_team.IsOpen = false;
@@ -275,7 +299,6 @@ namespace BeWo.View.Detail
teamsearchview.ItemSelected += Teamsearchview_EnvironmentTeamSelected;
popup_team.IsOpen = true;
}
-
private void Popupedit_EmployeeRelations_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
@@ -312,7 +335,6 @@ namespace BeWo.View.Detail
BeWoWpfUtils.RefreshDXGrid(grid_EmployeeRelation);
}
-
private void button_addKlientRelation_Click(object sender, RoutedEventArgs e)
{
bool contains = false;
@@ -330,12 +352,10 @@ namespace BeWo.View.Detail
popup_newKlientRel.IsOpen = false;
ViewModel.WohnheimCustomerRelations.AddNewVMToList();
}
-
private void button_cancelKlientRelation_Click(object sender, RoutedEventArgs e)
{
popup_newKlientRel.IsOpen = false;
}
-
private void Klientsearchview_EnvironmentKlientSelected(object sender, EventArgs e)
{
popup_klient.IsOpen = false;
@@ -343,29 +363,25 @@ namespace BeWo.View.Detail
ViewModel.WohnheimCustomerRelations.NewVM.Customer = e.Data;
popup_klient.Focus();
}
-
private void popupedit_KlientRelations_PopUpClick(object sender, RoutedEventArgs e)
{
klientsearchview.ItemSelected += Klientsearchview_EnvironmentKlientSelected;
popup_klient.IsOpen = true;
}
-
private void Popupedit_KlientRelations_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
- if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit) sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.WohnheimView_View))
+ if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.WohnheimView_View))
{
return;
}
CreateModalViewWindow(ViewModel.WohnheimCustomerRelations.NewVM.Customer);
}
-
public void Button_RemoveCustomerRelation_Click(object sender, RoutedEventArgs e)
{
ViewModel.WohnheimCustomerRelations.VMList.Remove(grid_CustomerRelation.GetCurrentValue());
BeWoWpfUtils.RefreshDXGrid(grid_CustomerRelation);
}
-
private void TableViewCustomer_OnRowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
var tableView = (TableView)sender;
@@ -378,11 +394,10 @@ namespace BeWo.View.Detail
CreateModalViewWindow((selectedVM).Customer);
}
-
private void TableViewEmployee_OnRowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
- var tableView = (TableView) sender;
- var selectedVM = (WohnheimEmployeeRelationVM) tableView.Grid.GetRow(e.HitInfo.RowHandle);
+ var tableView = (TableView)sender;
+ var selectedVM = (WohnheimEmployeeRelationVM)tableView.Grid.GetRow(e.HitInfo.RowHandle);
if (selectedVM == null)
{
@@ -391,7 +406,6 @@ namespace BeWo.View.Detail
CreateModalViewWindow((selectedVM).Employee);
}
-
private void CreateModalViewWindow(T pDC) where T : IDataContract
{
if (pDC == null)
@@ -401,13 +415,13 @@ namespace BeWo.View.Detail
if (pDCType == typeof(CompactEmployeeDC))
{
- VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
- cb => this.Dispatch(
- () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
- () => BeWoUtils.UpdateAllViews((pDC as CompactEmployeeDC))))));
+ VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
+ cb => this.Dispatch(
+ () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
+ () => BeWoUtils.UpdateAllViews((pDC as CompactEmployeeDC))))));
}
- if (pDCType == typeof (CompactCustomerDC))
+ if (pDCType == typeof(CompactCustomerDC))
{
VMFactory.CreateCustomerVMAsync((pDC as CompactCustomerDC).CustomerOid,
cb => this.Dispatch(
@@ -415,7 +429,6 @@ namespace BeWo.View.Detail
() => BeWoUtils.UpdateAllViews((pDC as CompactCustomerDC))))));
}
}
-
private void chkStatuszeile_Checked(object sender, RoutedEventArgs e)
{
//textedit_pflichtStart.IsEnabled = true;
@@ -430,13 +443,12 @@ namespace BeWo.View.Detail
//textedit_pflichtStart.Opacity = 50;
//textedit_pflichtEnde.Opacity = 50;
}
-
private void chkStatuszeile_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
var checkbox = sender as CheckEdit;
if ((bool)checkbox.EditValue == false)
{
- textedit_pflichtStart.IsEnabled = false;
+ textedit_pflichtStart.IsEnabled = false;
textedit_pflichtEnde.IsEnabled = false;
textedit_pflichtStart.Opacity = 50;
textedit_pflichtEnde.Opacity = 50;
@@ -449,5 +461,74 @@ namespace BeWo.View.Detail
textedit_pflichtEnde.Opacity = 100;
}
}
+
+ private void root_wohneinheit_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
+ {
+ if(e.Source != root_wohneinheit || root_wohneinheit.SelectedIndex == _WohneinheitTabitemIndex)
+ {
+ return;
+ }
+
+ bool isDirty = false;
+ if (_WohneinheitTabitemIndex == 0)
+ {
+ isDirty |= ViewModel.WohneinheitListVM.IsDirty;
+ }
+ else if (_WohneinheitTabitemIndex == 1)
+ {
+ isDirty |= ViewModel.WohneinheitListVM.IsDirty;
+ }
+ else if (_WohneinheitTabitemIndex == 2)
+ {
+ isDirty |= ViewModel.WohneinheitBelegungListVM.IsDirty;
+ }
+ else if (_WohneinheitTabitemIndex == 3)
+ {
+ isDirty |= ViewModel.WohneinheitBelegungListVM.IsDirty;
+ }
+ else
+ {
+ throw new NotImplementedException("Tabindex unbekannt");
+ }
+
+ _WohneinheitTabitemIndex = root_wohneinheit.SelectedIndex;
+
+ if (_WohneinheitTabitemIndex == 0)
+ {
+ ViewModel.WohneinheitListVM.EditVM = null;
+ }
+ else if (_WohneinheitTabitemIndex == 1)
+ {
+ ViewModel.WohneinheitListVM.EditVM = null;
+ }
+ else if (_WohneinheitTabitemIndex == 2)
+ {
+ ViewModel.WohneinheitBelegungListVM.CloseCurrentVM();
+ }
+ else if (_WohneinheitTabitemIndex == 3)
+ {
+ ViewModel.WohneinheitBelegungListVM.CloseCurrentVM();
+ }
+
+ //if (isDirty)
+ //{
+ // var result = MessageBox.Show("Sie müssen zuvor Speichern", "Hinweis", MessageBoxButton.OKCancel);
+
+ // if(result == MessageBoxResult.OK)
+ // {
+ // Save();
+ // _WohneinheitTabitemIndex = root_wohneinheit.SelectedIndex;
+ // }
+ // else
+ // {
+ // root_wohneinheit.SelectedIndex = _WohneinheitTabitemIndex;
+ // e.Handled = true;
+ // }
+ //}
+ //else
+ //{
+ // _WohneinheitTabitemIndex = root_wohneinheit.SelectedIndex;
+ //}
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Master/AdministrationView.xaml b/BeWo/View/Master/AdministrationView.xaml
index 2c16d0bf3..fd6a222b9 100644
--- a/BeWo/View/Master/AdministrationView.xaml
+++ b/BeWo/View/Master/AdministrationView.xaml
@@ -37,87 +37,92 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
diff --git a/BeWo/View/Master/AdministrationView.xaml.cs b/BeWo/View/Master/AdministrationView.xaml.cs
index cfbc7fe73..d59529359 100644
--- a/BeWo/View/Master/AdministrationView.xaml.cs
+++ b/BeWo/View/Master/AdministrationView.xaml.cs
@@ -18,15 +18,10 @@ namespace BeWo.View.Master
{
public partial class AdministrationView
{
- #region Fields
-
private readonly Dictionary _OpenViews = new Dictionary();
private BeWoView _SelectedView;
- #endregion
-
- #region Konstruktor
public AdministrationView()
{
@@ -137,10 +132,6 @@ namespace BeWo.View.Master
}
}
- #endregion
-
- #region Events
-
private void Tabitem_Selected(object sender, RoutedEventArgs e)
{
if (!(sender is AccordionItem selectedAccordionItem))
@@ -152,10 +143,6 @@ namespace BeWo.View.Master
GenerateNewView(selectedAccordionItem);
}
- #endregion
-
- #region Propeties
-
public override bool IsDirty => SelectedView != null &&
SelectedView.IsDirty;
@@ -174,10 +161,6 @@ namespace BeWo.View.Master
internal override DependencyObject ValidationOnSaveRootElement =>
SelectedView.ValidationOnSaveRootElement;
- #endregion
-
- #region Methoden
-
internal override bool DoSaveCheck()
{
BeWoApp.AppSettings.ExpandedAdministrationItems = "";
@@ -422,14 +405,17 @@ namespace BeWo.View.Master
VMFactory.CreateRatingTypeListVMAsync(r =>
this.Dispatch(() => AddView(TabitemRatingTypes, new RatingTypeView(r))));
return;
- //case nameof(TabitemOwnChatSettings):
- // AddView(TabitemOwnChatSettings, new OwnChatSettingsView());
- // return;
+ case nameof(TabitemAuftragsherkunft):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.Auftragsherkunft,
+ r => this.Dispatch(() => AddView(TabitemAuftragsherkunft, new ValueListView(r))));
+ return;
+ case nameof(TabitemVermittlungsgrundlage):
+ VMFactory.CreateValueListVMAsync(ValueListEntryType.Vermittlungsgrundlage,
+ r => this.Dispatch(() => AddView(TabitemVermittlungsgrundlage, new ValueListView(r))));
+ return;
}
throw new ArgumentOutOfRangeException(nameof(accordionItem));
}
-
- #endregion
}
}
\ No newline at end of file
diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
index 39ed79d67..f1da53d7f 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
@@ -338,7 +338,14 @@ namespace BeWo.View.Navigation
}
mainNavigationView.ShowHistory(recentList);
- })
+
+#if DEBUG
+ if(DebugConfig.CurrentConfig is object && DebugConfig.CurrentConfig.SelectView == UIContext.Customer)
+ {
+ mainNavigationView_OpenObject(recentList.FirstOrDefault() ?? objectList.FirstOrDefault());
+ }
+#endif
+ })
);
}
else
diff --git a/BeWo/View/Navigation/WohnheimNavigationView.xaml.cs b/BeWo/View/Navigation/WohnheimNavigationView.xaml.cs
index c1a82930d..a26b258a7 100644
--- a/BeWo/View/Navigation/WohnheimNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/WohnheimNavigationView.xaml.cs
@@ -23,6 +23,7 @@ namespace BeWo.View.Navigation
///
public partial class WohnheimNavigationView : BeWoView
{
+ private List _Customers;
private IEnumerable objectList;// = null;
private IEnumerable recentList = null;
@@ -81,7 +82,7 @@ namespace BeWo.View.Navigation
private void wohnheimNavigationView_CreateNewObject()
{
- VMFactory.CreateWohnheimVMAsync(cb => this.Dispatch(delegate { this.MainControl.NavigateTo(new WohnheimView(cb) { ParentView = this }); }));
+ VMFactory.CreateWohnheimVMAsync(_Customers, cb => this.Dispatch(delegate { this.MainControl.NavigateTo(new WohnheimView(cb) { ParentView = this }); }));
}
private bool wohnheimNavigationView_DeleteObject(IFilterableDC obj)
@@ -129,7 +130,7 @@ namespace BeWo.View.Navigation
CompactWohnheimDC dc = ofbj as CompactWohnheimDC;
if (dc != null)
{
- VMFactory.CreateWohnheimVMAsync(dc.WohnheimOid, cb => this.Dispatch(delegate { this.MainControl.NavigateTo(new WohnheimView(cb) { ParentView = this }); }));
+ VMFactory.CreateWohnheimVMAsync(dc.WohnheimOid, _Customers, cb => this.Dispatch(delegate { this.MainControl.NavigateTo(new WohnheimView(cb) { ParentView = this }); }));
}
}
@@ -161,6 +162,8 @@ namespace BeWo.View.Navigation
recentList = r.Cast();
this.wohnheimNavigationView.ShowHistory(recentList);
}));
+
+ ServiceFacade.DoCustomerServiceAsync(c => c.GetAllCompactCustomers(), cb => _Customers = cb);
}
else
{
diff --git a/BeWo/View/StundenplanView.xaml.cs b/BeWo/View/StundenplanView.xaml.cs
index 796b955a8..89807a968 100644
--- a/BeWo/View/StundenplanView.xaml.cs
+++ b/BeWo/View/StundenplanView.xaml.cs
@@ -63,8 +63,6 @@ namespace BeWo.View
{
tabcontrol_Arbeitszeit.SelectedIndex = tabcontrol_Arbeitszeit.Items.Count - 1;
}
-
-
}
diff --git a/BeWo/View/VarFieldEditControl.xaml b/BeWo/View/VarFieldEditControl.xaml
index e735af410..ed5de5567 100644
--- a/BeWo/View/VarFieldEditControl.xaml
+++ b/BeWo/View/VarFieldEditControl.xaml
@@ -1,51 +1,116 @@
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/VarFieldView.xaml b/BeWo/View/VarFieldView.xaml
index fd9506173..3026f9d88 100644
--- a/BeWo/View/VarFieldView.xaml
+++ b/BeWo/View/VarFieldView.xaml
@@ -1,44 +1,60 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/ViewModel/AbstractBaseVM.cs b/BeWo/ViewModel/AbstractBaseVM.cs
index faabf6168..688cb62eb 100644
--- a/BeWo/ViewModel/AbstractBaseVM.cs
+++ b/BeWo/ViewModel/AbstractBaseVM.cs
@@ -1,6 +1,6 @@
using System;
using System.ComponentModel;
-
+using BS.Shared;
using BS.Shared.Core;
namespace BeWo.ViewModel
@@ -49,10 +49,40 @@ namespace BeWo.ViewModel
: !lResult.Different;
}
+ //public bool HasLoggedOnUserRight(UserRightType type)
+ // {
+ // return BeWoApp.HasLoggedOnUserRight(type);
+ // }
+
protected virtual void FirePropertyChanged(string pPropertyName)
+ {
+ FirePropertyChanged(PropertyChanged, this, pPropertyName);
+ }
+
+ protected void FirePropertyChanged(PropertyChangedEventHandler handler, string pPropertyName)
+ {
+ FirePropertyChanged(handler, this, pPropertyName);
+ }
+
+ protected void FirePropertyChanged(object sender, string pPropertyName)
+ {
+ FirePropertyChanged(PropertyChanged, sender, pPropertyName);
+ }
+
+ protected void FirePropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ FirePropertyChanged(PropertyChanged, sender, e);
+ }
+
+ protected void FirePropertyChanged(PropertyChangedEventHandler handler, object sender, string pPropertyName)
+ {
+ FirePropertyChanged(handler, sender, new PropertyChangedEventArgs(pPropertyName));
+ }
+
+ protected void FirePropertyChanged(PropertyChangedEventHandler handler, object sender, PropertyChangedEventArgs e)
{
_IsDirty = true;
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(pPropertyName));
+ handler?.Invoke(sender, e);
}
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/AbstractDCMapperVM.cs b/BeWo/ViewModel/AbstractDCMapperVM.cs
index 0a462aa1e..0b300cda0 100644
--- a/BeWo/ViewModel/AbstractDCMapperVM.cs
+++ b/BeWo/ViewModel/AbstractDCMapperVM.cs
@@ -5,30 +5,19 @@ namespace BeWo.ViewModel
{
public abstract class AbstractDCMapperVM : AbstractBaseVM where DCType : new()
{
- #region Constants and Fields
-
private readonly List _DirtyProps = new List();
private bool? _IsNew;
- #endregion
-
- #region Constructors and Destructors
-
public AbstractDCMapperVM() { }
public AbstractDCMapperVM(DCType pDataContract, bool pIsNew)
{
-
_IsNew = pIsNew;
DataContract = pDataContract;
InitByDataContract(DataContract);
}
- #endregion
-
- #region Properties
-
public override bool IsDirty
{
get { return _DirtyProps.Count > 0; }
@@ -54,10 +43,6 @@ namespace BeWo.ViewModel
internal DCType DataContract { get; set; }
- #endregion
-
- #region Public Methods
-
public DCType CommitToDataContract()
{
return MapToDataContract(DataContract, true);
@@ -76,10 +61,6 @@ namespace BeWo.ViewModel
}
}
- #endregion
-
- #region Methods
-
protected abstract void InitByDataContract(DCType pDataContract);
protected abstract DCType MapToDataContract(DCType pDataContract, bool doCommit);
@@ -95,7 +76,5 @@ namespace BeWo.ViewModel
_DirtyProps.Add(pPropName);
}
}
-
- #endregion
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/CustomerFalldatenVM.cs b/BeWo/ViewModel/CustomerFalldatenVM.cs
new file mode 100644
index 000000000..ef08847fe
--- /dev/null
+++ b/BeWo/ViewModel/CustomerFalldatenVM.cs
@@ -0,0 +1,606 @@
+using System;
+
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+
+namespace BeWo.ViewModel
+{
+ public class CustomerFalldatenVM : AbstractDCMapperVM
+ {
+ private string _EigenesAktenzeichen;
+ private DateTime? _Auftragseingang;
+ private ValueListEntryDC _Auftragsherkunft;
+ private ObservableSortCollection _Auftragsherkunfte;
+ private ValueListEntryDC _Vermittlungsgrundlage;
+ private ObservableSortCollection _Vermittlungsgrundlagen;
+ private decimal? _Tagessatze;
+ private decimal? _Tagessatzhohe;
+ private decimal? _HoheDerGeldstrafe;
+ private decimal? _ZuLeistendeArbeitsstunden;
+ private string _Hinweis;
+ private DateTime? _Termin;
+ private FalldatenBearbeitungsstatus? _FalldatenBearbeitungsstatus;
+ private string _Auftragsruckgabe;
+ private string _Verlauf;
+ private decimal? _AbgeleisteteStunden;
+ private decimal? _ErsparteHafttage;
+ private decimal? _GeleisteteRatenzahlung;
+ private string _Bemerkung;
+ private decimal? _GeleisteteEinmalzahlung;
+ private bool _GrundArbeitsunfahig;
+ private bool _GrundSuchtproblem;
+ private bool _GrundPsychischeProbleme;
+ private bool _GrundKeineMotivation;
+ private bool _GrundInHaft;
+ private bool _GrundUnbekannt;
+ private bool _GrundKeinKontakt;
+ private bool _GrundNichtAngetreten;
+ private bool _GrundAbbruchDerTatigkeit;
+ private bool _GrundWiderruf;
+ private bool _Grund459StPO;
+ private bool _GrundAusbleibenDerZahlung;
+ private bool _BesonderheitMehrfacheBeauftragung;
+ private bool _BesonderheitMehrfacheVermittlung;
+ private bool _BesonderheitVermittlungAusHaft;
+ private bool _BesonderheitDurchBGBWAufgesucht;
+
+ public CustomerFalldatenVM(CustomerVM cust, FalldatenDC dc) : base(dc, dc.IsNew)
+ {
+ Customer = cust;
+ }
+
+ public CustomerVM Customer { get; set; }
+
+ public bool PermissionFalldatenEdit { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_GemeinnutzigeArbeit_Edit);
+ public bool NoPermissionFalldatenEdit => !PermissionFalldatenEdit;
+
+ public string EigenesAktenzeichen
+ {
+ get { return _EigenesAktenzeichen; }
+ set
+ {
+ if (!AreDifferent(_EigenesAktenzeichen, value))
+ return;
+
+ _EigenesAktenzeichen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EigenesAktenzeichen, value), nameof(EigenesAktenzeichen));
+ FirePropertyChanged(nameof(EigenesAktenzeichen));
+ }
+ }
+ public DateTime? Auftragseingang
+ {
+ get { return _Auftragseingang; }
+ set
+ {
+ if (!AreDifferent(_Auftragseingang, value))
+ return;
+
+ _Auftragseingang = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragseingang, value), nameof(Auftragseingang));
+ FirePropertyChanged(nameof(Auftragseingang));
+ }
+ }
+ public ValueListEntryDC Auftragsherkunft
+ {
+ get { return _Auftragsherkunft; }
+ set
+ {
+ if (!AreDifferent(_Auftragsherkunft, value))
+ return;
+
+ _Auftragsherkunft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragsherkunft, value), nameof(Auftragsherkunft));
+ FirePropertyChanged(nameof(Auftragsherkunft));
+ }
+ }
+ public ObservableSortCollection Auftragsherkunfte
+ {
+ get { return _Auftragsherkunfte ?? (_Auftragsherkunfte = new ObservableSortCollection()); }
+ set { _Auftragsherkunfte = value; }
+ }
+ public ValueListEntryDC Vermittlungsgrundlage
+ {
+ get { return _Vermittlungsgrundlage; }
+ set
+ {
+ if (!AreDifferent(_Vermittlungsgrundlage, value))
+ return;
+
+ _Vermittlungsgrundlage = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Vermittlungsgrundlage, value), nameof(Vermittlungsgrundlage));
+ FirePropertyChanged(nameof(Vermittlungsgrundlage));
+ }
+ }
+ public ObservableSortCollection Vermittlungsgrundlagen
+ {
+ get { return _Vermittlungsgrundlagen ?? (_Vermittlungsgrundlagen = new ObservableSortCollection()); }
+ set { _Vermittlungsgrundlagen = value; }
+ }
+ public decimal? Tagessatze
+ {
+ get { return _Tagessatze; }
+ set
+ {
+ if (!AreDifferent(_Tagessatze, value))
+ return;
+
+ _Tagessatze = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Tagessatze, value), nameof(Tagessatze));
+ FirePropertyChanged(nameof(Tagessatze));
+ UpdateHoheDerGeldstrafe();
+ }
+ }
+ public decimal? Tagessatzhohe
+ {
+ get { return _Tagessatzhohe; }
+ set
+ {
+ if (!AreDifferent(_Tagessatzhohe, value))
+ return;
+
+ _Tagessatzhohe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Tagessatzhohe, value), nameof(Tagessatzhohe));
+ FirePropertyChanged(nameof(Tagessatzhohe));
+ UpdateHoheDerGeldstrafe();
+ }
+ }
+ public decimal? HoheDerGeldstrafe
+ {
+ get { return _HoheDerGeldstrafe; }
+ set
+ {
+ if (!AreDifferent(_HoheDerGeldstrafe, value))
+ return;
+
+ _HoheDerGeldstrafe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.HoheDerGeldstrafe, value), nameof(HoheDerGeldstrafe));
+ FirePropertyChanged(nameof(HoheDerGeldstrafe));
+ }
+ }
+ public decimal? ZuLeistendeArbeitsstunden
+ {
+ get { return _ZuLeistendeArbeitsstunden; }
+ set
+ {
+ if (!AreDifferent(_ZuLeistendeArbeitsstunden, value))
+ return;
+
+ _ZuLeistendeArbeitsstunden = value;
+ StoreDirtyInformation(AreDifferent(DataContract.ZuLeistendeArbeitsstunden, value), nameof(ZuLeistendeArbeitsstunden));
+ FirePropertyChanged(nameof(ZuLeistendeArbeitsstunden));
+ }
+ }
+ public string Hinweis
+ {
+ get { return _Hinweis; }
+ set
+ {
+ if (!AreDifferent(_Hinweis, value))
+ return;
+
+ _Hinweis = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Hinweis, value), nameof(Hinweis));
+ FirePropertyChanged(nameof(Hinweis));
+ }
+ }
+ public DateTime? Termin
+ {
+ get { return _Termin; }
+ set
+ {
+ if (!AreDifferent(_Termin, value))
+ return;
+
+ _Termin = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Termin, value), nameof(Termin));
+ FirePropertyChanged(nameof(Termin));
+ }
+ }
+ public FalldatenBearbeitungsstatus? FalldatenBearbeitungsstatus
+ {
+ get { return _FalldatenBearbeitungsstatus; }
+ set
+ {
+ if (!AreDifferent(_FalldatenBearbeitungsstatus, value))
+ return;
+
+ _FalldatenBearbeitungsstatus = value;
+ StoreDirtyInformation(AreDifferent(DataContract.FalldatenBearbeitungsstatus, value), nameof(FalldatenBearbeitungsstatus));
+ FirePropertyChanged(nameof(FalldatenBearbeitungsstatus));
+ }
+ }
+ public string Auftragsruckgabe
+ {
+ get { return _Auftragsruckgabe; }
+ set
+ {
+ if (!AreDifferent(_Auftragsruckgabe, value))
+ return;
+
+ _Auftragsruckgabe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragsruckgabe, value), nameof(Auftragsruckgabe));
+ FirePropertyChanged(nameof(Auftragsruckgabe));
+ }
+ }
+ public string Verlauf
+ {
+ get { return _Verlauf; }
+ set
+ {
+ if (!AreDifferent(_Verlauf, value))
+ return;
+
+ _Verlauf = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Verlauf, value), nameof(Verlauf));
+ FirePropertyChanged(nameof(Verlauf));
+ }
+ }
+ public decimal? AbgeleisteteStunden
+ {
+ get { return _AbgeleisteteStunden; }
+ set
+ {
+ if (!AreDifferent(_AbgeleisteteStunden, value))
+ return;
+
+ _AbgeleisteteStunden = value;
+ StoreDirtyInformation(AreDifferent(DataContract.AbgeleisteteStunden, value), nameof(AbgeleisteteStunden));
+ FirePropertyChanged(nameof(AbgeleisteteStunden));
+ }
+ }
+ public decimal? ErsparteHafttage
+ {
+ get { return _ErsparteHafttage; }
+ set
+ {
+ if (!AreDifferent(_ErsparteHafttage, value))
+ return;
+
+ _ErsparteHafttage = value;
+ StoreDirtyInformation(AreDifferent(DataContract.ErsparteHafttage, value), nameof(ErsparteHafttage));
+ FirePropertyChanged(nameof(ErsparteHafttage));
+ }
+ }
+ public decimal? GeleisteteRatenzahlung
+ {
+ get { return _GeleisteteRatenzahlung; }
+ set
+ {
+ if (!AreDifferent(_GeleisteteRatenzahlung, value))
+ return;
+
+ _GeleisteteRatenzahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GeleisteteRatenzahlung, value), nameof(GeleisteteRatenzahlung));
+ FirePropertyChanged(nameof(GeleisteteRatenzahlung));
+ }
+ }
+ public string Bemerkung
+ {
+ get { return _Bemerkung; }
+ set
+ {
+ if (!AreDifferent(_Bemerkung, value))
+ return;
+
+ _Bemerkung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Bemerkung, value), nameof(Bemerkung));
+ FirePropertyChanged(nameof(Bemerkung));
+ }
+ }
+ public decimal? GeleisteteEinmalzahlung
+ {
+ get { return _GeleisteteEinmalzahlung; }
+ set
+ {
+ if (!AreDifferent(_GeleisteteEinmalzahlung, value))
+ return;
+
+ _GeleisteteEinmalzahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GeleisteteEinmalzahlung, value), nameof(GeleisteteEinmalzahlung));
+ FirePropertyChanged(nameof(GeleisteteEinmalzahlung));
+ }
+ }
+ public bool GrundArbeitsunfahig
+ {
+ get { return _GrundArbeitsunfahig; }
+ set
+ {
+ if (!AreDifferent(_GrundArbeitsunfahig, value))
+ return;
+
+ _GrundArbeitsunfahig = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundArbeitsunfahig, value), nameof(GrundArbeitsunfahig));
+ FirePropertyChanged(nameof(GrundArbeitsunfahig));
+ }
+ }
+ public bool GrundSuchtproblem
+ {
+ get { return _GrundSuchtproblem; }
+ set
+ {
+ if (!AreDifferent(_GrundSuchtproblem, value))
+ return;
+
+ _GrundSuchtproblem = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundSuchtproblem, value), nameof(GrundSuchtproblem));
+ FirePropertyChanged(nameof(GrundSuchtproblem));
+ }
+ }
+ public bool GrundPsychischeProbleme
+ {
+ get { return _GrundPsychischeProbleme; }
+ set
+ {
+ if (!AreDifferent(_GrundPsychischeProbleme, value))
+ return;
+
+ _GrundPsychischeProbleme = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundPsychischeProbleme, value), nameof(GrundPsychischeProbleme));
+ FirePropertyChanged(nameof(GrundPsychischeProbleme));
+ }
+ }
+ public bool GrundKeineMotivation
+ {
+ get { return _GrundKeineMotivation; }
+ set
+ {
+ if (!AreDifferent(_GrundKeineMotivation, value))
+ return;
+
+ _GrundKeineMotivation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundKeineMotivation, value), nameof(GrundKeineMotivation));
+ FirePropertyChanged(nameof(GrundKeineMotivation));
+ }
+ }
+ public bool GrundInHaft
+ {
+ get { return _GrundInHaft; }
+ set
+ {
+ if (!AreDifferent(_GrundInHaft, value))
+ return;
+
+ _GrundInHaft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundInHaft, value), nameof(GrundInHaft));
+ FirePropertyChanged(nameof(GrundInHaft));
+ }
+ }
+ public bool GrundUnbekannt
+ {
+ get { return _GrundUnbekannt; }
+ set
+ {
+ if (!AreDifferent(_GrundUnbekannt, value))
+ return;
+
+ _GrundUnbekannt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundUnbekannt, value), nameof(GrundUnbekannt));
+ FirePropertyChanged(nameof(GrundUnbekannt));
+ }
+ }
+ public bool GrundKeinKontakt
+ {
+ get { return _GrundKeinKontakt; }
+ set
+ {
+ if (!AreDifferent(_GrundKeinKontakt, value))
+ return;
+
+ _GrundKeinKontakt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundKeinKontakt, value), nameof(GrundKeinKontakt));
+ FirePropertyChanged(nameof(GrundKeinKontakt));
+ }
+ }
+ public bool GrundNichtAngetreten
+ {
+ get { return _GrundNichtAngetreten; }
+ set
+ {
+ if (!AreDifferent(_GrundNichtAngetreten, value))
+ return;
+
+ _GrundNichtAngetreten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundNichtAngetreten, value), nameof(GrundNichtAngetreten));
+ FirePropertyChanged(nameof(GrundNichtAngetreten));
+ }
+ }
+ public bool GrundAbbruchDerTatigkeit
+ {
+ get { return _GrundAbbruchDerTatigkeit; }
+ set
+ {
+ if (!AreDifferent(_GrundAbbruchDerTatigkeit, value))
+ return;
+
+ _GrundAbbruchDerTatigkeit = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundAbbruchDerTatigkeit, value), nameof(GrundAbbruchDerTatigkeit));
+ FirePropertyChanged(nameof(GrundAbbruchDerTatigkeit));
+ }
+ }
+ public bool GrundWiderruf
+ {
+ get { return _GrundWiderruf; }
+ set
+ {
+ if (!AreDifferent(_GrundWiderruf, value))
+ return;
+
+ _GrundWiderruf = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundWiderruf, value), nameof(GrundWiderruf));
+ FirePropertyChanged(nameof(GrundWiderruf));
+ }
+ }
+ public bool Grund459StPO
+ {
+ get { return _Grund459StPO; }
+ set
+ {
+ if (!AreDifferent(_Grund459StPO, value))
+ return;
+
+ _Grund459StPO = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Grund459StPO, value), nameof(Grund459StPO));
+ FirePropertyChanged(nameof(Grund459StPO));
+ }
+ }
+ public bool GrundAusbleibenDerZahlung
+ {
+ get { return _GrundAusbleibenDerZahlung; }
+ set
+ {
+ if (!AreDifferent(_GrundAusbleibenDerZahlung, value))
+ return;
+
+ _GrundAusbleibenDerZahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundAusbleibenDerZahlung, value), nameof(GrundAusbleibenDerZahlung));
+ FirePropertyChanged(nameof(GrundAusbleibenDerZahlung));
+ }
+ }
+ public bool BesonderheitMehrfacheBeauftragung
+ {
+ get { return _BesonderheitMehrfacheBeauftragung; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitMehrfacheBeauftragung, value))
+ return;
+
+ _BesonderheitMehrfacheBeauftragung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitMehrfacheBeauftragung, value), nameof(BesonderheitMehrfacheBeauftragung));
+ FirePropertyChanged(nameof(BesonderheitMehrfacheBeauftragung));
+ }
+ }
+ public bool BesonderheitMehrfacheVermittlung
+ {
+ get { return _BesonderheitMehrfacheVermittlung; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitMehrfacheVermittlung, value))
+ return;
+
+ _BesonderheitMehrfacheVermittlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitMehrfacheVermittlung, value), nameof(BesonderheitMehrfacheVermittlung));
+ FirePropertyChanged(nameof(BesonderheitMehrfacheVermittlung));
+ }
+ }
+ public bool BesonderheitVermittlungAusHaft
+ {
+ get { return _BesonderheitVermittlungAusHaft; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitVermittlungAusHaft, value))
+ return;
+
+ _BesonderheitVermittlungAusHaft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitVermittlungAusHaft, value), nameof(BesonderheitVermittlungAusHaft));
+ FirePropertyChanged(nameof(BesonderheitVermittlungAusHaft));
+ }
+ }
+ public bool BesonderheitDurchBGBWAufgesucht
+ {
+ get { return _BesonderheitDurchBGBWAufgesucht; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitDurchBGBWAufgesucht, value))
+ return;
+
+ _BesonderheitDurchBGBWAufgesucht = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitDurchBGBWAufgesucht, value), nameof(BesonderheitDurchBGBWAufgesucht));
+ FirePropertyChanged(nameof(BesonderheitDurchBGBWAufgesucht));
+ }
+ }
+
+ public void UpdateHoheDerGeldstrafe()
+ {
+ if (!Tagessatze.HasValue || !Tagessatzhohe.HasValue)
+ return;
+
+ HoheDerGeldstrafe = Tagessatze * Tagessatzhohe;
+ }
+
+ protected override void InitByDataContract(FalldatenDC pDataContract)
+ {
+ _EigenesAktenzeichen = pDataContract.EigenesAktenzeichen;
+ _Auftragseingang = pDataContract.Auftragseingang;
+ _Auftragsherkunft = pDataContract.Auftragsherkunft;
+ _Vermittlungsgrundlage = pDataContract.Vermittlungsgrundlage;
+ _Tagessatze = pDataContract.Tagessatze;
+ _Tagessatzhohe = pDataContract.Tagessatzhohe;
+ _HoheDerGeldstrafe = pDataContract.HoheDerGeldstrafe;
+ _ZuLeistendeArbeitsstunden = pDataContract.ZuLeistendeArbeitsstunden;
+ _Hinweis = pDataContract.Hinweis;
+ _Termin = pDataContract.Termin;
+ _FalldatenBearbeitungsstatus = pDataContract.FalldatenBearbeitungsstatus;
+ _Auftragsruckgabe = pDataContract.Auftragsruckgabe;
+ _Verlauf = pDataContract.Verlauf;
+ _AbgeleisteteStunden = pDataContract.AbgeleisteteStunden;
+ _ErsparteHafttage = pDataContract.ErsparteHafttage;
+ _GeleisteteRatenzahlung = pDataContract.GeleisteteRatenzahlung;
+ _Bemerkung = pDataContract.Bemerkung;
+ _GeleisteteEinmalzahlung = pDataContract.GeleisteteEinmalzahlung;
+ _GrundArbeitsunfahig = pDataContract.GrundArbeitsunfahig;
+ _GrundSuchtproblem = pDataContract.GrundSuchtproblem;
+ _GrundPsychischeProbleme = pDataContract.GrundPsychischeProbleme;
+ _GrundKeineMotivation = pDataContract.GrundKeineMotivation;
+ _GrundInHaft = pDataContract.GrundInHaft;
+ _GrundUnbekannt = pDataContract.GrundUnbekannt;
+ _GrundKeinKontakt = pDataContract.GrundKeinKontakt;
+ _GrundNichtAngetreten = pDataContract.GrundNichtAngetreten;
+ _GrundAbbruchDerTatigkeit = pDataContract.GrundAbbruchDerTatigkeit;
+ _GrundWiderruf = pDataContract.GrundWiderruf;
+ _Grund459StPO = pDataContract.Grund459StPO;
+ _GrundAusbleibenDerZahlung = pDataContract.GrundAusbleibenDerZahlung;
+ _BesonderheitMehrfacheBeauftragung = pDataContract.BesonderheitMehrfacheBeauftragung;
+ _BesonderheitMehrfacheVermittlung = pDataContract.BesonderheitMehrfacheVermittlung;
+ _BesonderheitVermittlungAusHaft = pDataContract.BesonderheitVermittlungAusHaft;
+ _BesonderheitDurchBGBWAufgesucht = pDataContract.BesonderheitDurchBGBWAufgesucht;
+ }
+
+ internal void InitValueListEntrys(ObservableSortCollection auftragsherkunfte, ObservableSortCollection vermittlungsgrundlage)
+ {
+ _Auftragsherkunfte = auftragsherkunfte;
+ _Vermittlungsgrundlagen = vermittlungsgrundlage;
+ }
+
+ protected override FalldatenDC MapToDataContract(FalldatenDC pDataContract, bool doCommit)
+ {
+ pDataContract.EigenesAktenzeichen = _EigenesAktenzeichen;
+ pDataContract.Auftragseingang = _Auftragseingang;
+ pDataContract.Auftragsherkunft = _Auftragsherkunft;
+ pDataContract.Vermittlungsgrundlage = _Vermittlungsgrundlage;
+ pDataContract.Tagessatze = _Tagessatze;
+ pDataContract.Tagessatzhohe = _Tagessatzhohe;
+ pDataContract.HoheDerGeldstrafe = _HoheDerGeldstrafe;
+ pDataContract.ZuLeistendeArbeitsstunden = _ZuLeistendeArbeitsstunden;
+ pDataContract.Hinweis = _Hinweis;
+ pDataContract.Termin = _Termin;
+ pDataContract.FalldatenBearbeitungsstatus = _FalldatenBearbeitungsstatus;
+ pDataContract.Auftragsruckgabe = _Auftragsruckgabe;
+ pDataContract.Verlauf = _Verlauf;
+ pDataContract.AbgeleisteteStunden = _AbgeleisteteStunden;
+ pDataContract.ErsparteHafttage = _ErsparteHafttage;
+ pDataContract.GeleisteteRatenzahlung = _GeleisteteRatenzahlung;
+ pDataContract.Bemerkung = _Bemerkung;
+ pDataContract.GeleisteteEinmalzahlung = _GeleisteteEinmalzahlung;
+ pDataContract.GrundArbeitsunfahig = _GrundArbeitsunfahig;
+ pDataContract.GrundSuchtproblem = _GrundSuchtproblem;
+ pDataContract.GrundPsychischeProbleme = _GrundPsychischeProbleme;
+ pDataContract.GrundKeineMotivation = _GrundKeineMotivation;
+ pDataContract.GrundInHaft = _GrundInHaft;
+ pDataContract.GrundUnbekannt = _GrundUnbekannt;
+ pDataContract.GrundKeinKontakt = _GrundKeinKontakt;
+ pDataContract.GrundNichtAngetreten = _GrundNichtAngetreten;
+ pDataContract.GrundAbbruchDerTatigkeit = _GrundAbbruchDerTatigkeit;
+ pDataContract.GrundWiderruf = _GrundWiderruf;
+ pDataContract.Grund459StPO = _Grund459StPO;
+ pDataContract.GrundAusbleibenDerZahlung = _GrundAusbleibenDerZahlung;
+ pDataContract.BesonderheitMehrfacheBeauftragung = _BesonderheitMehrfacheBeauftragung;
+ pDataContract.BesonderheitMehrfacheVermittlung = _BesonderheitMehrfacheVermittlung;
+ pDataContract.BesonderheitVermittlungAusHaft = _BesonderheitVermittlungAusHaft;
+ pDataContract.BesonderheitDurchBGBWAufgesucht = _BesonderheitDurchBGBWAufgesucht;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/CustomerGemeinnutzigeArbeitVM.cs b/BeWo/ViewModel/CustomerGemeinnutzigeArbeitVM.cs
new file mode 100644
index 000000000..18a0d280f
--- /dev/null
+++ b/BeWo/ViewModel/CustomerGemeinnutzigeArbeitVM.cs
@@ -0,0 +1,610 @@
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel
+{
+ public class CustomerGemeinnutzigeArbeitVM : AbstractDCMapperVM
+ {
+ private string _EigenesAktenzeichen;
+ private DateTime? _Auftragseingang;
+ private ValueListEntryDC _Auftragsherkunft;
+ private ObservableSortCollection _Auftragsherkunfte;
+ private ValueListEntryDC _Vermittlungsgrundlage;
+ private ObservableSortCollection _Vermittlungsgrundlagen;
+ private decimal? _Tagessatze;
+ private decimal? _Tagessatzhohe;
+ private decimal? _HoheDerGeldstrafe;
+ private decimal? _ZuLeistendeArbeitsstunden;
+ private string _Hinweis;
+ private DateTime? _Termin;
+ private FalldatenBearbeitungsstatus? _FalldatenBearbeitungsstatus;
+ private string _Auftragsruckgabe;
+ private string _Verlauf;
+ private decimal? _AbgeleisteteStunden;
+ private decimal? _ErsparteHafttage;
+ private decimal? _GeleisteteRatenzahlung;
+ private string _Bemerkung;
+ private decimal? _GeleisteteEinmalzahlung;
+ private bool _GrundArbeitsunfahig;
+ private bool _GrundSuchtproblem;
+ private bool _GrundPsychischeProbleme;
+ private bool _GrundKeineMotivation;
+ private bool _GrundInHaft;
+ private bool _GrundUnbekannt;
+ private bool _GrundKeinKontakt;
+ private bool _GrundNichtAngetreten;
+ private bool _GrundAbbruchDerTatigkeit;
+ private bool _GrundWiderruf;
+ private bool _Grund459StPO;
+ private bool _GrundAusbleibenDerZahlung;
+ private bool _BesonderheitMehrfacheBeauftragung;
+ private bool _BesonderheitMehrfacheVermittlung;
+ private bool _BesonderheitVermittlungAusHaft;
+ private bool _BesonderheitDurchBGBWAufgesucht;
+
+ public CustomerGemeinnutzigeArbeitVM()
+ {
+
+ }
+
+ public CustomerGemeinnutzigeArbeitVM(FalldatenDC falldatenDC) : base(falldatenDC, falldatenDC.IsNew)
+ {
+
+ }
+
+ public string Displayname => $"AZ: {EigenesAktenzeichen}";
+ public string EigenesAktenzeichen
+ {
+ get { return _EigenesAktenzeichen; }
+ set
+ {
+ if (!AreDifferent(_EigenesAktenzeichen, value))
+ return;
+
+ _EigenesAktenzeichen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EigenesAktenzeichen, value), nameof(EigenesAktenzeichen));
+ FirePropertyChanged(nameof(EigenesAktenzeichen));
+ FirePropertyChanged(nameof(Displayname));
+ }
+ }
+ public DateTime? Auftragseingang
+ {
+ get { return _Auftragseingang; }
+ set
+ {
+ if (!AreDifferent(_Auftragseingang, value))
+ return;
+
+ _Auftragseingang = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragseingang, value), nameof(Auftragseingang));
+ FirePropertyChanged(nameof(Auftragseingang));
+ }
+ }
+ public ValueListEntryDC Auftragsherkunft
+ {
+ get { return _Auftragsherkunft; }
+ set
+ {
+ if (!AreDifferent(_Auftragsherkunft, value))
+ return;
+
+ _Auftragsherkunft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragsherkunft, value), nameof(Auftragsherkunft));
+ FirePropertyChanged(nameof(Auftragsherkunft));
+ }
+ }
+ public ObservableSortCollection Auftragsherkunfte
+ {
+ get { return _Auftragsherkunfte ?? (_Auftragsherkunfte = new ObservableSortCollection()); }
+ set { _Auftragsherkunfte = value; }
+ }
+ public ValueListEntryDC Vermittlungsgrundlage
+ {
+ get { return _Vermittlungsgrundlage; }
+ set
+ {
+ if (!AreDifferent(_Vermittlungsgrundlage, value))
+ return;
+
+ _Vermittlungsgrundlage = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Vermittlungsgrundlage, value), nameof(Vermittlungsgrundlage));
+ FirePropertyChanged(nameof(Vermittlungsgrundlage));
+ }
+ }
+ public ObservableSortCollection Vermittlungsgrundlagen
+ {
+ get { return _Vermittlungsgrundlagen ?? (_Vermittlungsgrundlagen = new ObservableSortCollection()); }
+ set { _Vermittlungsgrundlagen = value; }
+ }
+ public decimal? Tagessatze
+ {
+ get { return _Tagessatze; }
+ set
+ {
+ if (!AreDifferent(_Tagessatze, value))
+ return;
+
+ _Tagessatze = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Tagessatze, value), nameof(Tagessatze));
+ FirePropertyChanged(nameof(Tagessatze));
+ UpdateHoheDerGeldstrafe();
+ }
+ }
+ public decimal? Tagessatzhohe
+ {
+ get { return _Tagessatzhohe; }
+ set
+ {
+ if (!AreDifferent(_Tagessatzhohe, value))
+ return;
+
+ _Tagessatzhohe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Tagessatzhohe, value), nameof(Tagessatzhohe));
+ FirePropertyChanged(nameof(Tagessatzhohe));
+ UpdateHoheDerGeldstrafe();
+ }
+ }
+ public decimal? HoheDerGeldstrafe
+ {
+ get { return _HoheDerGeldstrafe; }
+ set
+ {
+ if (!AreDifferent(_HoheDerGeldstrafe, value))
+ return;
+
+ _HoheDerGeldstrafe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.HoheDerGeldstrafe, value), nameof(HoheDerGeldstrafe));
+ FirePropertyChanged(nameof(HoheDerGeldstrafe));
+ }
+ }
+ public decimal? ZuLeistendeArbeitsstunden
+ {
+ get { return _ZuLeistendeArbeitsstunden; }
+ set
+ {
+ if (!AreDifferent(_ZuLeistendeArbeitsstunden, value))
+ return;
+
+ _ZuLeistendeArbeitsstunden = value;
+ StoreDirtyInformation(AreDifferent(DataContract.ZuLeistendeArbeitsstunden, value), nameof(ZuLeistendeArbeitsstunden));
+ FirePropertyChanged(nameof(ZuLeistendeArbeitsstunden));
+ }
+ }
+ public string Hinweis
+ {
+ get { return _Hinweis; }
+ set
+ {
+ if (!AreDifferent(_Hinweis, value))
+ return;
+
+ _Hinweis = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Hinweis, value), nameof(Hinweis));
+ FirePropertyChanged(nameof(Hinweis));
+ }
+ }
+ public DateTime? Termin
+ {
+ get { return _Termin; }
+ set
+ {
+ if (!AreDifferent(_Termin, value))
+ return;
+
+ _Termin = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Termin, value), nameof(Termin));
+ FirePropertyChanged(nameof(Termin));
+ }
+ }
+ public IEnumerable FalldatenBearbeitungsstatusTypes => Utils.GetAllEnumValues();
+ public FalldatenBearbeitungsstatus? FalldatenBearbeitungsstatus
+ {
+ get { return _FalldatenBearbeitungsstatus; }
+ set
+ {
+ if (!AreDifferent(_FalldatenBearbeitungsstatus, value))
+ return;
+
+ _FalldatenBearbeitungsstatus = value;
+ StoreDirtyInformation(AreDifferent(DataContract.FalldatenBearbeitungsstatus, value), nameof(FalldatenBearbeitungsstatus));
+ FirePropertyChanged(nameof(FalldatenBearbeitungsstatus));
+ }
+ }
+ public string Auftragsruckgabe
+ {
+ get { return _Auftragsruckgabe; }
+ set
+ {
+ if (!AreDifferent(_Auftragsruckgabe, value))
+ return;
+
+ _Auftragsruckgabe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Auftragsruckgabe, value), nameof(Auftragsruckgabe));
+ FirePropertyChanged(nameof(Auftragsruckgabe));
+ }
+ }
+ public string Verlauf
+ {
+ get { return _Verlauf; }
+ set
+ {
+ if (!AreDifferent(_Verlauf, value))
+ return;
+
+ _Verlauf = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Verlauf, value), nameof(Verlauf));
+ FirePropertyChanged(nameof(Verlauf));
+ }
+ }
+ public decimal? AbgeleisteteStunden
+ {
+ get { return _AbgeleisteteStunden; }
+ set
+ {
+ if (!AreDifferent(_AbgeleisteteStunden, value))
+ return;
+
+ _AbgeleisteteStunden = value;
+ StoreDirtyInformation(AreDifferent(DataContract.AbgeleisteteStunden, value), nameof(AbgeleisteteStunden));
+ FirePropertyChanged(nameof(AbgeleisteteStunden));
+ }
+ }
+ public decimal? ErsparteHafttage
+ {
+ get { return _ErsparteHafttage; }
+ set
+ {
+ if (!AreDifferent(_ErsparteHafttage, value))
+ return;
+
+ _ErsparteHafttage = value;
+ StoreDirtyInformation(AreDifferent(DataContract.ErsparteHafttage, value), nameof(ErsparteHafttage));
+ FirePropertyChanged(nameof(ErsparteHafttage));
+ }
+ }
+ public decimal? GeleisteteRatenzahlung
+ {
+ get { return _GeleisteteRatenzahlung; }
+ set
+ {
+ if (!AreDifferent(_GeleisteteRatenzahlung, value))
+ return;
+
+ _GeleisteteRatenzahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GeleisteteRatenzahlung, value), nameof(GeleisteteRatenzahlung));
+ FirePropertyChanged(nameof(GeleisteteRatenzahlung));
+ }
+ }
+ public string Bemerkung
+ {
+ get { return _Bemerkung; }
+ set
+ {
+ if (!AreDifferent(_Bemerkung, value))
+ return;
+
+ _Bemerkung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Bemerkung, value), nameof(Bemerkung));
+ FirePropertyChanged(nameof(Bemerkung));
+ }
+ }
+ public decimal? GeleisteteEinmalzahlung
+ {
+ get { return _GeleisteteEinmalzahlung; }
+ set
+ {
+ if (!AreDifferent(_GeleisteteEinmalzahlung, value))
+ return;
+
+ _GeleisteteEinmalzahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GeleisteteEinmalzahlung, value), nameof(GeleisteteEinmalzahlung));
+ FirePropertyChanged(nameof(GeleisteteEinmalzahlung));
+ }
+ }
+ public bool GrundArbeitsunfahig
+ {
+ get { return _GrundArbeitsunfahig; }
+ set
+ {
+ if (!AreDifferent(_GrundArbeitsunfahig, value))
+ return;
+
+ _GrundArbeitsunfahig = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundArbeitsunfahig, value), nameof(GrundArbeitsunfahig));
+ FirePropertyChanged(nameof(GrundArbeitsunfahig));
+ }
+ }
+ public bool GrundSuchtproblem
+ {
+ get { return _GrundSuchtproblem; }
+ set
+ {
+ if (!AreDifferent(_GrundSuchtproblem, value))
+ return;
+
+ _GrundSuchtproblem = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundSuchtproblem, value), nameof(GrundSuchtproblem));
+ FirePropertyChanged(nameof(GrundSuchtproblem));
+ }
+ }
+ public bool GrundPsychischeProbleme
+ {
+ get { return _GrundPsychischeProbleme; }
+ set
+ {
+ if (!AreDifferent(_GrundPsychischeProbleme, value))
+ return;
+
+ _GrundPsychischeProbleme = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundPsychischeProbleme, value), nameof(GrundPsychischeProbleme));
+ FirePropertyChanged(nameof(GrundPsychischeProbleme));
+ }
+ }
+ public bool GrundKeineMotivation
+ {
+ get { return _GrundKeineMotivation; }
+ set
+ {
+ if (!AreDifferent(_GrundKeineMotivation, value))
+ return;
+
+ _GrundKeineMotivation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundKeineMotivation, value), nameof(GrundKeineMotivation));
+ FirePropertyChanged(nameof(GrundKeineMotivation));
+ }
+ }
+ public bool GrundInHaft
+ {
+ get { return _GrundInHaft; }
+ set
+ {
+ if (!AreDifferent(_GrundInHaft, value))
+ return;
+
+ _GrundInHaft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundInHaft, value), nameof(GrundInHaft));
+ FirePropertyChanged(nameof(GrundInHaft));
+ }
+ }
+ public bool GrundUnbekannt
+ {
+ get { return _GrundUnbekannt; }
+ set
+ {
+ if (!AreDifferent(_GrundUnbekannt, value))
+ return;
+
+ _GrundUnbekannt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundUnbekannt, value), nameof(GrundUnbekannt));
+ FirePropertyChanged(nameof(GrundUnbekannt));
+ }
+ }
+ public bool GrundKeinKontakt
+ {
+ get { return _GrundKeinKontakt; }
+ set
+ {
+ if (!AreDifferent(_GrundKeinKontakt, value))
+ return;
+
+ _GrundKeinKontakt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundKeinKontakt, value), nameof(GrundKeinKontakt));
+ FirePropertyChanged(nameof(GrundKeinKontakt));
+ }
+ }
+ public bool GrundNichtAngetreten
+ {
+ get { return _GrundNichtAngetreten; }
+ set
+ {
+ if (!AreDifferent(_GrundNichtAngetreten, value))
+ return;
+
+ _GrundNichtAngetreten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundNichtAngetreten, value), nameof(GrundNichtAngetreten));
+ FirePropertyChanged(nameof(GrundNichtAngetreten));
+ }
+ }
+ public bool GrundAbbruchDerTatigkeit
+ {
+ get { return _GrundAbbruchDerTatigkeit; }
+ set
+ {
+ if (!AreDifferent(_GrundAbbruchDerTatigkeit, value))
+ return;
+
+ _GrundAbbruchDerTatigkeit = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundAbbruchDerTatigkeit, value), nameof(GrundAbbruchDerTatigkeit));
+ FirePropertyChanged(nameof(GrundAbbruchDerTatigkeit));
+ }
+ }
+ public bool GrundWiderruf
+ {
+ get { return _GrundWiderruf; }
+ set
+ {
+ if (!AreDifferent(_GrundWiderruf, value))
+ return;
+
+ _GrundWiderruf = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundWiderruf, value), nameof(GrundWiderruf));
+ FirePropertyChanged(nameof(GrundWiderruf));
+ }
+ }
+ public bool Grund459StPO
+ {
+ get { return _Grund459StPO; }
+ set
+ {
+ if (!AreDifferent(_Grund459StPO, value))
+ return;
+
+ _Grund459StPO = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Grund459StPO, value), nameof(Grund459StPO));
+ FirePropertyChanged(nameof(Grund459StPO));
+ }
+ }
+ public bool GrundAusbleibenDerZahlung
+ {
+ get { return _GrundAusbleibenDerZahlung; }
+ set
+ {
+ if (!AreDifferent(_GrundAusbleibenDerZahlung, value))
+ return;
+
+ _GrundAusbleibenDerZahlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.GrundAusbleibenDerZahlung, value), nameof(GrundAusbleibenDerZahlung));
+ FirePropertyChanged(nameof(GrundAusbleibenDerZahlung));
+ }
+ }
+ public bool BesonderheitMehrfacheBeauftragung
+ {
+ get { return _BesonderheitMehrfacheBeauftragung; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitMehrfacheBeauftragung, value))
+ return;
+
+ _BesonderheitMehrfacheBeauftragung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitMehrfacheBeauftragung, value), nameof(BesonderheitMehrfacheBeauftragung));
+ FirePropertyChanged(nameof(BesonderheitMehrfacheBeauftragung));
+ }
+ }
+ public bool BesonderheitMehrfacheVermittlung
+ {
+ get { return _BesonderheitMehrfacheVermittlung; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitMehrfacheVermittlung, value))
+ return;
+
+ _BesonderheitMehrfacheVermittlung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitMehrfacheVermittlung, value), nameof(BesonderheitMehrfacheVermittlung));
+ FirePropertyChanged(nameof(BesonderheitMehrfacheVermittlung));
+ }
+ }
+ public bool BesonderheitVermittlungAusHaft
+ {
+ get { return _BesonderheitVermittlungAusHaft; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitVermittlungAusHaft, value))
+ return;
+
+ _BesonderheitVermittlungAusHaft = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitVermittlungAusHaft, value), nameof(BesonderheitVermittlungAusHaft));
+ FirePropertyChanged(nameof(BesonderheitVermittlungAusHaft));
+ }
+ }
+ public bool BesonderheitDurchBGBWAufgesucht
+ {
+ get { return _BesonderheitDurchBGBWAufgesucht; }
+ set
+ {
+ if (!AreDifferent(_BesonderheitDurchBGBWAufgesucht, value))
+ return;
+
+ _BesonderheitDurchBGBWAufgesucht = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BesonderheitDurchBGBWAufgesucht, value), nameof(BesonderheitDurchBGBWAufgesucht));
+ FirePropertyChanged(nameof(BesonderheitDurchBGBWAufgesucht));
+ }
+ }
+
+ public void UpdateHoheDerGeldstrafe()
+ {
+ if (!Tagessatze.HasValue || !Tagessatzhohe.HasValue)
+ return;
+
+ HoheDerGeldstrafe = Tagessatze * Tagessatzhohe;
+ }
+
+ protected override void InitByDataContract(FalldatenDC pDataContract)
+ {
+ _EigenesAktenzeichen = pDataContract.EigenesAktenzeichen;
+ _Auftragseingang = pDataContract.Auftragseingang;
+ _Auftragsherkunft = pDataContract.Auftragsherkunft;
+ _Vermittlungsgrundlage = pDataContract.Vermittlungsgrundlage;
+ _Tagessatze = pDataContract.Tagessatze;
+ _Tagessatzhohe = pDataContract.Tagessatzhohe;
+ _HoheDerGeldstrafe = pDataContract.HoheDerGeldstrafe;
+ _ZuLeistendeArbeitsstunden = pDataContract.ZuLeistendeArbeitsstunden;
+ _Hinweis = pDataContract.Hinweis;
+ _Termin = pDataContract.Termin;
+ _FalldatenBearbeitungsstatus = pDataContract.FalldatenBearbeitungsstatus;
+ _Auftragsruckgabe = pDataContract.Auftragsruckgabe;
+ _Verlauf = pDataContract.Verlauf;
+ _AbgeleisteteStunden = pDataContract.AbgeleisteteStunden;
+ _ErsparteHafttage = pDataContract.ErsparteHafttage;
+ _GeleisteteRatenzahlung = pDataContract.GeleisteteRatenzahlung;
+ _Bemerkung = pDataContract.Bemerkung;
+ _GeleisteteEinmalzahlung = pDataContract.GeleisteteEinmalzahlung;
+ _GrundArbeitsunfahig = pDataContract.GrundArbeitsunfahig;
+ _GrundSuchtproblem = pDataContract.GrundSuchtproblem;
+ _GrundPsychischeProbleme = pDataContract.GrundPsychischeProbleme;
+ _GrundKeineMotivation = pDataContract.GrundKeineMotivation;
+ _GrundInHaft = pDataContract.GrundInHaft;
+ _GrundUnbekannt = pDataContract.GrundUnbekannt;
+ _GrundKeinKontakt = pDataContract.GrundKeinKontakt;
+ _GrundNichtAngetreten = pDataContract.GrundNichtAngetreten;
+ _GrundAbbruchDerTatigkeit = pDataContract.GrundAbbruchDerTatigkeit;
+ _GrundWiderruf = pDataContract.GrundWiderruf;
+ _Grund459StPO = pDataContract.Grund459StPO;
+ _GrundAusbleibenDerZahlung = pDataContract.GrundAusbleibenDerZahlung;
+ _BesonderheitMehrfacheBeauftragung = pDataContract.BesonderheitMehrfacheBeauftragung;
+ _BesonderheitMehrfacheVermittlung = pDataContract.BesonderheitMehrfacheVermittlung;
+ _BesonderheitVermittlungAusHaft = pDataContract.BesonderheitVermittlungAusHaft;
+ _BesonderheitDurchBGBWAufgesucht = pDataContract.BesonderheitDurchBGBWAufgesucht;
+ }
+
+ internal void InitValueListEntrys(ObservableSortCollection auftragsherkunfte, ObservableSortCollection vermittlungsgrundlage)
+ {
+ _Auftragsherkunfte = auftragsherkunfte;
+ _Vermittlungsgrundlagen = vermittlungsgrundlage;
+ }
+
+ protected override FalldatenDC MapToDataContract(FalldatenDC pDataContract, bool doCommit)
+ {
+ pDataContract.EigenesAktenzeichen = _EigenesAktenzeichen;
+ pDataContract.Auftragseingang = _Auftragseingang;
+ pDataContract.Auftragsherkunft = _Auftragsherkunft;
+ pDataContract.Vermittlungsgrundlage = _Vermittlungsgrundlage;
+ pDataContract.Tagessatze = _Tagessatze;
+ pDataContract.Tagessatzhohe = _Tagessatzhohe;
+ pDataContract.HoheDerGeldstrafe = _HoheDerGeldstrafe;
+ pDataContract.ZuLeistendeArbeitsstunden = _ZuLeistendeArbeitsstunden;
+ pDataContract.Hinweis = _Hinweis;
+ pDataContract.Termin = _Termin;
+ pDataContract.FalldatenBearbeitungsstatus = _FalldatenBearbeitungsstatus;
+ pDataContract.Auftragsruckgabe = _Auftragsruckgabe;
+ pDataContract.Verlauf = _Verlauf;
+ pDataContract.AbgeleisteteStunden = _AbgeleisteteStunden;
+ pDataContract.ErsparteHafttage = _ErsparteHafttage;
+ pDataContract.GeleisteteRatenzahlung = _GeleisteteRatenzahlung;
+ pDataContract.Bemerkung = _Bemerkung;
+ pDataContract.GeleisteteEinmalzahlung = _GeleisteteEinmalzahlung;
+ pDataContract.GrundArbeitsunfahig = _GrundArbeitsunfahig;
+ pDataContract.GrundSuchtproblem = _GrundSuchtproblem;
+ pDataContract.GrundPsychischeProbleme = _GrundPsychischeProbleme;
+ pDataContract.GrundKeineMotivation = _GrundKeineMotivation;
+ pDataContract.GrundInHaft = _GrundInHaft;
+ pDataContract.GrundUnbekannt = _GrundUnbekannt;
+ pDataContract.GrundKeinKontakt = _GrundKeinKontakt;
+ pDataContract.GrundNichtAngetreten = _GrundNichtAngetreten;
+ pDataContract.GrundAbbruchDerTatigkeit = _GrundAbbruchDerTatigkeit;
+ pDataContract.GrundWiderruf = _GrundWiderruf;
+ pDataContract.Grund459StPO = _Grund459StPO;
+ pDataContract.GrundAusbleibenDerZahlung = _GrundAusbleibenDerZahlung;
+ pDataContract.BesonderheitMehrfacheBeauftragung = _BesonderheitMehrfacheBeauftragung;
+ pDataContract.BesonderheitMehrfacheVermittlung = _BesonderheitMehrfacheVermittlung;
+ pDataContract.BesonderheitVermittlungAusHaft = _BesonderheitVermittlungAusHaft;
+ pDataContract.BesonderheitDurchBGBWAufgesucht = _BesonderheitDurchBGBWAufgesucht;
+
+ return pDataContract;
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/ViewModel/CustomerVM.cs b/BeWo/ViewModel/CustomerVM.cs
index 807601179..e9392d879 100644
--- a/BeWo/ViewModel/CustomerVM.cs
+++ b/BeWo/ViewModel/CustomerVM.cs
@@ -14,6 +14,7 @@ using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
+using BS.Shared.DataContracts.Wohnhilfe;
using BS.Shared.Extensions;
namespace BeWo.ViewModel
@@ -231,25 +232,32 @@ namespace BeWo.ViewModel
private ValueListEntryDC _AufenthaltsStatus;
private ObservableSortCollection _AufenthaltsStatuse;
-
private ObservableSortCollection _RoleInFamilys;
private ObservableSortCollection _EintragKategorien;
private SubstitutionNeed _SubstitutionNeed;
+ private CustomerFalldatenVM _CustomerFalldatenVM;
+ private CustomerWohnhilfeListVM _CustomerWohnhilfeListVM;
+ private CustomerGemeinnutzigeArbeitListVM _CustomerGemeinnutzigeArbeitListVM;
+ public CustomerVM()
+ {
+ }
public CustomerVM(CustomerDC pDataContract, IEnumerable pValueList, List pPossibleASCs, List pPossibleASVs, List pPossibleMedArten) : base(pDataContract, pDataContract.CustomerOid == null)
{
- var possibleDisabilities = pValueList.Where(vle => vle.Type == ValueListEntryType.DisabilityType);
- var possibleCustomerCareTypes = pValueList.Where(vle => vle.Type == ValueListEntryType.CustomerCareType);
- var possibleTerminationReasons = pValueList.Where(vle => vle.Type == ValueListEntryType.TerminationReasonType);
- var possiblePlacementObjectives = pValueList.Where(vle => vle.Type == ValueListEntryType.PlacementObjectiveType);
- var possibleNationalitaeten = pValueList.Where(vle => vle.Type == ValueListEntryType.Nationality);
- var possibleAufenthaltsStatuse = pValueList.Where(vle => vle.Type == ValueListEntryType.Aufenthaltsstatus);
- var possibleFamilyStatuse = pValueList.Where(vle => vle.Type == ValueListEntryType.RoleInFamily);
- var possibleEintragKategorien = pValueList.Where(vle => vle.Type == ValueListEntryType.NotizenKategorieCustomer);
+ var possibleDisabilities = pValueList.Where(vle => vle.Type == ValueListEntryType.DisabilityType);
+ var possibleCustomerCareTypes = pValueList.Where(vle => vle.Type == ValueListEntryType.CustomerCareType);
+ var possibleTerminationReasons = pValueList.Where(vle => vle.Type == ValueListEntryType.TerminationReasonType);
+ var possiblePlacementObjectives = pValueList.Where(vle => vle.Type == ValueListEntryType.PlacementObjectiveType);
+ var possibleNationalitaeten = pValueList.Where(vle => vle.Type == ValueListEntryType.Nationality);
+ var possibleAufenthaltsStatuse = pValueList.Where(vle => vle.Type == ValueListEntryType.Aufenthaltsstatus);
+ var possibleFamilyStatuse = pValueList.Where(vle => vle.Type == ValueListEntryType.RoleInFamily);
+ var possibleEintragKategorien = pValueList.Where(vle => vle.Type == ValueListEntryType.NotizenKategorieCustomer);
+ var possibleauftragsherkunfte = pValueList.Where(vle => vle.Type == ValueListEntryType.Auftragsherkunft);
+ var possiblevermittlungsgrundlage = pValueList.Where(vle => vle.Type == ValueListEntryType.Vermittlungsgrundlage);
- _PossibleDisabilities = pDataContract.Disabilities != null
+ _PossibleDisabilities = pDataContract.Disabilities != null
? new ObservableSortCollection(possibleDisabilities.Except(pDataContract.Disabilities), Comparer.ValueListEntryDCComparer)
: new ObservableSortCollection(possibleDisabilities, Comparer.ValueListEntryDCComparer);
@@ -260,8 +268,13 @@ namespace BeWo.ViewModel
_AufenthaltsStatuse = new ObservableSortCollection(possibleAufenthaltsStatuse, Comparer.ValueListEntryDCComparer);
_RoleInFamilys = new ObservableSortCollection(possibleFamilyStatuse,Comparer.ValueListEntryDCComparer);
_EintragKategorien = new ObservableSortCollection(possibleEintragKategorien, Comparer.ValueListEntryDCComparer);
+ var auftragsherkunfte = new ObservableSortCollection(possibleauftragsherkunfte, Comparer.ValueListEntryDCComparer);
+ var vermittlungsgrundlage = new ObservableSortCollection(possiblevermittlungsgrundlage, Comparer.ValueListEntryDCComparer);
- _MedArten = new BindingList(pPossibleMedArten);
+ _CustomerFalldatenVM.InitValueListEntrys(auftragsherkunfte, vermittlungsgrundlage);
+ _CustomerGemeinnutzigeArbeitListVM.InitValueListEntrys(auftragsherkunfte, vermittlungsgrundlage);
+
+ _MedArten = new BindingList(pPossibleMedArten);
pPossibleASCs.Sort((x, y) => x.Position.CompareTo(y.Position));
_AssessmentSheetCategories = new BindingList(pPossibleASCs);
@@ -290,7 +303,11 @@ namespace BeWo.ViewModel
Arbeitszeiten = new ArbeitszeitListVM(DataContract.Arbeitszeiten);
}
- public ArbeitszeitListVM Arbeitszeiten
+ public bool PermissionFalldatenView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_GemeinnutzigeArbeit_View);
+ public bool PermissionGemeinnutzigeArbeitView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_GemeinnutzigeArbeit_View);
+ public bool PermissionWohnhilfeView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_Wohnhilfe_View);
+
+ public ArbeitszeitListVM Arbeitszeiten
{
get => _Arbeitszeiten;
@@ -300,8 +317,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Arbeitszeiten);
}
}
-
-
public SubstitutionNeed SubstitutionNeed
{
get => _SubstitutionNeed;
@@ -316,7 +331,6 @@ namespace BeWo.ViewModel
}
}
}
-
//Wird noch benötigt
//public BargeldverwaltungsVM Bargeldverwaltung
//{
@@ -329,7 +343,6 @@ namespace BeWo.ViewModel
// FirePropertyChanged(PropertyName_Bargeldverwaltung);
// }
//}
-
public AbsenceTimeListVM AbsenceTimes
{
get => _AbsenceTimes;
@@ -340,7 +353,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_AbsenceTimes);
}
}
-
public CompactPersonDC Ansprechpartner
{
get { return _Ansprechpartner; }
@@ -355,7 +367,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Ansprechpartner);
}
}
-
public BindingList MedArten
{
get { return _MedArten; }
@@ -365,7 +376,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_MedArten);
}
}
-
public BindingList AssessmentSheetCategories
{
get { return _AssessmentSheetCategories; }
@@ -376,7 +386,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_AssessmentSheetCategories);
}
}
-
public AssessmentSheetCategoryListVM IndividualAssessmentSheetCategories
{
get { return _IndividualAssessmentSheetCategories; }
@@ -387,7 +396,6 @@ namespace BeWo.ViewModel
FirePropertyChanged("IndividualAssessmentSheetCategories");
}
}
-
public string Childs
{
get { return _Childs; }
@@ -404,7 +412,6 @@ namespace BeWo.ViewModel
}
}
}
-
public CustomerCostBearerRelationListVM CostBearers
{
get { return _CostBearers; }
@@ -415,12 +422,10 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_CostBearers);
}
}
-
public ObservableSortCollection CustomerCareTypes
{
get { return _CustomerCareTypes ?? (_CustomerCareTypes = new ObservableSortCollection(Comparer.ValueListEntryDCComparer)); }
}
-
public DateTime? DateOfBirth
{
get { return _DateOfBirth; }
@@ -437,7 +442,6 @@ namespace BeWo.ViewModel
}
}
}
-
public DateTime? AufenthaltGueltigBis
{
get { return _AufenthaltGueltigBis; }
@@ -454,8 +458,6 @@ namespace BeWo.ViewModel
}
}
}
-
-
public string DebitorNumber
{
get { return _DebitorNumber; }
@@ -472,7 +474,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string CostCenter
{
get { return _CostCenter; }
@@ -489,7 +490,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Diagnosis
{
get { return _Diagnosis; }
@@ -506,12 +506,10 @@ namespace BeWo.ViewModel
}
}
}
-
public ObservableSortCollection Disabilities
{
get { return _Disabilities ?? (_Disabilities = new ObservableSortCollection(Comparer.ValueListEntryDCComparer)); }
}
-
public string EMail
{
get { return _EMail; }
@@ -529,7 +527,6 @@ namespace BeWo.ViewModel
}
}
}
-
public CustomerEmployeeRelationListVM EmployeeRelations
{
get { return _EmployeeRelations; }
@@ -540,7 +537,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_EmployeeRelations);
}
}
-
public WohnheimCustomerRelationListVM WohnheimRelations
{
get { return _WohnheimRelations; }
@@ -551,7 +547,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_WohnheimRelations);
}
}
-
public CustomerTeamRelationListVM TeamRelations
{
get { return _TeamRelations; }
@@ -561,8 +556,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_TeamRelations);
}
}
-
-
public CustomerPersonRelationListVM EnvironmentPersons
{
get
@@ -576,8 +569,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_EnvironmentPersons);
}
}
-
-
public CustomerPersonRelationListVM EnvironmentPersonsWithFamily
{
get
@@ -590,7 +581,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_EnvironmentPersonsWithFamily);
}
}
-
public CustomerOrganisationRelationListVM EnvironmentOrganisations
{
get { return _EnvironmentOrganisations; }
@@ -601,7 +591,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_EnvironmentOrganisations);
}
}
-
public string EquityContribution
{
get { return String.Format("{0:n}", _EquityContribution); }
@@ -620,7 +609,6 @@ namespace BeWo.ViewModel
}
}
}
-
public FamilyStatus? FamilyStatus
{
get { return _FamilyStatus; }
@@ -635,7 +623,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Fax
{
get { return _Fax; }
@@ -671,9 +658,7 @@ namespace BeWo.ViewModel
}
}
}
-
public BindingList ICD10Codes { get; set; }
-
public string ICD10Diagnosis
{
get { return _ICD10Diagnosis; }
@@ -690,7 +675,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string InvoiceAddressLine1
{
get { return _InvoiceAddressLine1; }
@@ -705,7 +689,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string InvoiceAddressLine2
{
get { return _InvoiceAddressLine2; }
@@ -720,7 +703,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string InvoiceAddressPostalCode
{
get { return _InvoiceAddressPostalCode; }
@@ -735,7 +717,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string InvoiceAddressStreet
{
get { return _InvoiceAddressStreet; }
@@ -750,7 +731,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string InvoiceAddressTown
{
get { return _InvoiceAddressTown; }
@@ -765,7 +745,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool IsAdvised
{
get { return _IsAdvised; }
@@ -784,7 +763,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool IsArchived
{
get => _IsArchived;
@@ -801,7 +779,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ActivationTypeId ActivationType
{
get => _ActivationType;
@@ -816,8 +793,7 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_ActivationType);
}
}
- }
-
+ }
public bool IsMigrant
{
get { return _IsMigrant; }
@@ -832,7 +808,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool IsAttended
{
get { return _IsAttended; }
@@ -851,7 +826,6 @@ namespace BeWo.ViewModel
}
}
}
-
public override bool IsDirty
{
get
@@ -864,10 +838,12 @@ namespace BeWo.ViewModel
return base.IsDirty || TeamRelations.IsDirty || EmployeeRelations.IsDirty || _EnvironmentPersons.IsDirty ||
_EnvironmentOrganisations.IsDirty || _AbsenceTimes.IsDirty || _VarFields.IsDirty ||
CostBearers.IsDirty || _IndividualAssessmentSheetCategories.IsDirty ||
- _PlacementList.IsDirty || _MedVerordnungslisten.IsDirty || _EnvironmentPersonsWithFamily.IsDirty || _Arbeitszeiten.IsDirty;
+ _PlacementList.IsDirty || _MedVerordnungslisten.IsDirty || _EnvironmentPersonsWithFamily.IsDirty || _Arbeitszeiten.IsDirty ||
+ _CustomerFalldatenVM.IsDirty
+ //|| _CustomerWohnhilfeListVM.IsDirty
+ ;
}
}
-
public bool IsFemale
{
get { return _IsFemale; }
@@ -888,7 +864,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool IsMale
{
get { return _IsMale; }
@@ -909,7 +884,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool IsDivers
{
get { return _IsDivers; }
@@ -930,7 +904,6 @@ namespace BeWo.ViewModel
}
}
}
-
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string LastName
{
@@ -948,7 +921,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Medication
{
get { return _Medication; }
@@ -963,7 +935,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string VersichertenStatus
{
get { return _VersichertenStatus; }
@@ -978,7 +949,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Environment
{
get { return _Environment; }
@@ -993,7 +963,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string MobilePhone
{
get { return _MobilePhone; }
@@ -1012,7 +981,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Migrationshintergrund
{
get { return this._Migrationshintergrund; }
@@ -1029,7 +997,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Notice
{
get { return _Notice; }
@@ -1050,7 +1017,6 @@ namespace BeWo.ViewModel
}
}
}
-
public CompactOrganisationDC Jugendamt
{
get { return _Jugendamt; }
@@ -1065,7 +1031,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Jugendamt);
}
}
-
public string Phone
{
get { return _Phone; }
@@ -1083,7 +1048,6 @@ namespace BeWo.ViewModel
}
}
}
-
public PlacementListVM PlacementList
{
get { return _PlacementList; }
@@ -1094,7 +1058,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_PlacementList);
}
}
-
public ObservableSortCollection PlacementObjectives
{
get
@@ -1107,17 +1070,14 @@ namespace BeWo.ViewModel
return _PlacementObjectives;
}
}
-
public ObservableSortCollection PossibleCustomerCareTypes
{
get { return _PossibleCustomerCareTypes; }
}
-
public ObservableSortCollection PossibleDisabilities
{
get { return _PossibleDisabilities; }
}
-
public string PostalCode
{
get { return _PostalCode; }
@@ -1134,7 +1094,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Profession
{
get { return _Profession; }
@@ -1151,7 +1110,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string ReferenceNumber
{
get { return _ReferenceNumber; }
@@ -1168,7 +1126,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Street
{
get { return _Street; }
@@ -1185,7 +1142,6 @@ namespace BeWo.ViewModel
}
}
}
-
public int? DistanceInMeter
{
get { return _DistanceInMeter; }
@@ -1200,7 +1156,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string AddressLine1
{
get { return this._AddressLine1; }
@@ -1215,7 +1170,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Kindesmutter
{
get { return _Kindesmutter; }
@@ -1230,7 +1184,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Kindesmutter);
}
}
-
public string Kindesvater
{
get { return _Kindesvater; }
@@ -1245,7 +1198,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Kindesvater);
}
}
-
public string Geschwister
{
get { return _Geschwister; }
@@ -1260,7 +1212,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Geschwister);
}
}
-
public string Vormund
{
get { return _Vormund; }
@@ -1275,7 +1226,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Vormund);
}
}
-
public DateTime? TerminationDate
{
get { return _TerminationDate; }
@@ -1292,7 +1242,6 @@ namespace BeWo.ViewModel
}
}
}
-
public DateTime? AssistanceBegin
{
get { return _AssistanceBegin; }
@@ -1309,7 +1258,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ValueListEntryDC TerminationReason
{
get { return _TerminationReason; }
@@ -1326,12 +1274,10 @@ namespace BeWo.ViewModel
}
}
}
-
public ObservableSortCollection TerminationReasons
{
get { return _TerminationReasons ?? (_TerminationReasons = new ObservableSortCollection()); }
}
-
public string Town
{
get { return _Town; }
@@ -1348,7 +1294,6 @@ namespace BeWo.ViewModel
}
}
}
-
public VarFieldListVM VarFields
{
get { return _VarFields; }
@@ -1362,7 +1307,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string AusstVersAmt
{
get { return _AusstVersAmt; }
@@ -1377,8 +1321,7 @@ namespace BeWo.ViewModel
}
}
}
-
- public DateTime? AusweisGueltigVon
+ public DateTime? AusweisGueltigVon
{
get { return _AusweisGueltigVon; }
@@ -1392,7 +1335,6 @@ namespace BeWo.ViewModel
}
}
}
-
public DateTime? AusweisGueltigBis
{
get { return _AusweisGueltigBis; }
@@ -1407,7 +1349,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool AusweisUnbefristetGueltig
{
get { return _AusweisUnbefristetGueltig; }
@@ -1428,7 +1369,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string AusweisAktenzeichen
{
get { return _AusweisAktenzeichen; }
@@ -1445,7 +1385,6 @@ namespace BeWo.ViewModel
}
}
}
-
public DateTime? BeiblattGueltigBis
{
get { return _BeiblattGueltigBis; }
@@ -1460,7 +1399,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string GradDerBehinderung
{
get { return _GradDerBehinderung; }
@@ -1474,8 +1412,7 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_GradDerBehinderung);
}
}
- }
-
+ }
public Byte[] CustomerImage
{
get { return _CustomerImage; }
@@ -1490,7 +1427,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ValueListEntryDC Nationalitaet
{
get { return this._Nationalitaet; }
@@ -1507,7 +1443,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ValueListEntryDC AufenthaltsStatus
{
get { return this._AufenthaltsStatus; }
@@ -1524,7 +1459,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ObservableSortCollection Nationalitaeten
{
get
@@ -1537,7 +1471,6 @@ namespace BeWo.ViewModel
return this._Nationalitaeten;
}
}
-
public ObservableSortCollection RoleInFamilys
{
get
@@ -1550,7 +1483,6 @@ namespace BeWo.ViewModel
return this._RoleInFamilys;
}
}
-
public ObservableSortCollection AufenthaltsStatuse
{
get
@@ -1563,7 +1495,6 @@ namespace BeWo.ViewModel
return this._AufenthaltsStatuse;
}
}
-
public ObservableCollection BehinderungsartenListe
{
get { return _BehinderungsartenListe ?? (_BehinderungsartenListe = new ObservableCollection()); }
@@ -1579,7 +1510,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ObservableCollection MerkzeichenListe
{
get { return _MerkzeichenListe ?? (_MerkzeichenListe = new ObservableCollection()); }
@@ -1595,13 +1525,11 @@ namespace BeWo.ViewModel
}
}
}
-
public void EnableLogging(bool enable, StringBuilder log)
{
_EnableLogging = enable;
_Log = log;
}
-
public bool VertretungGewuenscht
{
get { return _VertretungGewuenscht; }
@@ -1616,7 +1544,6 @@ namespace BeWo.ViewModel
}
}
}
-
public int AbWelchemKrankheitsTag
{
get
@@ -1636,8 +1563,7 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_AbWelchemKrankheitsTag);
}
}
- }
-
+ }
public bool VertretungDringendErforderlich
{
get { return _VertretungDringendErforderlich ; }
@@ -1652,7 +1578,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool Pflege
{
get { return _Pflege; }
@@ -1667,8 +1592,7 @@ namespace BeWo.ViewModel
}
}
}
-
- public bool Toilettengang
+ public bool Toilettengang
{
get { return _Toilettengang; }
@@ -1682,7 +1606,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool Aggressiv
{
get { return _Aggressiv; }
@@ -1697,7 +1620,6 @@ namespace BeWo.ViewModel
}
}
}
-
public bool Hygienebelehrung
{
get { return _Hygienebelehrung; }
@@ -1712,7 +1634,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Schutzstufe
{
get { return _Schutzstufe; }
@@ -1727,7 +1648,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Uebernahmeort
{
get { return _Uebernahmeort; }
@@ -1742,7 +1662,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Verhalten
{
get { return _Verhalten; }
@@ -1757,7 +1676,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string Betreuungsbedarf
{
get { return _Betreuungsbedarf; }
@@ -1772,7 +1690,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string BemerkungenSbd
{
get { return _BemerkungenSbd; }
@@ -1787,7 +1704,6 @@ namespace BeWo.ViewModel
}
}
}
-
public string HealthInsurance
{
get { return _HealthInsurance; }
@@ -1816,7 +1732,6 @@ namespace BeWo.ViewModel
}
}
}
-
public ObservableSortCollection EintragKategorien
{
get => _EintragKategorien;
@@ -1830,10 +1745,48 @@ namespace BeWo.ViewModel
}
}
}
+ public CustomerFalldatenVM CustomerFalldatenVM
+ {
+ get { return _CustomerFalldatenVM; }
- #region Medikamentenverordnungslisten
+ set
+ {
+ if (!AreDifferent(_CustomerFalldatenVM, value))
+ return;
+ _CustomerFalldatenVM = value;
+ FirePropertyChanged(nameof(CustomerFalldatenVM));
+ }
+ }
+ public CustomerWohnhilfeListVM CustomerWohnhilfeListVM
+ {
+ get { return _CustomerWohnhilfeListVM; }
- private MedikamentenverordnungslisteListVM _MedVerordnungslisten;
+ set
+ {
+ if (!AreDifferent(CustomerWohnhilfeListVM, value))
+ return;
+ _CustomerWohnhilfeListVM = value;
+ FirePropertyChanged(nameof(CustomerWohnhilfeListVM));
+ }
+ }
+
+ public CustomerGemeinnutzigeArbeitListVM CustomerGemeinnutzigeArbeitListVM
+ {
+ get { return _CustomerGemeinnutzigeArbeitListVM; }
+
+ set
+ {
+ if (!AreDifferent(CustomerGemeinnutzigeArbeitListVM, value))
+ return;
+ _CustomerGemeinnutzigeArbeitListVM = value;
+ FirePropertyChanged(nameof(CustomerGemeinnutzigeArbeitListVM));
+ }
+ }
+
+
+ #region Medikamentenverordnungslisten
+
+ private MedikamentenverordnungslisteListVM _MedVerordnungslisten;
public MedikamentenverordnungslisteListVM MedVerordnungslisten
{
@@ -1865,17 +1818,14 @@ namespace BeWo.ViewModel
{
get { return MedVerordnungslisten.VMList.FirstOrDefault(vm => vm.Gueltig && false == vm.MedListType); }
}
-
public MedikamentenverordnungslisteVM Bedarfsmedikamentenverordnungsliste
{
get { return MedVerordnungslisten.VMList.FirstOrDefault(vm => vm.Gueltig && vm.MedListType); }
}
-
public List UngueltigeVerordnungen
{
get { return MedVerordnungslisten.VMList.Where(vm => !vm.Gueltig).ToList(); }
}
-
public string CustomerAlias
{
get { return _CustomerAlias; }
@@ -1889,8 +1839,7 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_CustomerAlias);
}
}
- }
-
+ }
public Pflegegrad? Pflegegrad {
get { return _Pflegegrad; }
@@ -2066,7 +2015,9 @@ namespace BeWo.ViewModel
}
}
- EnvironmentPersons = VMFactory.CreateCustomerEnvironmentPersonRelListVM(dcListUmfeld, ValueListEntryType.EnvironmentPersonType);
+ CustomerFalldatenVM = new CustomerFalldatenVM(this, pDataContract.FalldatenDC ?? (pDataContract.FalldatenDC = new FalldatenDC(true)));
+
+ EnvironmentPersons = VMFactory.CreateCustomerEnvironmentPersonRelListVM(dcListUmfeld, ValueListEntryType.EnvironmentPersonType);
EnvironmentPersonsWithFamily = VMFactory.CreateCustomerEnvironmentPersonRelListVM(dcListFamily, ValueListEntryType.RoleInFamily);
EnvironmentOrganisations = VMFactory.CreateCustomerEnvironmentOrganisationRelListVM(pDataContract.EnvironmentOrganisations ?? (pDataContract.EnvironmentOrganisations = new List()));
@@ -2083,8 +2034,11 @@ namespace BeWo.ViewModel
ICD10Codes.ListChanged += (s, e) => StoreDirtyInformation(true, "ICD10Codes");
MedVerordnungslisten = VMFactory.CreateMedikementenverordnungslisteListVM(pDataContract.Medikamentenverordnungslisten);
- }
+ CustomerWohnhilfeListVM = new CustomerWohnhilfeListVM(this, pDataContract.CustomerWohnhilfeDC ?? (pDataContract.CustomerWohnhilfeDC = new List()));
+
+ CustomerGemeinnutzigeArbeitListVM = new CustomerGemeinnutzigeArbeitListVM(pDataContract.CustomerGemeinnutzigeArbeitDC ?? (pDataContract.CustomerGemeinnutzigeArbeitDC = new List()));
+ }
protected override CustomerDC MapToDataContract(CustomerDC pDataContract, bool doCommit)
{
pDataContract.DateOfBirth = _DateOfBirth;
@@ -2146,6 +2100,15 @@ namespace BeWo.ViewModel
pDataContract.SubstitutionNeed = _SubstitutionNeed;
pDataContract.AufenthaltGueltigBis = _AufenthaltGueltigBis;
+ var falldaten_new_and_no_changed = _CustomerFalldatenVM.IsNew && !_CustomerFalldatenVM.IsDirty;
+
+ if (!falldaten_new_and_no_changed)
+ {
+ pDataContract.FalldatenDC = _CustomerFalldatenVM.CommitToDataContract();
+ }
+
+ if(_CustomerFalldatenVM.IsNew && !_CustomerFalldatenVM.IsDirty)
+
if (_MerkzeichenListe != null)
{
pDataContract.MerkzeichenListe = _MerkzeichenListe.ToList();
@@ -2247,9 +2210,13 @@ namespace BeWo.ViewModel
pDataContract.Arbeitszeiten = _Arbeitszeiten.CopyToDCList(doCommit);
}
+ if(_CustomerWohnhilfeListVM != null)
+ {
+ pDataContract.CustomerWohnhilfeDC = _CustomerWohnhilfeListVM.CopyToDCList(doCommit);
+ }
+
return pDataContract;
}
-
private void CommitContact(string pValue, ContactType pContactType)
{
var lOldContactDCs = DataContract.ContactInformations != null ? DataContract.ContactInformations.ToList() : new List();
@@ -2277,7 +2244,6 @@ namespace BeWo.ViewModel
DataContract.ContactInformations = lOldContactDCs;
}
-
private void Log(string log)
{
if (_EnableLogging && _Log != null)
diff --git a/BeWo/ViewModel/CustomerWohnhilfeVM.cs b/BeWo/ViewModel/CustomerWohnhilfeVM.cs
new file mode 100644
index 000000000..87a357c65
--- /dev/null
+++ b/BeWo/ViewModel/CustomerWohnhilfeVM.cs
@@ -0,0 +1,203 @@
+using BeWo.ViewModel.Wohnhilfe;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+using DevExpress.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel
+{
+ public class CustomerWohnhilfeVM : AbstractDCMapperVM
+ {
+ private static int counter = 0;
+
+ private string _Displayname;
+
+ private CustomerWohnhilfeBereichBundVM _BereichBundVM;
+ private CustomerWohnhilfeBereichEinkommenUndArbeitVM _BereichEinkommenUndArbeitVM;
+ private CustomerWohnhilfeBereichSozialeKontakteVM _BereichSozialeKontakteVM;
+ private CustomerWohnhilfeBereichSozialstrukturVM _BereichSozialstrukturVM;
+
+ public CustomerWohnhilfeVM()
+ {
+ _BereichBundVM = new CustomerWohnhilfeBereichBundVM();
+
+ //_BereichBundVM.Verbandszugehorigkeit = Verbandszugehorigkeit.Arbeiterwohlfahrt;
+ //_BereichBundVM.Geschlecht = Geschlecht.Mannlich;
+ //_BereichBundVM.AlterAmStichtag = 1000;
+ //_BereichBundVM.BerichtseinheitID = 192321321;
+
+ _BereichEinkommenUndArbeitVM = new CustomerWohnhilfeBereichEinkommenUndArbeitVM();
+ _BereichSozialeKontakteVM = new CustomerWohnhilfeBereichSozialeKontakteVM();
+ _BereichSozialstrukturVM = new CustomerWohnhilfeBereichSozialstrukturVM();
+ }
+
+ public CustomerWohnhilfeVM(CustomerWohnhilfeDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public override bool IsDirty => base.IsDirty ||
+ _BereichBundVM.IsDirty ||
+ _BereichEinkommenUndArbeitVM.IsDirty ||
+ _BereichSozialeKontakteVM.IsDirty ||
+ _BereichSozialstrukturVM.IsDirty;
+
+ public string Displayname
+ {
+ get { return _Displayname; }
+ set
+ {
+ if (!AreDifferent(Displayname, value))
+ return;
+
+ _Displayname = value;
+ FirePropertyChanged(nameof(Displayname));
+ }
+ }
+
+ public CustomerWohnhilfeBereichBundVM BereichBundVM
+ {
+ get { return _BereichBundVM; }
+ set
+ {
+ if (!AreDifferent(BereichBundVM, value))
+ return;
+
+ _BereichBundVM = value;
+ FirePropertyChanged(nameof(BereichBundVM));
+ }
+ }
+
+ public CustomerWohnhilfeBereichEinkommenUndArbeitVM BereichEinkommenUndArbeitVM
+ {
+ get { return _BereichEinkommenUndArbeitVM; }
+ set
+ {
+ if (!AreDifferent(BereichEinkommenUndArbeitVM, value))
+ return;
+
+ _BereichEinkommenUndArbeitVM = value;
+ FirePropertyChanged(nameof(BereichEinkommenUndArbeitVM));
+ }
+ }
+
+ public CustomerWohnhilfeBereichSozialeKontakteVM BereichSozialeKontakteVM
+ {
+ get { return _BereichSozialeKontakteVM; }
+ set
+ {
+ if (!AreDifferent(BereichSozialeKontakteVM, value))
+ return;
+
+ _BereichSozialeKontakteVM = value;
+ FirePropertyChanged(nameof(BereichSozialeKontakteVM));
+ }
+ }
+
+ public CustomerWohnhilfeBereichSozialstrukturVM BereichSozialstrukturVM
+ {
+ get { return _BereichSozialstrukturVM; }
+ set
+ {
+ if (!AreDifferent(BereichSozialstrukturVM, value))
+ return;
+
+ _BereichSozialstrukturVM = value;
+ FirePropertyChanged(nameof(BereichSozialstrukturVM));
+ }
+ }
+
+ protected override void InitByDataContract(CustomerWohnhilfeDC dc)
+ {
+ Displayname = "Test " + counter++;
+
+ _BereichBundVM = new CustomerWohnhilfeBereichBundVM(dc.BereichBundDC ?? (dc.BereichBundDC = new CustomerWohnhilfeBereichBundDC()));
+ _BereichEinkommenUndArbeitVM = new CustomerWohnhilfeBereichEinkommenUndArbeitVM(dc.BereichEinkommenUndArbeitDC ?? (dc.BereichEinkommenUndArbeitDC = new CustomerWohnhilfeBereichEinkommenUndArbeitDC())); ;
+ _BereichSozialeKontakteVM = new CustomerWohnhilfeBereichSozialeKontakteVM(dc.BereichSozialeKontakteDC ?? (dc.BereichSozialeKontakteDC = new CustomerWohnhilfeBereichSozialeKontakteDC()));
+ _BereichSozialstrukturVM = new CustomerWohnhilfeBereichSozialstrukturVM(dc.BereichSozialstrukturDC ?? (dc.BereichSozialstrukturDC = new CustomerWohnhilfeBereichSozialstrukturDC()));
+ }
+
+ protected override CustomerWohnhilfeDC MapToDataContract(CustomerWohnhilfeDC pDataContract, bool doCommit)
+ {
+ pDataContract.Dispalyname = _Displayname;
+
+ pDataContract.BereichBundDC = _BereichBundVM.CommitToDataContract();
+ pDataContract.BereichEinkommenUndArbeitDC = _BereichEinkommenUndArbeitVM.CommitToDataContract();
+ pDataContract.BereichSozialeKontakteDC = _BereichSozialeKontakteVM.CommitToDataContract();
+ pDataContract.BereichSozialstrukturDC = _BereichSozialstrukturVM.CommitToDataContract();
+
+ return pDataContract;
+ }
+
+ public void InitByViewModel(CustomerWohnhilfeVM old_vm)
+ {
+ if (old_vm is null)
+ return;
+
+ BereichBundVM.AlterAmStichtag = old_vm.BereichBundVM.AlterAmStichtag;
+ BereichBundVM.Angebot = old_vm.BereichBundVM.Angebot;
+ BereichBundVM.BerichtseinheitID = old_vm.BereichBundVM.BerichtseinheitID;
+ BereichBundVM.Geschlecht = old_vm.BereichBundVM.Geschlecht;
+ BereichBundVM.Haushaltsgrosse = old_vm.BereichBundVM.Haushaltsgrosse;
+ BereichBundVM.OrtDerEinrichtung = old_vm.BereichBundVM.OrtDerEinrichtung;
+ BereichBundVM.Unterbringungsart = old_vm.BereichBundVM.Unterbringungsart;
+ BereichBundVM.Verbandszugehorigkeit = old_vm.BereichBundVM.Verbandszugehorigkeit;
+
+ BereichEinkommenUndArbeitVM.BeginnAufstockungEinkommen = old_vm.BereichEinkommenUndArbeitVM.BeginnAufstockungEinkommen;
+ BereichEinkommenUndArbeitVM.BeginnBeschaftigungsstatus = old_vm.BereichEinkommenUndArbeitVM.BeginnBeschaftigungsstatus;
+ BereichEinkommenUndArbeitVM.BeginnEigenesBankkonto = old_vm.BereichEinkommenUndArbeitVM.BeginnEigenesBankkonto;
+ BereichEinkommenUndArbeitVM.BeginnEinkommenssituation = old_vm.BereichEinkommenUndArbeitVM.BeginnEinkommenssituation;
+ BereichEinkommenUndArbeitVM.Berufsabschluss = old_vm.BereichEinkommenUndArbeitVM.Berufsabschluss;
+ BereichEinkommenUndArbeitVM.DauerArbeitslosigkeit = old_vm.BereichEinkommenUndArbeitVM.DauerArbeitslosigkeit;
+ BereichEinkommenUndArbeitVM.EndeAufstockungEinkommen = old_vm.BereichEinkommenUndArbeitVM.EndeAufstockungEinkommen;
+ BereichEinkommenUndArbeitVM.EndeBeschaftigungsstatus = old_vm.BereichEinkommenUndArbeitVM.EndeBeschaftigungsstatus;
+ BereichEinkommenUndArbeitVM.EndeEigenesBankkonto = old_vm.BereichEinkommenUndArbeitVM.EndeEigenesBankkonto;
+ BereichEinkommenUndArbeitVM.EndeEinkommenssituation = old_vm.BereichEinkommenUndArbeitVM.EndeEinkommenssituation;
+ BereichEinkommenUndArbeitVM.ErwerbsfahigkeitSinnSGB = old_vm.BereichEinkommenUndArbeitVM.ErwerbsfahigkeitSinnSGB;
+ BereichEinkommenUndArbeitVM.Uberschuldung = old_vm.BereichEinkommenUndArbeitVM.Uberschuldung;
+
+ BereichSozialeKontakteVM.BeginnKontaktArzt = old_vm.BereichSozialeKontakteVM.BeginnKontaktArzt;
+ BereichSozialeKontakteVM.BeginnKontaktFreundenBekannten = old_vm.BereichSozialeKontakteVM.BeginnKontaktFreundenBekannten;
+ BereichSozialeKontakteVM.BeginnKontaktMindKinder = old_vm.BereichSozialeKontakteVM.BeginnKontaktMindKinder;
+ BereichSozialeKontakteVM.BeginnKontaktPartner = old_vm.BereichSozialeKontakteVM.BeginnKontaktPartner;
+ BereichSozialeKontakteVM.BeginnKontaktSelbsthilfe = old_vm.BereichSozialeKontakteVM.BeginnKontaktSelbsthilfe;
+ BereichSozialeKontakteVM.BeginnKontaktSonstige = old_vm.BereichSozialeKontakteVM.BeginnKontaktSonstige;
+ BereichSozialeKontakteVM.BeginnKontaktVolljahrKinderElternVerwandten = old_vm.BereichSozialeKontakteVM.BeginnKontaktVolljahrKinderElternVerwandten;
+ BereichSozialeKontakteVM.BeginnKrankenversicherung = old_vm.BereichSozialeKontakteVM.BeginnKrankenversicherung;
+ BereichSozialeKontakteVM.BeginnSozialeKontakte = old_vm.BereichSozialeKontakteVM.BeginnSozialeKontakte;
+ BereichSozialeKontakteVM.EndeKontaktArzt = old_vm.BereichSozialeKontakteVM.EndeKontaktArzt;
+ BereichSozialeKontakteVM.EndeKontaktFreundenBekannten = old_vm.BereichSozialeKontakteVM.EndeKontaktFreundenBekannten;
+ BereichSozialeKontakteVM.EndeKontaktMindKinder = old_vm.BereichSozialeKontakteVM.EndeKontaktMindKinder;
+ BereichSozialeKontakteVM.EndeKontaktPartner = old_vm.BereichSozialeKontakteVM.EndeKontaktPartner;
+ BereichSozialeKontakteVM.EndeKontaktSelbsthilfe = old_vm.BereichSozialeKontakteVM.EndeKontaktSelbsthilfe;
+ BereichSozialeKontakteVM.EndeKontaktSonstige = old_vm.BereichSozialeKontakteVM.EndeKontaktSonstige;
+ BereichSozialeKontakteVM.EndeKontaktVolljahrKinderElternVerwandten = old_vm.BereichSozialeKontakteVM.EndeKontaktVolljahrKinderElternVerwandten;
+ BereichSozialeKontakteVM.EndeKrankenversicherung = old_vm.BereichSozialeKontakteVM.EndeKrankenversicherung;
+ BereichSozialeKontakteVM.EndeSozialeKontakte = old_vm.BereichSozialeKontakteVM.EndeSozialeKontakte;
+ BereichSozialeKontakteVM.VorlageSchwerbehindertenausweises = old_vm.BereichSozialeKontakteVM.VorlageSchwerbehindertenausweises;
+
+ BereichSozialstrukturVM.Bundesland = old_vm.BereichSozialstrukturVM.Bundesland;
+ BereichSozialstrukturVM.IsWohnungslosenhilfeSafe = old_vm.BereichSozialstrukturVM.IsWohnungslosenhilfe;
+ BereichSozialstrukturVM.IsStraffaligenhilfeSafe = old_vm.BereichSozialstrukturVM.IsStraffaligenhilfe;
+ BereichSozialstrukturVM.ArtDerBeendigung = old_vm.BereichSozialstrukturVM.ArtDerBeendigung;
+ BereichSozialstrukturVM.ArtDesHilfeangebots = old_vm.BereichSozialstrukturVM.ArtDesHilfeangebots;
+ BereichSozialstrukturVM.Betreuungsbeginn = old_vm.BereichSozialstrukturVM.Betreuungsbeginn;
+ BereichSozialstrukturVM.Betreuungsende = old_vm.BereichSozialstrukturVM.Betreuungsende;
+ BereichSozialstrukturVM.BetreuungsdauerInTagen = old_vm.BereichSozialstrukturVM.BetreuungsdauerInTagen;
+ BereichSozialstrukturVM.Geburtsdatum = old_vm.BereichSozialstrukturVM.Geburtsdatum;
+ BereichSozialstrukturVM.Geschlechtidentitat = old_vm.BereichSozialstrukturVM.Geschlechtidentitat;
+ BereichSozialstrukturVM.Staatsangehorigkeit = old_vm.BereichSozialstrukturVM.Staatsangehorigkeit;
+ BereichSozialstrukturVM.Aufenthaltsstatus = old_vm.BereichSozialstrukturVM.Aufenthaltsstatus;
+ BereichSozialstrukturVM.HochsterSchulabschluss = old_vm.BereichSozialstrukturVM.HochsterSchulabschluss;
+ BereichSozialstrukturVM.Migrationshintergrund = old_vm.BereichSozialstrukturVM.Migrationshintergrund;
+ BereichSozialstrukturVM.Familienstand = old_vm.BereichSozialstrukturVM.Familienstand;
+ BereichSozialstrukturVM.Haushaltsstruktur = old_vm.BereichSozialstrukturVM.Haushaltsstruktur;
+ BereichSozialstrukturVM.EigeneMindKinderAuserhalbHaushaltsstruktur = old_vm.BereichSozialstrukturVM.EigeneMindKinderAuserhalbHaushaltsstruktur;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/ImageVM.cs b/BeWo/ViewModel/ImageVM.cs
new file mode 100644
index 000000000..21c7d3e3c
--- /dev/null
+++ b/BeWo/ViewModel/ImageVM.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Windows.Media.Imaging;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+
+namespace BeWo.ViewModel
+{
+ public class ImageVM : AbstractDCMapperVM
+ {
+ private string _Filename;
+ private string _Fullname;
+ private byte[] _Original;
+ private byte[] _MediumThumbnail;
+ private byte[] _SmallThumbnail;
+
+ public ImageVM() : this(new ImageDC())
+ {
+
+ }
+ public ImageVM(ImageDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public string Filename
+ {
+ get { return _Filename; }
+ set
+ {
+ if (!AreDifferent(_Filename, value))
+ return;
+
+ _Filename = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Filename, value), nameof(Filename));
+ FirePropertyChanged(nameof(Filename));
+ }
+ }
+ public string Fullname
+ {
+ get { return _Fullname; }
+ set
+ {
+ if (!AreDifferent(_Fullname, value))
+ return;
+
+ _Fullname = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Fullname, value), nameof(Fullname));
+ FirePropertyChanged(nameof(Fullname));
+ }
+ }
+ public byte[] Original
+ {
+ get { return _Original; }
+ set
+ {
+ if (!AreDifferent(_Original, value))
+ return;
+
+ _Original = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Original, value), nameof(Original));
+ FirePropertyChanged(nameof(Original));
+ FirePropertyChanged(nameof(BitmapImage));
+ }
+ }
+
+ public BitmapImage BitmapImage => Utils.CreateBitmapImageFromByteArray(Original);
+
+ protected override void InitByDataContract(ImageDC pDataContract)
+ {
+ _Filename = pDataContract.Filename;
+ _Fullname = pDataContract.Fullname;
+ _Original = pDataContract.Original;
+ }
+
+ protected override ImageDC MapToDataContract(ImageDC pDataContract, bool doCommit)
+ {
+ pDataContract.Filename = _Filename;
+ pDataContract.Fullname = _Fullname;
+ pDataContract.Original = _Original;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs b/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
index 0acacaf86..d0c4293e2 100644
--- a/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
+++ b/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
@@ -3,14 +3,13 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
-
+using System.Windows;
using BS.Shared.Extensions;
namespace BeWo.ViewModel.ListViewModel
{
public abstract class AbstractDCListMapperVM : AbstractBaseVM where VMType : AbstractDCMapperVM where DCType : new()
{
- #region Constants and Fields
public static string PropertyName_EditVM = "EditVM";
@@ -22,11 +21,22 @@ namespace BeWo.ViewModel.ListViewModel
private VMType _NewVM;
+ private VMType _SelectedVM;
+
private BindingList _VMList;
- #endregion
+ //public AbstractDCListMapperVM(IEnumerable> listVMs, bool ignore)
+ //{
+ // var dcLists = listVMs.SelectMany(x => x.DCBackup);
- #region Constructors and Destructors
+ // _DCBackup = dcLists != null ? dcLists.ToObservableCollection() : new ObservableCollection();
+
+ // _DCBackup.CollectionChanged += (s, e) => _VMList.AddRange(e.NewItems.Cast().Select(CreateVM));
+
+ // var vmLists = listVMs.SelectMany(x => x.VMList).ToList();
+
+ // _VMList = new BindingList(vmLists);
+ //}
public AbstractDCListMapperVM(IEnumerable pDCList)
{
@@ -37,9 +47,6 @@ namespace BeWo.ViewModel.ListViewModel
public AbstractDCListMapperVM() : this(null) {}
- #endregion
-
- #region Properties
public virtual int AddedCount
{
@@ -79,6 +86,16 @@ namespace BeWo.ViewModel.ListViewModel
}
}
+ public VMType SelectedVM
+ {
+ get => _SelectedVM;
+ set
+ {
+ _SelectedVM = value;
+ FirePropertyChanged(nameof(SelectedVM));
+ }
+ }
+
public override bool IsDirty
{
get
@@ -136,34 +153,47 @@ namespace BeWo.ViewModel.ListViewModel
}
}
- #endregion
-
- #region Public Methods
-
- public VMType AddNewVMToList()
+ public virtual VMType AddNewVMToList()
{
- this.VMList.Add(this.NewVM);
+ VMList.Add(NewVM);
// VMList.Sort();
- VMType lVM = this.NewVM;
- this.NewVM = null;
+ VMType lVM = NewVM;
+ NewVM = null;
- // FirePropertyChanged("VMList");
+ //FirePropertyChanged("VMList");
return lVM;
}
public VMType AddNewVMToList(bool pSetAsEdit)
{
- this._VMList.Add(this._NewVM);
+ _VMList.Add(_NewVM);
// _VMList.Sort();
if (pSetAsEdit)
{
- this.EditVM = this._NewVM;
+ EditVM = _NewVM;
}
- this.NewVM = null;
- return this.EditVM;
+ NewVM = null;
+ return EditVM;
+ }
+
+ public VMType AddNewVMToListAndSelect(bool auto_select)
+ {
+ // Wichtig! NewVM, wenn _NewVM null ist
+ _VMList.Add(NewVM);
+
+ // _VMList.Sort();
+ if (auto_select)
+ {
+ SelectedVM = _NewVM;
+ }
+
+ FirePropertyChanged(nameof(VMList));
+
+ NewVM = null;
+ return SelectedVM;
}
public virtual List CommitAdded()
@@ -194,14 +224,26 @@ namespace BeWo.ViewModel.ListViewModel
this.EditVM = null;
}
+ public void DeleteSelectedVM(string displayname = null)
+ {
+ if (displayname is object)
+ {
+ var res = MessageBox.Show($"Möchten Sie {displayname} wirklich löschen?", "Löschen bestätigen", MessageBoxButton.YesNo);
+
+ if (res != MessageBoxResult.Yes)
+ return;
+ }
+
+ VMList.Remove(SelectedVM);
+
+ FirePropertyChanged(nameof(VMList));
+ }
+
public virtual List GetRemoved()
{
return this._DCBackup.Where(dc => !this._VMList.Select(vm => vm.DataContract).Contains(dc)).ToList();
}
- #endregion
-
- #region Methods
protected virtual VMType CreateVM(DCType pDC)
{
@@ -209,7 +251,5 @@ namespace BeWo.ViewModel.ListViewModel
return lConstr.Invoke(new object[] { pDC }) as VMType;
}
-
- #endregion
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/ListViewModel/AbstractListVM.cs b/BeWo/ViewModel/ListViewModel/AbstractListVM.cs
new file mode 100644
index 000000000..1033800f2
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/AbstractListVM.cs
@@ -0,0 +1,22 @@
+using DevExpress.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public abstract class AbstractListVM : AbstractDCListMapperVM where VMType : AbstractDCMapperVM where DCType : new()
+ {
+ public DelegateCommand AddVMCommand { get; set; }
+ public DelegateCommand DeleteSelectedVMCommand { get; set; }
+ public DelegateCommand CopySelectedVMCommand { get; set; }
+
+ public AbstractListVM(IEnumerable pDCList) : base(pDCList)
+ {
+ }
+
+ public AbstractListVM() : base() { }
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/CustomerGemeinnutzigeArbeitListVM.cs b/BeWo/ViewModel/ListViewModel/CustomerGemeinnutzigeArbeitListVM.cs
new file mode 100644
index 000000000..4806a47f7
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/CustomerGemeinnutzigeArbeitListVM.cs
@@ -0,0 +1,62 @@
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using DevExpress.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class CustomerGemeinnutzigeArbeitListVM : AbstractListVM
+ {
+ private ObservableSortCollection _Auftragsherkunfte;
+ private ObservableSortCollection _Vermittlungsgrundlagen;
+
+ public CustomerGemeinnutzigeArbeitListVM(IEnumerable arbeiten) : base(arbeiten)
+ {
+ AddVMCommand = new DelegateCommand(() => AddNewVMToListAndSelect(true), CanAddVM);
+
+ DeleteSelectedVMCommand = new DelegateCommand(() => DeleteSelectedVM($"Aktenzeichen '{SelectedVM.EigenesAktenzeichen}'"));
+
+ // CopySelectedVMCommand = new DelegateCommand(CopySelectedWohnhilfe);
+ }
+
+ public ObservableSortCollection Auftragsherkunfte
+ {
+ get { return _Auftragsherkunfte; }
+ set
+ {
+ if (!AreDifferent(Auftragsherkunfte, value))
+ return;
+
+ _Auftragsherkunfte = value;
+ FirePropertyChanged(nameof(Auftragsherkunfte));
+ }
+ }
+ public ObservableSortCollection Vermittlungsgrundlagen
+ {
+ get { return _Vermittlungsgrundlagen; }
+ set
+ {
+ if (!AreDifferent(Vermittlungsgrundlagen, value))
+ return;
+
+ _Vermittlungsgrundlagen = value;
+ FirePropertyChanged(nameof(Vermittlungsgrundlagen));
+ }
+ }
+
+ public bool CanAddVM()
+ {
+ return BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_GemeinnutzigeArbeit_Create); ;
+ }
+
+ internal void InitValueListEntrys(ObservableSortCollection auftragsherkunfte, ObservableSortCollection vermittlungsgrundlage)
+ {
+ _Auftragsherkunfte = auftragsherkunfte;
+ _Vermittlungsgrundlagen = vermittlungsgrundlage;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs b/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs
new file mode 100644
index 000000000..a7b17bf9d
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs
@@ -0,0 +1,86 @@
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+using DevExpress.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class CustomerWohnhilfeListVM : AbstractListVM
+ {
+ private bool _IsLarge;
+
+ public DelegateCommand InsertDetailsCommand { get; set; }
+
+ public CustomerVM Customer { get; set; }
+
+ public CustomerWohnhilfeListVM() { }
+
+ public CustomerWohnhilfeListVM(CustomerVM vm, IEnumerable wohnhilfe) : base(wohnhilfe)
+ {
+ Customer = vm;
+
+ AddVMCommand = new DelegateCommand(() => AddNewVMToListAndSelect(true), CanAddWohnhilfe);
+
+ DeleteSelectedVMCommand = new DelegateCommand(() => DeleteSelectedVM($"Wohnhilfe '{SelectedVM.Displayname}'"));
+
+ CopySelectedVMCommand = new DelegateCommand(CopySelectedWohnhilfe);
+
+ InsertDetailsCommand = new DelegateCommand(InsertDetails);
+
+ _IsLarge = true;
+ }
+
+ public bool IsLarge
+ {
+ get { return _IsLarge; }
+ set
+ {
+ if (!AreDifferent(IsLarge, value))
+ return;
+
+ _IsLarge = value;
+ FirePropertyChanged(nameof(IsLarge));
+ }
+ }
+
+ public void CopySelectedWohnhilfe()
+ {
+ var old_vm = SelectedVM;
+
+ var new_vm = AddNewVMToListAndSelect(true);
+
+ new_vm.InitByViewModel(old_vm);
+ }
+
+ public void InsertDetails()
+ {
+ var selected_vm = SelectedVM;
+
+ selected_vm.BereichSozialstrukturVM.Geburtsdatum = Customer.DateOfBirth;
+
+ if (Customer.IsMale)
+ selected_vm.BereichBundVM.Geschlecht = Geschlecht.Mannlich;
+ else if (Customer.IsFemale)
+ selected_vm.BereichBundVM.Geschlecht = Geschlecht.Weiblich;
+ else if (Customer.IsDivers)
+ selected_vm.BereichBundVM.Geschlecht = Geschlecht.Divers;
+ else
+ selected_vm.BereichBundVM.Geschlecht = Geschlecht.OhneAngabe;
+
+ if (Customer.IsMigrant)
+ selected_vm.BereichSozialstrukturVM.Migrationshintergrund = WohnhilfeBoolData.Ja;
+ else
+ selected_vm.BereichSozialstrukturVM.Migrationshintergrund = WohnhilfeBoolData.Nein;
+ }
+
+ public bool CanAddWohnhilfe()
+ {
+ return BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_Wohnhilfe_Create);
+ }
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/ImageListVM.cs b/BeWo/ViewModel/ListViewModel/ImageListVM.cs
new file mode 100644
index 000000000..39f4b1601
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/ImageListVM.cs
@@ -0,0 +1,17 @@
+using BS.Shared.DataContracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class ImageListVM : AbstractDCListMapperVM
+ {
+ public ImageListVM(List pDCs) : base(pDCs)
+ {
+
+ }
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/WohneinheitBelegungListVM.cs b/BeWo/ViewModel/ListViewModel/WohneinheitBelegungListVM.cs
new file mode 100644
index 000000000..1c7df92f5
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/WohneinheitBelegungListVM.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class WohneinheitBelegungListVM : AbstractDCListMapperVM
+ {
+ private WohneinheitBelegungVM _Current;
+
+ ///
+ /// Gesamte Liste
+ ///
+ ///
+ ///
+ public WohneinheitBelegungListVM(List listDCs) : base(listDCs)
+ {
+ }
+
+ public WohneinheitBelegungVM CurrentVM
+ {
+ get => _Current;
+ set
+ {
+ if (!AreDifferent(CurrentVM, value))
+ return;
+
+ _Current = value;
+ FirePropertyChanged(nameof(CurrentVM));
+ }
+ }
+
+ public override WohneinheitBelegungVM AddNewVMToList()
+ {
+ // Gesamt Liste -> Beleg VM
+ var vm = base.AddNewVMToList();
+
+ CurrentVM = null;
+
+ return vm;
+ }
+
+ public void CloseEditVM()
+ {
+ EditVM = null;
+
+ CurrentVM = null;
+ }
+
+ public void CloseNewVM()
+ {
+ NewVM = null;
+
+ CurrentVM = null;
+ }
+
+ public void CloseCurrentVM()
+ {
+ if (CurrentVM == EditVM)
+ CloseEditVM();
+ else
+ CloseNewVM();
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/ViewModel/ListViewModel/WohneinheitListVM.cs b/BeWo/ViewModel/ListViewModel/WohneinheitListVM.cs
new file mode 100644
index 000000000..9940f1a16
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/WohneinheitListVM.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class WohneinheitListVM : AbstractDCListMapperVM
+ {
+ private WohneinheitVM _CurrentVM;
+
+ private BindingList _Wohnungsnamen;
+
+ public WohneinheitListVM() : base(null)
+ {
+
+ }
+
+ public WohneinheitListVM(List pDCs) : base(pDCs)
+ {
+ _Wohnungsnamen = new BindingList(GetWohnungsnamen());
+ }
+
+ public WohneinheitVM CurrentVM
+ {
+ get => _CurrentVM;
+ set
+ {
+ if (!AreDifferent(_CurrentVM, value))
+ return;
+
+ _CurrentVM = value;
+ FirePropertyChanged(nameof(CurrentVM));
+ }
+ }
+
+ public BindingList Wohnungsnamen => _Wohnungsnamen;
+
+ public List GetWohnungsnamen() => VMList?
+ .Where(x => !string.IsNullOrEmpty(x.Wohnname))
+ .Where(x => !string.IsNullOrEmpty(x.Zimmername))
+ .Select(x => x.Wohnname)?
+ .Distinct()
+ .OrderBy(x => x)
+ .ToList() ?? new List();
+
+ public override WohneinheitVM AddNewVMToList()
+ {
+ var vm = base.AddNewVMToList();
+
+ CurrentVM = null;
+
+ _Wohnungsnamen.Clear();
+ _Wohnungsnamen.AddRange(GetWohnungsnamen());
+
+ FirePropertyChanged(nameof(VMList));
+
+ return vm;
+ }
+
+ public override bool IsDirty => base.IsDirty;
+
+ public void CloseEditVM()
+ {
+ EditVM = null;
+
+ CurrentVM = null;
+
+ _Wohnungsnamen.Clear();
+ _Wohnungsnamen.AddRange(GetWohnungsnamen());
+ }
+
+ public void ResetNewVM()
+ {
+ NewVM = null;
+
+ CurrentVM = null;
+ }
+
+ public void AskRemoveEditVM()
+ => AskRemoveVM(EditVM);
+
+ public void AskRemoveVM(WohneinheitVM vm)
+ {
+ if (vm is null)
+ return;
+
+ if (MessageBox.Show($"Möchten Sie Wohneinheit '{vm}' wirklich löschen?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ {
+ RemoveVM(vm);
+ }
+ }
+
+ internal void RemoveVM(WohneinheitVM vm)
+ {
+ VMList.Remove(vm);
+
+ FirePropertyChanged(nameof(VMList));
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs
index de6d9910b..ef34318d1 100644
--- a/BeWo/ViewModel/VMFactory.cs
+++ b/BeWo/ViewModel/VMFactory.cs
@@ -29,23 +29,23 @@ namespace BeWo.ViewModel
ServiceFacade.DoCustomerServiceAsync(s => s.GetAllAbsenceReasons(), cb => pCallBack(new AbsenceTimeListVM(pDCs, cb.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList())));
}
- public static AbsenceTimeListVM CreateAbsenceTimeListVM(IEnumerable pDCs, AbsenceReasonVisibilityType? type)
- {
- var list = ServiceFacade.DoCustomerServiceSync(s => s.GetAllAbsenceReasons());
+ public static AbsenceTimeListVM CreateAbsenceTimeListVM(IEnumerable pDCs, AbsenceReasonVisibilityType? type)
+ {
+ var list = ServiceFacade.DoCustomerServiceSync(s => s.GetAllAbsenceReasons());
- return new AbsenceTimeListVM(pDCs, list.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList());
- }
+ return new AbsenceTimeListVM(pDCs, list.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList());
+ }
- public static void CreateOvertimeListVMAsync(IEnumerable pDCs, Action pCallBack)
- {
- //ServiceFacade.DoValueListServiceAsync(v => v.GetAllValueListEntrysByType(ValueListEntryType.Auszahlungsart), cb => pCallBack(new OvertimeListVM(pDCs)));
- ServiceFacade.DoEmployeeServiceAsync(v => v.GetAllOvertimes(), cb => pCallBack(new OvertimeListVM(pDCs)));
- }
+ public static void CreateOvertimeListVMAsync(IEnumerable pDCs, Action pCallBack)
+ {
+ //ServiceFacade.DoValueListServiceAsync(v => v.GetAllValueListEntrysByType(ValueListEntryType.Auszahlungsart), cb => pCallBack(new OvertimeListVM(pDCs)));
+ ServiceFacade.DoEmployeeServiceAsync(v => v.GetAllOvertimes(), cb => pCallBack(new OvertimeListVM(pDCs)));
+ }
public static void CreateAccountingBookingVMAsnyc(Action pCallBack)
{
Cache.GetInstance().GetSupportConceptTree(
- tree => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.AccountingTransactionType, categories => pCallBack(new AccountingBookingVM(tree, categories))));
+ tree => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.AccountingTransactionType, categories => pCallBack(new AccountingBookingVM(tree, categories))));
}
public static void CreateAccountingTransactionListVMAsnyc(DateTimeSpan pSpan, long? pSupportConceptOid, long? pCostBearerSupportConceptRelOid, Action pCallBack)
@@ -69,10 +69,10 @@ namespace BeWo.ViewModel
ServiceFacade.DoResourceServiceAsync(s => s.GetAllBookings(pSpan.StartDateTime, pSpan.EndDateTime), r => pCallBack(new BookingVM(r)));
}
- public static CustomerEmployeeRelationListVM CreateCustomerEmployeeRelationListVM(List pList)
+ public static CustomerEmployeeRelationListVM CreateCustomerEmployeeRelationListVM(List pList)
{
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
- return new CustomerEmployeeRelationListVM(pList, valueList);
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
+ return new CustomerEmployeeRelationListVM(pList, valueList);
}
public static WohnheimEmployeeRelationListVM CreateWohnheimEmployeeRelationListVM(List pList)
@@ -98,37 +98,37 @@ namespace BeWo.ViewModel
pCallBack(new OrganisationPersonRelationListVM(pDCs));
}
- public static CustomerPersonRelationListVM CreateCustomerEnvironmentPersonRelListVM(List pList, ValueListEntryType vtype)
+ public static CustomerPersonRelationListVM CreateCustomerEnvironmentPersonRelListVM(List pList, ValueListEntryType vtype)
{
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(vtype);
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(vtype);
- return new CustomerPersonRelationListVM(pList, valueList);
+ return new CustomerPersonRelationListVM(pList, valueList);
}
public static void CreateCustomerEnvironmentOrganisationRelListVMAsync(List pList, Action pCallBack)
{
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.EnvironmentOrganisationType, r => pCallBack(new CustomerOrganisationRelationListVM(pList, r)));
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.EnvironmentOrganisationType, r => pCallBack(new CustomerOrganisationRelationListVM(pList, r)));
}
- public static CustomerOrganisationRelationListVM CreateCustomerEnvironmentOrganisationRelListVM(List pList)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.EnvironmentOrganisationType);
+ public static CustomerOrganisationRelationListVM CreateCustomerEnvironmentOrganisationRelListVM(List pList)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.EnvironmentOrganisationType);
- return new CustomerOrganisationRelationListVM(pList, valueList);
- }
+ return new CustomerOrganisationRelationListVM(pList, valueList);
+ }
- public static MedikamentenverordnungslisteListVM CreateMedikementenverordnungslisteListVM(IEnumerable pList)
- {
- var darreichungsformen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDarreichungsformen());
- var depotrhythmen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDepotRhythmen());
+ public static MedikamentenverordnungslisteListVM CreateMedikementenverordnungslisteListVM(IEnumerable pList)
+ {
+ var darreichungsformen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDarreichungsformen());
+ var depotrhythmen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDepotRhythmen());
- return new MedikamentenverordnungslisteListVM(pList, darreichungsformen, depotrhythmen);
- }
+ return new MedikamentenverordnungslisteListVM(pList, darreichungsformen, depotrhythmen);
+ }
- public static BargeldtransaktionsListVM CreateBargeldtransaktionsListVM(IEnumerable pList)
- {
- return new BargeldtransaktionsListVM(pList);
- }
+ public static BargeldtransaktionsListVM CreateBargeldtransaktionsListVM(IEnumerable pList)
+ {
+ return new BargeldtransaktionsListVM(pList);
+ }
public static void CreateCustomerVMAsync(long pOid, Action pCallBack)
{
@@ -138,12 +138,12 @@ namespace BeWo.ViewModel
public static void CreateCustomerVMAsync(Action pCallBack)
{
ServiceFacade.DoOperationsServiceAsync(
- s => s.GetVarFieldDefs(TableID.Customer),
+ s => s.GetVarFieldDefs(TableID.Customer),
cb => CreateCustomerVMAsync(
new CustomerDC
- {
- CustomerVarFields = cb
- },
+ {
+ CustomerVarFields = cb
+ },
pCallBack));
}
@@ -152,13 +152,13 @@ namespace BeWo.ViewModel
if (BeWoApp.ICD10Diagnosis == null)
{
ServiceFacade.DoOperationsServiceAsync(
- s => s.GetCompressedICD10Diagnosis(),
+ s => s.GetCompressedICD10Diagnosis(),
st =>
{
st = Utils.Decompress(st);
var ds = st.Split(Environment.NewLine).ToDictionary(line => line.Substring(0, line.IndexOf(';')), line => line.Substring(line.IndexOf(';') + 1));
- BeWoApp.ICD10Diagnosis = ds;
+ BeWoApp.ICD10Diagnosis = ds;
InternalCreateCustomerVM(pCustomerDC, pCallBack);
});
}
@@ -171,7 +171,7 @@ namespace BeWo.ViewModel
public static void CreateEmployeeVMAsync(long pOid, Action pCallBack)
{
ServiceFacade.DoEmployeeServiceAsync(
- s => s.LoadEmployee(pOid),
+ s => s.LoadEmployee(pOid),
r =>
{
CreateEmployeeVMAsync(r, pCallBack);
@@ -180,32 +180,32 @@ namespace BeWo.ViewModel
public static void CreateEmployeeVMAsync(EmployeeDC pEmployeeDC, Action pCallBack)
{
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(),
- r1 =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.StaffQualificationsType,
- r2 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.StaffActivityFocusType,
- r3 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.ContractType,
- r4 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
- nat =>
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(),
+ r1 =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.StaffQualificationsType,
+ r2 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.StaffActivityFocusType,
+ r3 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.ContractType,
+ r4 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
+ nat =>
Cache.GetInstance()
.GetAllValueListEntrysByTypeAsync(ValueListEntryType.NotizenKategorieEmployee,
r7 =>
- ServiceFacade.DoEmployeeServiceAsync(
- e =>
- e.GetAllAuszahlungsarten(),
- r6 =>
- ServiceFacade.DoOperationsServiceAsync(
- s =>
- s.GetSbdConfig(),
- config =>
- pCallBack(new EmployeeVM(pEmployeeDC, r1, nat, r2, r3, r6, r4, config.Stundensaetze, r7))))))))));
+ ServiceFacade.DoEmployeeServiceAsync(
+ e =>
+ e.GetAllAuszahlungsarten(),
+ r6 =>
+ ServiceFacade.DoOperationsServiceAsync(
+ s =>
+ s.GetSbdConfig(),
+ config =>
+ pCallBack(new EmployeeVM(pEmployeeDC, r1, nat, r2, r3, r6, r4, config.Stundensaetze, r7))))))))));
}
public static void CreateEmployeeVMAsync(Action pCallBack)
@@ -213,30 +213,30 @@ namespace BeWo.ViewModel
CreateEmployeeVMAsync(new EmployeeDC(), pCallBack);
}
- public static void CreateWohnheimVMAsync(long pOid, Action pCallBack)
+ public static void CreateWohnheimVMAsync(long pOid, List customers, Action pCallBack)
{
ServiceFacade.DoWohnheimServiceAsync(
s => s.LoadWohnheim(pOid),
r =>
{
- CreateWohnheimVMAsync(r, pCallBack);
+ CreateWohnheimVMAsync(r, customers, pCallBack);
});
}
- public static void CreateWohnheimVMAsync(WohnheimDC pWohnheimDC, Action pCallBack)
+ public static void CreateWohnheimVMAsync(WohnheimDC pWohnheimDC, List customers, Action pCallBack)
{
- pCallBack(new WohnheimVM(pWohnheimDC));
+ pCallBack(new WohnheimVM(pWohnheimDC, customers));
}
- public static void CreateWohnheimVMAsync(Action pCallBack)
+ public static void CreateWohnheimVMAsync(List customers, Action pCallBack)
{
- CreateWohnheimVMAsync(new WohnheimDC(), pCallBack);
+ CreateWohnheimVMAsync(new WohnheimDC(), customers, pCallBack);
}
public static void CreateEquityInvoiceBaselListVMAsync(long supportconeptOid, Action callback)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetInvoiceBasesForSupportConcept(InvoiceType.CustomerEquity, supportconeptOid),
+ s => s.GetInvoiceBasesForSupportConcept(InvoiceType.CustomerEquity, supportconeptOid),
r =>
{
r.Sort(
@@ -263,7 +263,7 @@ namespace BeWo.ViewModel
if (organisation != null)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForOrganisation(organisation.OrganisationOid),
+ s => s.GetGeneralInvoiceBasesForOrganisation(organisation.OrganisationOid),
r =>
{
r.Sort(
@@ -287,7 +287,7 @@ namespace BeWo.ViewModel
else if (person != null)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForPerson(person.PersonOid),
+ s => s.GetGeneralInvoiceBasesForPerson(person.PersonOid),
r =>
{
r.Sort(
@@ -311,7 +311,7 @@ namespace BeWo.ViewModel
else if (customer != null)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForCustomer(customer.CustomerOid),
+ s => s.GetGeneralInvoiceBasesForCustomer(customer.CustomerOid),
r =>
{
r.Sort(
@@ -337,7 +337,7 @@ namespace BeWo.ViewModel
public static void CreateInvoiceListVMAsync(Action callback)
{
ServiceFacade.DoCustomerServiceAsync(
- s1 => s1.GetAllActiveSupportConceptsCompact(),
+ s1 => s1.GetAllActiveSupportConceptsCompact(),
r1 =>
ServiceFacade.DoCustomerServiceAsync(
s2 => s2.GetAllActiveOrganisationsCompact(), r2 => ServiceFacade.DoOperationsServiceAsync(s3 => s3.GetAllActiveInvoices(), r3 => callback(new InvoiceListVM(r2, r1, r3)))));
@@ -352,49 +352,49 @@ namespace BeWo.ViewModel
{
ServiceFacade.DoCustomerServiceAsync(
s => s.LoadOrganisation(pOid),
- r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType,
- r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
- r3 => pCallBack(new OrganisationVM(r1,r2,r4,r3))))));
+ r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType), r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType,
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
+ r3 => pCallBack(new OrganisationVM(r1, r2, r4, r3))))));
}
public static void CreateOrganisationVMAsync(Action pCallBack)
{
- ServiceFacade.DoValueListServiceAsync(
- s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),
- r1 =>
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetVarFieldDefs(TableID.Organisation),
- r2 =>Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ServiceFacade.DoValueListServiceAsync(
+ s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),
+ r1 =>
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetVarFieldDefs(TableID.Organisation),
+ r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.OrganisationFunctionType,
- r4 =>Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.RoleInOrganisationType,
- r3 => pCallBack(new OrganisationVM(
- new OrganisationDC
- {
- VarFields = r2
- }, r1,r4,r3))))));
+ r3 => pCallBack(new OrganisationVM(
+ new OrganisationDC
+ {
+ VarFields = r2
+ }, r1, r4, r3))))));
}
- //public static void CreatePersonOrganisationRelationVMAsync(CompactOrganisationDC pOrganisation, Action pCallBack)
- //{
- // pCallBack(
- // new PersonOrganisationRelationVM(
- // new Organisation2PersonDC
- // {
- // OrganisationOid = pOrganisation.OrganisationOid,
- // OrganisationName = pOrganisation.Name,
- // OrganisationVersion = pOrganisation.OrganisationVersion
- // }));
- //}
+ //public static void CreatePersonOrganisationRelationVMAsync(CompactOrganisationDC pOrganisation, Action pCallBack)
+ //{
+ // pCallBack(
+ // new PersonOrganisationRelationVM(
+ // new Organisation2PersonDC
+ // {
+ // OrganisationOid = pOrganisation.OrganisationOid,
+ // OrganisationName = pOrganisation.Name,
+ // OrganisationVersion = pOrganisation.OrganisationVersion
+ // }));
+ //}
public static void CreatePersonVMAsync(Action pCallBack)
{
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.TitleType,
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.TitleType,
r1 =>
ServiceFacade.DoOperationsServiceAsync(
s => s.GetVarFieldDefs(TableID.Person),
- r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.FunctionType,
r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.RoleInOrganisationType,
@@ -405,10 +405,10 @@ namespace BeWo.ViewModel
r6 => pCallBack(
new PersonVM(
new PersonDC
- {
- VarFields = r2
- },
- r1,
+ {
+ VarFields = r2
+ },
+ r1,
r4,
r5,
r3,
@@ -418,12 +418,12 @@ namespace BeWo.ViewModel
public static void CreatePersonVMAsync(long pOid, Action pCallBack)
{
ServiceFacade.DoCustomerServiceAsync(
- s => s.LoadPerson(pOid),
+ s => s.LoadPerson(pOid),
cb =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.TitleType,
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.TitleType,
r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.FunctionType,
- r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
+ r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Aufenthaltsstatus,
r5 => pCallBack(new PersonVM(cb, r1, r3, r4, r2, r5))))))));
@@ -433,7 +433,7 @@ namespace BeWo.ViewModel
{
ServiceFacade.DoResourceServiceAsync(
s => s.GetAllResources(),
- r1 => ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(ValueListEntryType.ResourceCategory), r2 => pCallBack(new ResourceListVM(r1, r2))));
+ r1 => ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(ValueListEntryType.ResourceCategory), r2 => pCallBack(new ResourceListVM(r1, r2))));
}
public static void CreateServiceCategoryListVMAsync(Action pCallBack)
@@ -442,23 +442,23 @@ namespace BeWo.ViewModel
r => pCallBack(new ServiceCategoryListVM(r.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList())));
}
- public static void CreateAdditionalServiceListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalService(),
- r => pCallBack(new AdditionalServiceListVM(r.ToList())));
- }
+ public static void CreateAdditionalServiceListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalService(),
+ r => pCallBack(new AdditionalServiceListVM(r.ToList())));
+ }
- public static void CreateAuszahlungsartenListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAuszahlungsarten(),
- r => pCallBack(new AuszahlungsartListVM(r.ToList())));
- }
+ public static void CreateAuszahlungsartenListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAuszahlungsarten(),
+ r => pCallBack(new AuszahlungsartListVM(r.ToList())));
+ }
- public static void CreateBudgetListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
- r => pCallBack(new BudgetListVM(r.ToList())));
- }
+ public static void CreateBudgetListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
+ r => pCallBack(new BudgetListVM(r.ToList())));
+ }
public static void CreatePreisListVMAsync(Action pCallBack)
{
@@ -490,11 +490,11 @@ namespace BeWo.ViewModel
}));
}
- public static void CreateMedArtListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetAllMedArten(),
- r => pCallBack(new MedArtListVM(r.ToList())));
- }
+ public static void CreateMedArtListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetAllMedArten(),
+ r => pCallBack(new MedArtListVM(r.ToList())));
+ }
public static void CreateServiceDescriptionListVMAsync(Action pCallBack)
{
@@ -503,10 +503,10 @@ namespace BeWo.ViewModel
r2 => pCallBack(new ServiceDescriptionListVM(r1.Where(sr => sr.ScopeType == ScopeTypeId.Global).ToList(), r2.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList()))));
}
- public static void CreateAdditionalServiceRegionListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetAllAdditionalServiceRegion(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllAdditionalService(), r2 => pCallBack(new AdditionalServiceRegionListVM(r1.ToList(), r2.ToList()))));
- }
+ public static void CreateAdditionalServiceRegionListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetAllAdditionalServiceRegion(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllAdditionalService(), r2 => pCallBack(new AdditionalServiceRegionListVM(r1.ToList(), r2.ToList()))));
+ }
public static void CreateServiceRecordVMAsync(long pEmployeeOid, Action pCallBack)
{
@@ -520,7 +520,7 @@ namespace BeWo.ViewModel
iGoalCats =>
Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.SupportConceptGoalType,
goals => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.DocumentType,
- docTypes =>
+ docTypes =>
ServiceFacade.DoCustomerServiceAsync(
s => s.GetAllActiveWohnheimeCompact(), cb => ServiceFacade.DoCustomerServiceAsync(s2 => s2.GetAllDarreichungsformen(), abc => pCallBack(new ServiceRecordListVM(dict, goalCats, iGoalCats, goals, cb, docTypes, abc)))))))));
}
@@ -533,7 +533,7 @@ namespace BeWo.ViewModel
public static void CreateSettlementListForCostBearerAndPeriod(long costBearerOid, DateTime periodStart, DateTime periodEnd, Action callback)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetSettlementInvoicesForCostBearerAndPeriod(costBearerOid, periodStart, periodEnd),
+ s => s.GetSettlementInvoicesForCostBearerAndPeriod(costBearerOid, periodStart, periodEnd),
r =>
{
r.Sort(
@@ -558,7 +558,7 @@ namespace BeWo.ViewModel
public static void CreateSettlementListForSupportConceptVMAsync(long supportconceptOid, Action callback)
{
ServiceFacade.DoAccountingServiceAsync(
- s => s.GetSettlementInvoicesForSupportConcept(supportconceptOid),
+ s => s.GetSettlementInvoicesForSupportConcept(supportconceptOid),
r =>
{
r.Sort(
@@ -592,7 +592,7 @@ namespace BeWo.ViewModel
public static void CreateSupportConceptGoalListVMAsync(ValueListEntryType pType, ValueListEntryType pParentType, Action pCallBack)
{
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pType, r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pParentType, r2 => pCallBack(new SupportConceptGoalListVM(r1, r2))));
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pType, r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pParentType, r2 => pCallBack(new SupportConceptGoalListVM(r1, r2))));
}
public static void CreateSupportConceptVMAsync(Action pCallback)
@@ -602,16 +602,16 @@ namespace BeWo.ViewModel
public static void CreateSupportConceptVMAsync(long pOid, Action pCallback)
{
- ServiceFacade.DoCustomerServiceAsync(s => s.LoadSupportConcept(pOid),
+ ServiceFacade.DoCustomerServiceAsync(s => s.LoadSupportConcept(pOid),
r => CreateSupportConceptVMAsync(r, pCallback, false));
}
public static void CreateSupportConceptVMAsync(SupportConceptDC dc, Action pCallBack, bool initOriginator)
{
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.SupportConceptGoalCategoryType,
- r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.SupportConceptGoalType,
+ r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.SupportConceptGoalType,
r2 => Cache.GetInstance().GetServiceCategoryDescriptionDict(
dict => ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
r3 =>
@@ -675,10 +675,10 @@ namespace BeWo.ViewModel
{
ServiceFacade.DoUserServiceAsync(s => s.GetAllUserGroups(), cb => pCallBack(new UserVM(new UserDC(), cb)), true);
}
-
+
public static void CreateValueListVMAsync(ValueListEntryType pType, Action pCallBack)
{
- ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(pType), r => pCallBack(new ValueListEntryListVM(pType, r)));
+ ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(pType), r => pCallBack(new ValueListEntryListVM(pType, r)));
}
@@ -692,9 +692,9 @@ namespace BeWo.ViewModel
}
ServiceFacade.DoValueListServiceAsync(
- s => s.GetAllValueListEntrysByTypes(typeList),
+ s => s.GetAllValueListEntrysByTypes(typeList),
cb => pCallBack(new GenericValueListEntryListVM(cb)));
- }
+ }
public static void CreateEmploymentTypeListVMAsync(Action pCallBack)
{
@@ -705,22 +705,24 @@ namespace BeWo.ViewModel
{
var list = new List
{
- ValueListEntryType.DisabilityType,
- ValueListEntryType.CustomerCareType,
- ValueListEntryType.PlacementObjectiveType,
+ ValueListEntryType.DisabilityType,
+ ValueListEntryType.CustomerCareType,
+ ValueListEntryType.PlacementObjectiveType,
ValueListEntryType.TerminationReasonType,
ValueListEntryType.Nationality,
ValueListEntryType.Aufenthaltsstatus,
ValueListEntryType.RoleInFamily,
- ValueListEntryType.NotizenKategorieCustomer
+ ValueListEntryType.NotizenKategorieCustomer,
+ ValueListEntryType.Auftragsherkunft,
+ ValueListEntryType.Vermittlungsgrundlage
};
- ServiceFacade.DoValueListServiceAsync(
- s => s.GetAllValueListEntrysByTypes(list),
- cb => ServiceFacade.DoEmployeeServiceAsync(s2 => s2.GetAllAssessmentSheetCategories(),
- cb2 => ServiceFacade.DoEmployeeServiceAsync(s3 => s3.GetAllAssessmentSheetValues(),
- cb3 => ServiceFacade.DoCustomerServiceAsync(s4 => s4.GetAllMedArten(),
- cb4 => pCallBack(new CustomerVM(pCustomerDC, cb, cb2, cb3, cb4))))));
+ ServiceFacade.DoValueListServiceAsync(
+ s => s.GetAllValueListEntrysByTypes(list),
+ cb => ServiceFacade.DoEmployeeServiceAsync(s2 => s2.GetAllAssessmentSheetCategories(),
+ cb2 => ServiceFacade.DoEmployeeServiceAsync(s3 => s3.GetAllAssessmentSheetValues(),
+ cb3 => ServiceFacade.DoCustomerServiceAsync(s4 => s4.GetAllMedArten(),
+ cb4 => pCallBack(new CustomerVM(pCustomerDC, cb, cb2, cb3, cb4))))));
}
public static void CreateAppointmentCategoryListVMAsync(Action pCallBack)
@@ -767,7 +769,7 @@ namespace BeWo.ViewModel
public static void CreateSbdAdminVMAsync(Action pCallBack)
{
- ServiceFacade.DoOperationsServiceAsync(s => s.GetSbdConfig(), r =>
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetSbdConfig(), r =>
{
pCallBack(new SbdConfigVM(r));
});
@@ -790,10 +792,10 @@ namespace BeWo.ViewModel
return activeSupportConcepts;
}
public static List CreateCustomerList()
- {
+ {
List allCustomers = new List();
List activeCustomers = new List();
-
+
allCustomers = ServiceFacade.DoCustomerServiceSync(
s => s.GetAllCustomersCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
@@ -856,7 +858,7 @@ namespace BeWo.ViewModel
public static List CreateUserGroupList()
{
List allUserGroups = new List();
-
+
allUserGroups = ServiceFacade.DoUserServiceSync(s => s.GetAllUserGroups());
return allUserGroups;
}
@@ -866,8 +868,39 @@ namespace BeWo.ViewModel
List folderList = new List();
folderList = ServiceFacade.DoOperationsServiceSync(s => s.GetFolderTree(tid, objectOid));
- return folderList;
+ return folderList;
}
+ public static void CreateWohneinheitListVMs(List dcs, out WohneinheitListVM einheit_vm_list, out WohneinheitBelegungListVM beleg_vm_list)
+ {
+ einheit_vm_list = new WohneinheitListVM(dcs);
+
+ var beleg_dc_list = new List();
+ var beleg_dc2einheit_vm = new Dictionary();
+ foreach (var einheit_vm in einheit_vm_list.VMList)
+ {
+ var einheit_dc = einheit_vm.DataContract;
+
+ if (einheit_dc.Belegungen is null)
+ continue;
+
+ foreach (var beleg_dc in einheit_dc.Belegungen)
+ {
+ beleg_dc_list.Add(beleg_dc);
+ beleg_dc2einheit_vm.Add(beleg_dc, einheit_vm);
+ }
+ }
+
+ beleg_vm_list = new WohneinheitBelegungListVM(beleg_dc_list.OrderBy(x => x.Oid).ToList());
+
+ foreach (var beleg_vm in beleg_vm_list.VMList)
+ {
+ var beleg_dc = beleg_vm.DataContract;
+
+ beleg_vm.Wohneinheit = beleg_dc2einheit_vm[beleg_dc];
+ }
+
+ einheit_vm_list.VMList.Sort(WohneinheitVM.Compare);
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/WohneinheitBelegungVM.cs b/BeWo/ViewModel/WohneinheitBelegungVM.cs
new file mode 100644
index 000000000..9764e60c1
--- /dev/null
+++ b/BeWo/ViewModel/WohneinheitBelegungVM.cs
@@ -0,0 +1,171 @@
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Compact;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace BeWo.ViewModel
+{
+ public class WohneinheitBelegungVM : AbstractDCMapperVM
+ {
+ private WohneinheitVM _Wohneinheit;
+
+ private long? _Oid;
+ private CompactCustomerDC _Customer;
+ private DateTime _StartDate;
+ private DateTime? _EndDate;
+ private string _Kommentar;
+
+ public bool SoftDelete { get; set; }
+
+ public WohneinheitBelegungVM() : base(new WohneinheitBelegungDC(), true)
+ {
+
+ }
+ public WohneinheitBelegungVM(WohneinheitBelegungDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public long? Oid => _Oid;
+
+ public bool CanSave
+ => Wohneinheit is object && Customer is object;
+ public WohneinheitVM Wohneinheit
+ {
+ get { return _Wohneinheit; }
+ set
+ {
+ if (!AreDifferent(Wohneinheit, value))
+ return;
+
+ if (_Wohneinheit is object)
+ _Wohneinheit.PropertyChanged -= FirePropertyChanged;
+
+ _Wohneinheit = value;
+
+ if (_Wohneinheit is object)
+ _Wohneinheit.PropertyChanged += FirePropertyChanged;
+
+ FirePropertyChanged(nameof(Wohneinheit));
+ FirePropertyChanged(nameof(CanSave));
+ }
+ }
+ public CompactCustomerDC Customer
+ {
+ get { return _Customer; }
+ set
+ {
+ if (!AreDifferent(Customer, value))
+ return;
+
+ _Customer = value;
+ FirePropertyChanged(nameof(Customer));
+ FirePropertyChanged(nameof(CanSave));
+ }
+ }
+ public DateTime StartDate
+ {
+ get { return _StartDate; }
+ set
+ {
+ if (!AreDifferent(StartDate, value))
+ return;
+
+ _StartDate = value;
+ StoreDirtyInformation(AreDifferent(DataContract.StartDate, value), nameof(StartDate));
+ FirePropertyChanged(nameof(StartDate));
+
+ if (EndDate.HasValue && EndDate.Value < StartDate)
+ {
+ EndDate = new DateTime(StartDate.Year, 12, 31);
+ }
+ }
+ }
+ public DateTime? EndDate
+ {
+ get { return _EndDate; }
+ set
+ {
+ if (!AreDifferent(EndDate, value))
+ return;
+
+ _EndDate = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndDate, value), nameof(EndDate));
+ FirePropertyChanged(nameof(EndDate));
+ FirePropertyChanged(nameof(EndDateDisplay));
+
+ if (value.HasValue && value.Value < StartDate)
+ {
+ StartDate = new DateTime(value.Value.Year, value.Value.Month, 1);
+ }
+ }
+ }
+ public string Kommentar
+ {
+ get { return _Kommentar; }
+ set
+ {
+ if (!AreDifferent(Kommentar, value))
+ return;
+
+ _Kommentar = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Kommentar, value), nameof(Kommentar));
+ FirePropertyChanged(nameof(Kommentar));
+ }
+ }
+
+ public DateTime EndDateDisplay => EndDate ?? DateTime.MaxValue;
+ public WohneinheitBelegungVM ViewModel => this;
+
+ public override bool Equals(object obj)
+ {
+ return Equals(obj as WohneinheitBelegungVM);
+ }
+
+ public bool Equals(WohneinheitBelegungVM other)
+ {
+ var equ = other != null &&
+ Oid == other.Oid &&
+ Wohneinheit == other.Wohneinheit &&
+ StartDate == other.StartDate &&
+ EndDate == other.EndDate &&
+ Kommentar == other.Kommentar;
+
+ if (!equ)
+ return false;
+
+ if (Customer == null && other.Customer == null)
+ return true;
+
+ if (Customer == null && other.Customer != null)
+ return false;
+
+ return Customer.Equals(other.Customer);
+ }
+
+ protected override void InitByDataContract(WohneinheitBelegungDC pDataContract)
+ {
+ _Oid = pDataContract.Oid;
+ _Customer = pDataContract.Customer;
+ _EndDate = pDataContract.EndDate;
+ _Kommentar = pDataContract.Kommentar;
+ _StartDate = pDataContract.StartDate;
+ }
+ protected override WohneinheitBelegungDC MapToDataContract(WohneinheitBelegungDC pDataContract, bool doCommit)
+ {
+ pDataContract.Oid = _Oid;
+ pDataContract.Customer = Customer;
+ pDataContract.EndDate = EndDate;
+ pDataContract.Kommentar = Kommentar;
+ pDataContract.StartDate = StartDate;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/WohneinheitVM.cs b/BeWo/ViewModel/WohneinheitVM.cs
new file mode 100644
index 000000000..171e85c11
--- /dev/null
+++ b/BeWo/ViewModel/WohneinheitVM.cs
@@ -0,0 +1,356 @@
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace BeWo.ViewModel
+{
+ public class WohneinheitVM : AbstractDCMapperVM
+ {
+ private long? _Oid;
+ private long? _Version;
+ private string _Notice;
+
+ private string _Wohnname;
+ private string _Zimmername;
+ private decimal? _Miete;
+ private decimal? _Heizung;
+ private decimal? _Strom;
+ private decimal? _Betriebskosten;
+ private decimal? _SonstigeKosten;
+ private decimal? _Kaution;
+ private decimal? _QM;
+ private int? _Baujahr;
+ private string _Mobilierung;
+ private string _Zusatznotiz;
+ private string _Stock;
+ private ImageListVM _ImageListVM;
+
+ public WohneinheitVM() : this(new WohneinheitDC())
+ {
+ Wohnname = "Designer Wohnung";
+ }
+
+ public WohneinheitVM(WohneinheitDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public long? Oid => _Oid;
+
+ public string Wohnname
+ {
+ get { return _Wohnname; }
+ set
+ {
+ if (!AreDifferent(Wohnname, value))
+ return;
+
+ _Wohnname = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Wohnname, value), nameof(Wohnname));
+ FirePropertyChanged(nameof(Wohnname));
+ FirePropertyChanged(nameof(Caption));
+ FirePropertyChanged(nameof(Group));
+ FirePropertyChanged(nameof(Displayname));
+ FirePropertyChanged(nameof(Displayname2));
+ }
+ }
+ public string Zimmername
+ {
+ get { return _Zimmername; }
+ set
+ {
+ if (!AreDifferent(Zimmername, value))
+ return;
+
+ _Zimmername = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Zimmername, value), nameof(Zimmername));
+ FirePropertyChanged(nameof(Zimmername));
+ FirePropertyChanged(nameof(Caption));
+ FirePropertyChanged(nameof(Group));
+ FirePropertyChanged(nameof(Displayname));
+ FirePropertyChanged(nameof(Displayname2));
+ }
+ }
+ public string Name => ToString();
+ public decimal? Miete
+ {
+ get { return _Miete; }
+ set
+ {
+ if (!AreDifferent(Miete, value))
+ return;
+ _Miete = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Miete, value), nameof(Miete));
+ FirePropertyChanged(nameof(Miete));
+ FirePropertyChanged(nameof(Brutto));
+ }
+ }
+ public decimal? Heizung
+ {
+ get { return _Heizung; }
+ set
+ {
+ if (AreDifferent(Heizung, value))
+ {
+ _Heizung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Heizung, value), nameof(Heizung));
+ FirePropertyChanged(nameof(Heizung));
+ FirePropertyChanged(nameof(Brutto));
+ }
+ }
+ }
+ public decimal? Strom
+ {
+ get { return _Strom; }
+ set
+ {
+ if (AreDifferent(Strom, value))
+ {
+ _Strom = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Strom, value), nameof(Strom));
+ FirePropertyChanged(nameof(Strom));
+ FirePropertyChanged(nameof(Brutto));
+ }
+ }
+ }
+ public decimal? Betriebskosten
+ {
+ get { return _Betriebskosten; }
+ set
+ {
+ if (AreDifferent(Betriebskosten, value))
+ {
+ _Betriebskosten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Betriebskosten, value), nameof(Betriebskosten));
+ FirePropertyChanged(nameof(Betriebskosten));
+ FirePropertyChanged(nameof(Brutto));
+ }
+ }
+ }
+ public decimal? SonstigeKosten
+ {
+ get { return _SonstigeKosten; }
+ set
+ {
+ if (AreDifferent(SonstigeKosten, value))
+ {
+ _SonstigeKosten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SonstigeKosten, value), nameof(SonstigeKosten));
+ FirePropertyChanged(nameof(SonstigeKosten));
+ FirePropertyChanged(nameof(Brutto));
+ }
+ }
+ }
+ public decimal? Kaution
+ {
+ get { return _Kaution; }
+ set
+ {
+ if (AreDifferent(Kaution, value))
+ {
+ _Kaution = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Kaution, value), nameof(Kaution));
+ FirePropertyChanged(nameof(Kaution));
+ }
+ }
+ }
+ public decimal? Brutto
+ {
+ get
+ {
+ if (!Miete.HasValue
+ && !Heizung.HasValue
+ && !Strom.HasValue
+ && !Betriebskosten.HasValue
+ && !SonstigeKosten.HasValue)
+ return null;
+
+ return (Miete ?? 0)
+ + (Heizung ?? 0)
+ + (Strom ?? 0)
+ + (Betriebskosten ?? 0)
+ + (SonstigeKosten ?? 0);
+ }
+ }
+ public decimal? QM
+ {
+ get { return _QM; }
+ set
+ {
+ if (!AreDifferent(QM, value))
+ return;
+
+ if (value == 0)
+ value = null;
+
+ _QM = value;
+ StoreDirtyInformation(AreDifferent(DataContract.QM, value), nameof(QM));
+ FirePropertyChanged(nameof(QM));
+ FirePropertyChanged(nameof(FlacheString));
+ }
+ }
+ public string FlacheString => QM?.ToString("########0.00 qm");
+ public int? Baujahr
+ {
+ get { return _Baujahr; }
+ set
+ {
+ if (AreDifferent(Baujahr, value))
+ {
+ _Baujahr = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Baujahr, value), nameof(Baujahr));
+ FirePropertyChanged(nameof(Baujahr));
+ }
+ }
+ }
+ public string Mobilierung
+ {
+ get { return _Mobilierung; }
+ set
+ {
+ if (AreDifferent(Mobilierung, value))
+ {
+ _Mobilierung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Mobilierung, value), nameof(Mobilierung));
+ FirePropertyChanged(nameof(Mobilierung));
+ }
+ }
+ }
+ public string Zusatznotiz
+ {
+ get { return _Zusatznotiz; }
+ set
+ {
+ if (AreDifferent(Zusatznotiz, value))
+ {
+ _Zusatznotiz = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Zusatznotiz, value), nameof(Zusatznotiz));
+ FirePropertyChanged(nameof(Zusatznotiz));
+ }
+ }
+ }
+ public string Stock
+ {
+ get { return _Stock; }
+ set
+ {
+ if (AreDifferent(Stock, value))
+ {
+ _Stock = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Stock, value), nameof(Stock));
+ FirePropertyChanged(nameof(Stock));
+ }
+ }
+ }
+ public ImageListVM ImageListVM
+ {
+ get { return _ImageListVM; }
+
+ set
+ {
+ if (_ImageListVM == value)
+ return;
+
+ _ImageListVM = value;
+ FirePropertyChanged(nameof(ImageListVM));
+ }
+ }
+
+ public override bool IsDirty => base.IsDirty || ImageListVM.IsDirty;
+
+ public bool IsEinzelwohnung => string.IsNullOrEmpty(Zimmername);
+
+ public string Caption => IsEinzelwohnung ? Wohnname : Zimmername ;
+ public string Group => IsEinzelwohnung ? null : Wohnname;
+
+ public string Displayname => IsEinzelwohnung ? Wohnname : Wohnname + "\n- " + Zimmername;
+ public string Displayname2 => IsEinzelwohnung ? Wohnname : Wohnname + " - " + Zimmername;
+
+ public bool HasEmptyZimmername()
+ {
+ return string.IsNullOrEmpty(Zimmername);
+ }
+
+ public static int Compare(WohneinheitVM vm1, WohneinheitVM vm2)
+ {
+ if (vm1 is null)
+ return 1;
+
+ if (vm2 is null)
+ return -1;
+
+ var compare1 = vm1.Wohnname.CompareTo(vm2.Wohnname);
+
+ if (compare1 != 0)
+ return compare1;
+
+ var compare2 = vm1.Zimmername.CompareTo(vm2.Zimmername);
+
+ return compare2;
+ }
+
+ protected override void InitByDataContract(WohneinheitDC pDataContract)
+ {
+ _Oid = pDataContract.Oid;
+ _Version = pDataContract.Version;
+ _Notice = pDataContract.Notice;
+
+ _Wohnname = pDataContract.Wohnname;
+ _Zimmername = pDataContract.Zimmername;
+ _Miete = pDataContract.Miete;
+ _Heizung = pDataContract.Heizung;
+ _Strom = pDataContract.Strom;
+ _Betriebskosten = pDataContract.Betriebskosten;
+ _SonstigeKosten = pDataContract.SonstigeKosten;
+ _Kaution = pDataContract.Kaution;
+ _QM = pDataContract.QM;
+ _Baujahr = pDataContract.Baujahr;
+ _Mobilierung = pDataContract.Mobilierung;
+ _Zusatznotiz = pDataContract.Zusatznotiz;
+ _Stock = pDataContract.Stock;
+
+ _ImageListVM = new ImageListVM(pDataContract.Grundrisse ?? (pDataContract.Grundrisse = new List()));
+ }
+ protected override WohneinheitDC MapToDataContract(WohneinheitDC bDataContract, bool doCommit)
+ {
+ bDataContract.Oid = _Oid;
+ bDataContract.Notice = _Notice;
+ bDataContract.Version = _Version;
+
+ bDataContract.Wohnname = _Wohnname;
+ bDataContract.Zimmername = _Zimmername;
+ bDataContract.Miete = _Miete;
+ bDataContract.Heizung = _Heizung;
+ bDataContract.Strom = _Strom;
+ bDataContract.Betriebskosten = _Betriebskosten;
+ bDataContract.SonstigeKosten = _SonstigeKosten;
+ bDataContract.Kaution = _Kaution;
+ bDataContract.QM = _QM;
+ bDataContract.Baujahr = _Baujahr;
+ bDataContract.Mobilierung = _Mobilierung;
+ bDataContract.Zusatznotiz = _Zusatznotiz;
+ bDataContract.Stock = _Stock;
+
+ bDataContract.Belegungen = null;
+
+ bDataContract.Grundrisse = ImageListVM.CopyToDCList(doCommit);
+
+ return bDataContract;
+ }
+
+ public override string ToString()
+ {
+ if (HasEmptyZimmername())
+ return Wohnname;
+ return $"{Wohnname}, {Zimmername}";
+ }
+ }
+}
diff --git a/BeWo/ViewModel/WohnheimVM.cs b/BeWo/ViewModel/WohnheimVM.cs
index 13a3cf5ff..8851bb0a4 100644
--- a/BeWo/ViewModel/WohnheimVM.cs
+++ b/BeWo/ViewModel/WohnheimVM.cs
@@ -57,22 +57,74 @@ namespace BeWo.ViewModel
private WohnheimEmployeeRelationListVM _WohnheimEmployeeRelations;
private WohnheimCustomerRelationListVM _WohnheimCustomerRelations;
+ private WohneinheitListVM _WohneinheitListVM;
+ private WohneinheitBelegungListVM _WohneinheitBelegungListVM;
private CompactTeamDC _WohnheimTeamRelations;
- public WohnheimVM(WohnheimDC pWohnheimDC)
+ public WohnheimVM()
+ {
+ _WohnheimName = "Design Test";
+
+ PermissionWohneinheitView = true;
+ PermissionWohneinheitCreate = true;
+ PermissionWohneinheitEdit = true;
+ PermissionWohneinheitDelete = true;
+
+ PermissionWohneinheitBelegungView = true;
+ PermissionWohneinheitBelegungCreate = true;
+ PermissionWohneinheitBelegungEdit = true;
+ PermissionWohneinheitBelegungDelete = true;
+
+ var vms = new System.ComponentModel.BindingList()
+ {
+ new WohneinheitVM(),
+ new WohneinheitVM()
+ };
+
+ WohneinheitListVM = new WohneinheitListVM();
+ WohneinheitListVM.VMList = vms;
+ }
+ public WohnheimVM(WohnheimDC pWohnheimDC, List customers)
: base(pWohnheimDC, pWohnheimDC.WohnheimOid == null)
{
-
+ Customers = customers;
}
public override bool IsDirty
{
get
{
- return base.IsDirty || WohnheimEmployeeRelations.IsDirty || WohnheimCustomerRelations.IsDirty;
+ return base.IsDirty || WohnheimEmployeeRelations.IsDirty
+ || WohnheimCustomerRelations.IsDirty
+ || WohneinheitListVM.IsDirty
+ || WohneinheitBelegungListVM.IsDirty;
}
}
+ public List Customers { get; set; }
+
+ public TimeSpan IntervalRange { get; set; }
+ public bool IntervalChanging { get; set; }
+
+ public bool PermissionWohneinheitTabitemView => PermissionWohneinheitView || PermissionWohneinheitBelegungView;
+ public bool PermissionWohneinheitButton => PermissionWohneinheitDelete || PermissionWohneinheitGallery;
+ public bool PermissionWohneinheitGallery => PermissionWohneinheitGalleryEdit || PermissionWohneinheitGalleryView;
+
+ public bool PermissionWohneinheitView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_View);
+ public bool PermissionWohneinheitCreate { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Create);
+ public bool PermissionWohneinheitEdit { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Edit);
+ public bool PermissionWohneinheitDelete { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Delete);
+
+ public bool PermissionWohneinheitGalleryEdit { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Gallery_Edit);
+ public bool PermissionWohneinheitGalleryView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Gallery_View);
+
+ public bool PermissionWohneinheitBelegungView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Belegung_View);
+ public bool PermissionWohneinheitBelegungCreate { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Belegung_Create);
+ public bool PermissionWohneinheitBelegungEdit { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Belegung_Edit);
+ public bool PermissionWohneinheitBelegungDelete { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Belegung_Delete);
+
+ public bool Permission1 { get; } = true;
+
public bool IsArchived
{
get { return _IsArchived; }
@@ -105,7 +157,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_WohnheimName);
}
}
-
public String Strasse
{
@@ -120,7 +171,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Street);
}
}
-
public String PLZ
{
get
@@ -134,7 +184,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_PLZ);
}
}
-
public String Ort
{
get
@@ -148,7 +197,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Ort);
}
}
-
public String Bemerkung
{
@@ -164,7 +212,6 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_Bemerkung);
}
}
-
public String PflichtbesetzungStart
{
@@ -278,6 +325,33 @@ namespace BeWo.ViewModel
FirePropertyChanged(PropertyName_WohnheimCustomerRelations);
}
}
+ public WohneinheitListVM WohneinheitListVM
+ {
+ get { return _WohneinheitListVM; }
+
+ set
+ {
+ if (_WohneinheitListVM == value)
+ return;
+
+ _WohneinheitListVM = value;
+ FirePropertyChanged(nameof(WohneinheitListVM));
+ }
+ }
+ public WohneinheitBelegungListVM WohneinheitBelegungListVM
+ {
+ get { return _WohneinheitBelegungListVM; }
+
+ set
+ {
+ if (_WohneinheitBelegungListVM == value)
+ return;
+
+ _WohneinheitBelegungListVM = value;
+ FirePropertyChanged(nameof(WohneinheitBelegungListVM));
+ }
+ }
+
public CompactTeamDC WohnheimTeamRelations
{
get { return _WohnheimTeamRelations; }
@@ -289,14 +363,75 @@ namespace BeWo.ViewModel
}
}
- // HACK: Bug bei den RadioButtons, geben false nicht weiter
- // TODO nochmal angucken wenn mehr als zwei Optionen, dann in listbox und an selected item binden
- // http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2146568&SiteID=1
+ public bool AddWohneinheit()
+ {
+ if (!PermissionWohneinheitCreate)
+ return false;
+ var vmlist = WohneinheitListVM;
+
+ vmlist.CurrentVM = vmlist.NewVM;
+
+ return true;
+ }
+ public bool EditWohneinheit(WohneinheitVM vm)
+ {
+ if (!PermissionWohneinheitEdit)
+ return false;
+
+ if (vm is null || !WohneinheitListVM.VMList.Contains(vm))
+ return false;
+
+ WohneinheitListVM.EditVM = vm;
+ WohneinheitListVM.CurrentVM = vm;
+
+ return true;
+ }
+
+ public bool AddBelegung(object wohneinheit_oid = null, DateTime? start = null)
+ {
+ if (!PermissionWohneinheitBelegungCreate)
+ return false;
+
+ var beleg_list_vm = WohneinheitBelegungListVM;
+
+ var vm = beleg_list_vm.NewVM;
+
+ var today = DateTime.Today;
+ var first_next_month = new DateTime(today.Year, today.Month, 1);
+
+ vm.StartDate = first_next_month;
+
+ if(wohneinheit_oid is long oid)
+ {
+ vm.Wohneinheit = WohneinheitListVM.VMList.First(x => x.Oid == oid);
+ }
+
+ if(start is DateTime startDate)
+ {
+ vm.StartDate = startDate;
+ }
+
+ beleg_list_vm.CurrentVM = vm;
+
+ return true;
+ }
+ public bool EditBelegung(WohneinheitBelegungVM vm)
+ {
+ if (!PermissionWohneinheitBelegungEdit)
+ return false;
+
+ if (vm is null || !WohneinheitBelegungListVM.VMList.Contains(vm))
+ return false;
+
+ WohneinheitBelegungListVM.EditVM = vm;
+ WohneinheitBelegungListVM.CurrentVM = vm;
+
+ return true;
+ }
protected override void InitByDataContract(WohnheimDC pDataContract)
{
-
_WohnheimName = pDataContract.WohnheimName;
_Strasse = pDataContract.Strasse;
_PLZ = pDataContract.PLZ;
@@ -314,11 +449,16 @@ namespace BeWo.ViewModel
WohnheimEmployeeRelations = VMFactory.CreateWohnheimEmployeeRelationListVM(pDataContract.RelatedEmployees ?? (pDataContract.RelatedEmployees = new List()));
WohnheimCustomerRelations = VMFactory.CreateWohnheimCustomerRelationListVM(pDataContract.RelatedCustomers ?? (pDataContract.RelatedCustomers = new List()));
- }
+ if (pDataContract.Wohneinheiten is null)
+ pDataContract.Wohneinheiten = new List();
+ VMFactory.CreateWohneinheitListVMs(pDataContract.Wohneinheiten, out var einheit, out var beleg);
+
+ WohneinheitListVM = einheit;
+ WohneinheitBelegungListVM = beleg;
+ }
protected override WohnheimDC MapToDataContract(WohnheimDC pDataContract, bool doCommit)
{
-
pDataContract.WohnheimName = _WohnheimName;
pDataContract.Strasse = _Strasse;
pDataContract.PLZ = _PLZ;
@@ -331,12 +471,38 @@ namespace BeWo.ViewModel
pDataContract.Sortierungsart = _Sortierungsart;
pDataContract.AbsteigendeSortierung = _AbsteigendeSortierung;
-
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
pDataContract.RelatedEmployees = _WohnheimEmployeeRelations.CopyToDCList(doCommit);
pDataContract.RelatedCustomers = _WohnheimCustomerRelations.CopyToDCList(doCommit);
+ //pDataContract.Wohneinheiten = _WohneinheitListVM.CopyToDCList(doCommit);
+
+ pDataContract.Wohneinheiten = null;
+ var einheit_vm2dc = new Dictionary();
+ foreach (var vm in _WohneinheitListVM.VMList)
+ {
+ var dc = doCommit ? vm.CommitToDataContract() : vm.CopyToEmptyDataContract();
+
+ if (pDataContract.Wohneinheiten is null)
+ pDataContract.Wohneinheiten = new List();
+
+ einheit_vm2dc.Add(vm, dc);
+
+ pDataContract.Wohneinheiten.Add(dc);
+ }
+
+ foreach (var vm in _WohneinheitBelegungListVM.VMList)
+ {
+ var dc = doCommit ? vm.CommitToDataContract() : vm.CopyToEmptyDataContract();
+
+ if (einheit_vm2dc[vm.Wohneinheit].Belegungen is null)
+ einheit_vm2dc[vm.Wohneinheit].Belegungen = new List();
+
+ if (!einheit_vm2dc[vm.Wohneinheit].Belegungen.Contains(dc))
+ einheit_vm2dc[vm.Wohneinheit].Belegungen.Add(dc);
+ }
+
return pDataContract;
}
}
diff --git a/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichBundVM.cs b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichBundVM.cs
new file mode 100644
index 000000000..6771d3435
--- /dev/null
+++ b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichBundVM.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BeWo.Validation;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+
+namespace BeWo.ViewModel.Wohnhilfe
+{
+ public class CustomerWohnhilfeBereichBundVM : AbstractDCMapperVM
+ {
+ private Verbandszugehorigkeit? _Verbandszugehorigkeit;
+ private Geschlecht? _Geschlecht;
+ private int? _AlterAmStichtag;
+ private int? _Haushaltsgrosse;
+ private string _BerichtseinheitID;
+ private Unterbringungsart? _Unterbringungsart;
+ private int? _OrtDerEinrichtung;
+ private Angebot? _Angebot;
+
+ public CustomerWohnhilfeBereichBundVM()
+ {
+ _Verbandszugehorigkeit = BS.Shared.DataContracts.Wohnhilfe.Verbandszugehorigkeit.Arbeiterwohlfahrt;
+ _Geschlecht = BS.Shared.DataContracts.Wohnhilfe.Geschlecht.Mannlich;
+ _AlterAmStichtag = 1000;
+ }
+
+ public CustomerWohnhilfeBereichBundVM(CustomerWohnhilfeBereichBundDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public IEnumerable VerbandszugehorigkeitTypes => Utils.GetAllEnumValues();
+ public IEnumerable GeschlechtTypes => Utils.GetAllEnumValues();
+ public IEnumerable UnterbringungsartTypes => Utils.GetAllEnumValues();
+ public IEnumerable AngebotTypes => Utils.GetAllEnumValues();
+
+ public Verbandszugehorigkeit? Verbandszugehorigkeit
+ {
+ get { return _Verbandszugehorigkeit; }
+ set
+ {
+ if (!AreDifferent(_Verbandszugehorigkeit, value))
+ return;
+
+ _Verbandszugehorigkeit = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Verbandszugehorigkeit, value), nameof(Verbandszugehorigkeit));
+ FirePropertyChanged(nameof(Verbandszugehorigkeit));
+ }
+ }
+
+ public Geschlecht? Geschlecht
+ {
+ get { return _Geschlecht; }
+ set
+ {
+ if (!AreDifferent(_Geschlecht, value))
+ return;
+
+ _Geschlecht = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Geschlecht, value), nameof(Geschlecht));
+ FirePropertyChanged(nameof(Geschlecht));
+ }
+ }
+
+ public int? AlterAmStichtag
+ {
+ get { return _AlterAmStichtag; }
+ set
+ {
+ if (!AreDifferent(_AlterAmStichtag, value))
+ return;
+
+ _AlterAmStichtag = value;
+ StoreDirtyInformation(AreDifferent(DataContract.AlterAmStichtag, value), nameof(AlterAmStichtag));
+ FirePropertyChanged(nameof(AlterAmStichtag));
+ }
+ }
+
+ public int? Haushaltsgrosse
+ {
+ get { return _Haushaltsgrosse; }
+ set
+ {
+ if (!AreDifferent(_Haushaltsgrosse, value))
+ return;
+
+ _Haushaltsgrosse = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Haushaltsgrosse, value), nameof(Haushaltsgrosse));
+ FirePropertyChanged(nameof(Haushaltsgrosse));
+ }
+ }
+
+ public string BerichtseinheitID
+ {
+ get { return _BerichtseinheitID; }
+ set
+ {
+ if (!AreDifferent(_BerichtseinheitID, value))
+ return;
+
+ _BerichtseinheitID = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BerichtseinheitID, value), nameof(BerichtseinheitID));
+ FirePropertyChanged(nameof(BerichtseinheitID));
+ }
+ }
+
+ public Unterbringungsart? Unterbringungsart
+ {
+ get { return _Unterbringungsart; }
+ set
+ {
+ if (!AreDifferent(_Unterbringungsart, value))
+ return;
+
+ _Unterbringungsart = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Unterbringungsart, value), nameof(Unterbringungsart));
+ FirePropertyChanged(nameof(Unterbringungsart));
+ }
+ }
+
+ public int? OrtDerEinrichtung
+ {
+ get { return _OrtDerEinrichtung; }
+ set
+ {
+ if (!AreDifferent(_OrtDerEinrichtung, value))
+ return;
+
+ _OrtDerEinrichtung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.OrtDerEinrichtung, value), nameof(OrtDerEinrichtung));
+ FirePropertyChanged(nameof(OrtDerEinrichtung));
+ }
+ }
+
+ public Angebot? Angebot
+ {
+ get { return _Angebot; }
+ set
+ {
+ if (!AreDifferent(_Angebot, value))
+ return;
+
+ _Angebot = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Angebot, value), nameof(Angebot));
+ FirePropertyChanged(nameof(Angebot));
+ }
+ }
+
+ protected override void InitByDataContract(CustomerWohnhilfeBereichBundDC pDataContract)
+ {
+ _Verbandszugehorigkeit = pDataContract.Verbandszugehorigkeit;
+ _Geschlecht = pDataContract.Geschlecht;
+ _AlterAmStichtag = pDataContract.AlterAmStichtag;
+ _Haushaltsgrosse = pDataContract.Haushaltsgrosse;
+ _BerichtseinheitID = pDataContract.BerichtseinheitID;
+ _Unterbringungsart = pDataContract.Unterbringungsart;
+ _OrtDerEinrichtung = pDataContract.OrtDerEinrichtung;
+ _Angebot = pDataContract.Angebot;
+ }
+
+ protected override CustomerWohnhilfeBereichBundDC MapToDataContract(CustomerWohnhilfeBereichBundDC pDataContract, bool doCommit)
+ {
+ pDataContract.Verbandszugehorigkeit = _Verbandszugehorigkeit;
+ pDataContract.Geschlecht = _Geschlecht;
+ pDataContract.AlterAmStichtag = _AlterAmStichtag;
+ pDataContract.Haushaltsgrosse = _Haushaltsgrosse;
+ pDataContract.BerichtseinheitID = _BerichtseinheitID;
+ pDataContract.Unterbringungsart = _Unterbringungsart;
+ pDataContract.OrtDerEinrichtung = _OrtDerEinrichtung;
+ pDataContract.Angebot = _Angebot;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichEinkommenUndArbeitVM.cs b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichEinkommenUndArbeitVM.cs
new file mode 100644
index 000000000..50e99d2ff
--- /dev/null
+++ b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichEinkommenUndArbeitVM.cs
@@ -0,0 +1,245 @@
+using System;
+using System.Collections.Generic;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+
+namespace BeWo.ViewModel.Wohnhilfe
+{
+ public class CustomerWohnhilfeBereichEinkommenUndArbeitVM : AbstractDCMapperVM
+ {
+ private Einkommenssituation _BeginnEinkommenssituation;
+ private Einkommenssituation _EndeEinkommenssituation;
+ private AufstockungEinkommen _BeginnAufstockungEinkommen;
+ private AufstockungEinkommen _EndeAufstockungEinkommen;
+ private WohnhilfeBoolData _BeginnEigenesBankkonto;
+ private WohnhilfeBoolData _EndeEigenesBankkonto;
+ private WohnhilfeBoolData _Uberschuldung;
+ private Berufsabschluss _Berufsabschluss;
+ private WohnhilfeBoolData _ErwerbsfahigkeitSinnSGB;
+ private Beschaftigungsstatus _BeginnBeschaftigungsstatus;
+ private Beschaftigungsstatus _EndeBeschaftigungsstatus;
+ private DauerArbeitslosigkeit _DauerArbeitslosigkeit;
+
+ public CustomerWohnhilfeBereichEinkommenUndArbeitVM() {
+ _BeginnEinkommenssituation = Einkommenssituation.NichtAbgefragt;
+ _EndeEinkommenssituation = Einkommenssituation.SBG3Arbeitslosengeld1;
+ _Uberschuldung = WohnhilfeBoolData.Ja;
+ }
+
+ public CustomerWohnhilfeBereichEinkommenUndArbeitVM(CustomerWohnhilfeBereichEinkommenUndArbeitDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public IEnumerable WohnhilfeBoolDataTypes => Utils.GetAllEnumValues();
+ public IEnumerable EinkommenssituationTypes => Utils.GetAllEnumValues();
+ public IEnumerable AufstockungEinkommenTypes => Utils.GetAllEnumValues();
+ public IEnumerable BerufsschulabschlussTypes => Utils.GetAllEnumValues();
+ public IEnumerable BeschaftigungsstatusTypes => Utils.GetAllEnumValues();
+ public IEnumerable DauerArbeitslosigkeitTypes => Utils.GetAllEnumValues();
+
+ public Einkommenssituation BeginnEinkommenssituation
+ {
+ get { return _BeginnEinkommenssituation; }
+ set
+ {
+ if (!AreDifferent(_BeginnEinkommenssituation, value))
+ return;
+
+ _BeginnEinkommenssituation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnEinkommenssituation, value), nameof(BeginnEinkommenssituation));
+ FirePropertyChanged(nameof(BeginnEinkommenssituation));
+ }
+ }
+
+ public Einkommenssituation EndeEinkommenssituation
+ {
+ get { return _EndeEinkommenssituation; }
+ set
+ {
+ if (!AreDifferent(_EndeEinkommenssituation, value))
+ return;
+
+ _EndeEinkommenssituation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeEinkommenssituation, value), nameof(EndeEinkommenssituation));
+ FirePropertyChanged(nameof(EndeEinkommenssituation));
+ }
+ }
+
+ public AufstockungEinkommen BeginnAufstockungEinkommen
+ {
+ get { return _BeginnAufstockungEinkommen; }
+ set
+ {
+ if (!AreDifferent(_BeginnAufstockungEinkommen, value))
+ return;
+
+ _BeginnAufstockungEinkommen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnAufstockungEinkommen, value), nameof(BeginnAufstockungEinkommen));
+ FirePropertyChanged(nameof(BeginnAufstockungEinkommen));
+ }
+ }
+
+ public AufstockungEinkommen EndeAufstockungEinkommen
+ {
+ get { return _EndeAufstockungEinkommen; }
+ set
+ {
+ if (!AreDifferent(_EndeAufstockungEinkommen, value))
+ return;
+
+ _EndeAufstockungEinkommen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeAufstockungEinkommen, value), nameof(EndeAufstockungEinkommen));
+ FirePropertyChanged(nameof(EndeAufstockungEinkommen));
+ }
+ }
+
+ public WohnhilfeBoolData BeginnEigenesBankkonto
+ {
+ get { return _BeginnEigenesBankkonto; }
+ set
+ {
+ if (!AreDifferent(_BeginnEigenesBankkonto, value))
+ return;
+
+ _BeginnEigenesBankkonto = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnEigenesBankkonto, value), nameof(BeginnEigenesBankkonto));
+ FirePropertyChanged(nameof(BeginnEigenesBankkonto));
+ }
+ }
+
+ public WohnhilfeBoolData EndeEigenesBankkonto
+ {
+ get { return _EndeEigenesBankkonto; }
+ set
+ {
+ if (!AreDifferent(_EndeEigenesBankkonto, value))
+ return;
+
+ _EndeEigenesBankkonto = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeEigenesBankkonto, value), nameof(EndeEigenesBankkonto));
+ FirePropertyChanged(nameof(EndeEigenesBankkonto));
+ }
+ }
+
+ public WohnhilfeBoolData Uberschuldung
+ {
+ get { return _Uberschuldung; }
+ set
+ {
+ if (!AreDifferent(_Uberschuldung, value))
+ return;
+
+ _Uberschuldung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Uberschuldung, value), nameof(Uberschuldung));
+ FirePropertyChanged(nameof(Uberschuldung));
+ }
+ }
+
+ public Berufsabschluss Berufsabschluss
+ {
+ get { return _Berufsabschluss; }
+ set
+ {
+ if (!AreDifferent(_Berufsabschluss, value))
+ return;
+
+ _Berufsabschluss = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Berufsabschluss, value), nameof(Berufsabschluss));
+ FirePropertyChanged(nameof(Berufsabschluss));
+ }
+ }
+
+ public WohnhilfeBoolData ErwerbsfahigkeitSinnSGB
+ {
+ get { return _ErwerbsfahigkeitSinnSGB; }
+ set
+ {
+ if (!AreDifferent(_ErwerbsfahigkeitSinnSGB, value))
+ return;
+
+ _ErwerbsfahigkeitSinnSGB = value;
+ StoreDirtyInformation(AreDifferent(DataContract.ErwerbsfahigkeitSinnSGB, value), nameof(ErwerbsfahigkeitSinnSGB));
+ FirePropertyChanged(nameof(ErwerbsfahigkeitSinnSGB));
+ }
+ }
+
+ public Beschaftigungsstatus BeginnBeschaftigungsstatus
+ {
+ get { return _BeginnBeschaftigungsstatus; }
+ set
+ {
+ if (!AreDifferent(_BeginnBeschaftigungsstatus, value))
+ return;
+
+ _BeginnBeschaftigungsstatus = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnBeschaftigungsstatus, value), nameof(BeginnBeschaftigungsstatus));
+ FirePropertyChanged(nameof(BeginnBeschaftigungsstatus));
+ }
+ }
+
+ public Beschaftigungsstatus EndeBeschaftigungsstatus
+ {
+ get { return _EndeBeschaftigungsstatus; }
+ set
+ {
+ if (!AreDifferent(_EndeBeschaftigungsstatus, value))
+ return;
+
+ _EndeBeschaftigungsstatus = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeBeschaftigungsstatus, value), nameof(EndeBeschaftigungsstatus));
+ FirePropertyChanged(nameof(EndeBeschaftigungsstatus));
+ }
+ }
+
+ public DauerArbeitslosigkeit DauerArbeitslosigkeit
+ {
+ get { return _DauerArbeitslosigkeit; }
+ set
+ {
+ if (!AreDifferent(_DauerArbeitslosigkeit, value))
+ return;
+
+ _DauerArbeitslosigkeit = value;
+ StoreDirtyInformation(AreDifferent(DataContract.DauerArbeitslosigkeit, value), nameof(DauerArbeitslosigkeit));
+ FirePropertyChanged(nameof(DauerArbeitslosigkeit));
+ }
+ }
+
+ protected override void InitByDataContract(CustomerWohnhilfeBereichEinkommenUndArbeitDC pDataContract)
+ {
+ _BeginnEinkommenssituation = pDataContract.BeginnEinkommenssituation;
+ _EndeEinkommenssituation = pDataContract.EndeEinkommenssituation;
+ _BeginnAufstockungEinkommen = pDataContract.BeginnAufstockungEinkommen;
+ _EndeAufstockungEinkommen = pDataContract.EndeAufstockungEinkommen;
+ _BeginnEigenesBankkonto = pDataContract.BeginnEigenesBankkonto;
+ _EndeEigenesBankkonto = pDataContract.EndeEigenesBankkonto;
+ _Uberschuldung = pDataContract.Uberschuldung;
+ _Berufsabschluss = pDataContract.Berufsabschluss;
+ _ErwerbsfahigkeitSinnSGB = pDataContract.ErwerbsfahigkeitSinnSGB;
+ _BeginnBeschaftigungsstatus = pDataContract.BeginnBeschaftigungsstatus;
+ _EndeBeschaftigungsstatus = pDataContract.EndeBeschaftigungsstatus;
+ _DauerArbeitslosigkeit = pDataContract.DauerArbeitslosigkeit;
+ }
+
+ protected override CustomerWohnhilfeBereichEinkommenUndArbeitDC MapToDataContract(CustomerWohnhilfeBereichEinkommenUndArbeitDC pDataContract, bool doCommit)
+ {
+ pDataContract.BeginnEinkommenssituation = _BeginnEinkommenssituation;
+ pDataContract.EndeEinkommenssituation = _EndeEinkommenssituation;
+ pDataContract.BeginnAufstockungEinkommen = _BeginnAufstockungEinkommen;
+ pDataContract.EndeAufstockungEinkommen = _EndeAufstockungEinkommen;
+ pDataContract.BeginnEigenesBankkonto = _BeginnEigenesBankkonto;
+ pDataContract.EndeEigenesBankkonto = _EndeEigenesBankkonto;
+ pDataContract.Uberschuldung = _Uberschuldung;
+ pDataContract.Berufsabschluss = _Berufsabschluss;
+ pDataContract.ErwerbsfahigkeitSinnSGB = _ErwerbsfahigkeitSinnSGB;
+ pDataContract.BeginnBeschaftigungsstatus = _BeginnBeschaftigungsstatus;
+ pDataContract.EndeBeschaftigungsstatus = _EndeBeschaftigungsstatus;
+ pDataContract.DauerArbeitslosigkeit = _DauerArbeitslosigkeit;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialeKontakteVM.cs b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialeKontakteVM.cs
new file mode 100644
index 000000000..dc04fad58
--- /dev/null
+++ b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialeKontakteVM.cs
@@ -0,0 +1,418 @@
+using System;
+using System.Collections.Generic;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+
+namespace BeWo.ViewModel.Wohnhilfe
+{
+ public class CustomerWohnhilfeBereichSozialeKontakteVM : AbstractDCMapperVM
+ {
+ private bool _CanEditBeginnKontakt;
+ private bool _CanEditEndeKontakt;
+
+ private WohnhilfeBoolData _BeginnSozialeKontakte;
+ private bool _BeginnKontaktPartner;
+ private bool _BeginnKontaktMindKinder;
+ private bool _BeginnKontaktVolljahrKinderElternVerwandten;
+ private bool _BeginnKontaktFreundenBekannten;
+ private bool _BeginnKontaktSelbsthilfe;
+ private bool _BeginnKontaktSonstige;
+ private WohnhilfeBoolData _EndeSozialeKontakte;
+ private bool _EndeKontaktPartner;
+ private bool _EndeKontaktMindKinder;
+ private bool _EndeKontaktVolljahrKinderElternVerwandten;
+ private bool _EndeKontaktFreundenBekannten;
+ private bool _EndeKontaktSelbsthilfe;
+ private bool _EndeKontaktSonstige;
+ private Krankenversicherung _BeginnKrankenversicherung;
+ private Krankenversicherung _EndeKrankenversicherung;
+ private KontaktArzt _BeginnKontaktArzt;
+ private KontaktArzt _EndeKontaktArzt;
+ private WohnhilfeBoolData _VorlageSchwerbehindertenausweises;
+
+ public CustomerWohnhilfeBereichSozialeKontakteVM()
+ {
+ _BeginnSozialeKontakte = WohnhilfeBoolData.Ja;
+ _BeginnKontaktPartner = true;
+ _EndeKrankenversicherung = Krankenversicherung.Nein;
+ }
+
+ public CustomerWohnhilfeBereichSozialeKontakteVM(CustomerWohnhilfeBereichSozialeKontakteDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public IEnumerable WohnhilfeBoolDataTypes => Utils.GetAllEnumValues();
+ public IEnumerable KrankenversicherungTypes => Utils.GetAllEnumValues();
+ public IEnumerable KontaktArztTypes => Utils.GetAllEnumValues();
+
+
+ public bool CanEditBeginnKontakt
+ {
+ get { return _CanEditBeginnKontakt; }
+ set
+ {
+ if (!AreDifferent(_CanEditBeginnKontakt, value))
+ return;
+
+ _CanEditBeginnKontakt = value;
+
+ //if (!value)
+ //{
+ // BeginnKontaktFreundenBekannten = false;
+ // BeginnKontaktMindKinder = false;
+ // BeginnKontaktPartner = false;
+ // BeginnKontaktSelbsthilfe = false;
+ // BeginnKontaktSonstige = false;
+ // BeginnKontaktVolljahrKinderElternVerwandten = false;
+ //}
+
+ FirePropertyChanged(nameof(CanEditBeginnKontakt));
+ }
+ }
+
+ public bool CanEditEndeKontakt
+ {
+ get { return _CanEditEndeKontakt; }
+ set
+ {
+ if (!AreDifferent(_CanEditEndeKontakt, value))
+ return;
+
+ _CanEditEndeKontakt = value;
+
+ //if (!value)
+ //{
+ // EndeKontaktFreundenBekannten = false;
+ // EndeKontaktMindKinder = false;
+ // EndeKontaktPartner = false;
+ // EndeKontaktSelbsthilfe = false;
+ // EndeKontaktSonstige = false;
+ // EndeKontaktVolljahrKinderElternVerwandten = false;
+ //}
+
+ FirePropertyChanged(nameof(CanEditEndeKontakt));
+ }
+ }
+
+ public WohnhilfeBoolData BeginnSozialeKontakte
+ {
+ get { return _BeginnSozialeKontakte; }
+ set
+ {
+ if (!AreDifferent(_BeginnSozialeKontakte, value))
+ return;
+
+ _BeginnSozialeKontakte = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnSozialeKontakte, value), nameof(BeginnSozialeKontakte));
+ FirePropertyChanged(nameof(BeginnSozialeKontakte));
+
+ CanEditBeginnKontakt = value == WohnhilfeBoolData.Ja;
+ }
+ }
+
+ public bool BeginnKontaktPartner
+ {
+ get { return _BeginnKontaktPartner; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktPartner, value))
+ return;
+
+ _BeginnKontaktPartner = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktPartner, value), nameof(BeginnKontaktPartner));
+ FirePropertyChanged(nameof(BeginnKontaktPartner));
+ }
+ }
+
+ public bool BeginnKontaktMindKinder
+ {
+ get { return _BeginnKontaktMindKinder; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktMindKinder, value))
+ return;
+
+ _BeginnKontaktMindKinder = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktMindKinder, value), nameof(BeginnKontaktMindKinder));
+ FirePropertyChanged(nameof(BeginnKontaktMindKinder));
+ }
+ }
+
+ public bool BeginnKontaktVolljahrKinderElternVerwandten
+ {
+ get { return _BeginnKontaktVolljahrKinderElternVerwandten; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktVolljahrKinderElternVerwandten, value))
+ return;
+
+ _BeginnKontaktVolljahrKinderElternVerwandten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktVolljahrKinderElternVerwandten, value), nameof(BeginnKontaktVolljahrKinderElternVerwandten));
+ FirePropertyChanged(nameof(BeginnKontaktVolljahrKinderElternVerwandten));
+ }
+ }
+
+ public bool BeginnKontaktFreundenBekannten
+ {
+ get { return _BeginnKontaktFreundenBekannten; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktFreundenBekannten, value))
+ return;
+
+ _BeginnKontaktFreundenBekannten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktFreundenBekannten, value), nameof(BeginnKontaktFreundenBekannten));
+ FirePropertyChanged(nameof(BeginnKontaktFreundenBekannten));
+ }
+ }
+
+ public bool BeginnKontaktSelbsthilfe
+ {
+ get { return _BeginnKontaktSelbsthilfe; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktSelbsthilfe, value))
+ return;
+
+ _BeginnKontaktSelbsthilfe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktSelbsthilfe, value), nameof(BeginnKontaktSelbsthilfe));
+ FirePropertyChanged(nameof(BeginnKontaktSelbsthilfe));
+ }
+ }
+
+ public bool BeginnKontaktSonstige
+ {
+ get { return _BeginnKontaktSonstige; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktSonstige, value))
+ return;
+
+ _BeginnKontaktSonstige = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktSonstige, value), nameof(BeginnKontaktSonstige));
+ FirePropertyChanged(nameof(BeginnKontaktSonstige));
+ }
+ }
+
+ public WohnhilfeBoolData EndeSozialeKontakte
+ {
+ get { return _EndeSozialeKontakte; }
+ set
+ {
+ if (!AreDifferent(_EndeSozialeKontakte, value))
+ return;
+
+ _EndeSozialeKontakte = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeSozialeKontakte, value), nameof(EndeSozialeKontakte));
+ FirePropertyChanged(nameof(EndeSozialeKontakte));
+
+ CanEditEndeKontakt = value == WohnhilfeBoolData.Ja;
+ }
+ }
+
+ public bool EndeKontaktPartner
+ {
+ get { return _EndeKontaktPartner; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktPartner, value))
+ return;
+
+ _EndeKontaktPartner = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktPartner, value), nameof(EndeKontaktPartner));
+ FirePropertyChanged(nameof(EndeKontaktPartner));
+ }
+ }
+
+ public bool EndeKontaktMindKinder
+ {
+ get { return _EndeKontaktMindKinder; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktMindKinder, value))
+ return;
+
+ _EndeKontaktMindKinder = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktMindKinder, value), nameof(EndeKontaktMindKinder));
+ FirePropertyChanged(nameof(EndeKontaktMindKinder));
+ }
+ }
+
+ public bool EndeKontaktVolljahrKinderElternVerwandten
+ {
+ get { return _EndeKontaktVolljahrKinderElternVerwandten; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktVolljahrKinderElternVerwandten, value))
+ return;
+
+ _EndeKontaktVolljahrKinderElternVerwandten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktVolljahrKinderElternVerwandten, value), nameof(EndeKontaktVolljahrKinderElternVerwandten));
+ FirePropertyChanged(nameof(EndeKontaktVolljahrKinderElternVerwandten));
+ }
+ }
+
+ public bool EndeKontaktFreundenBekannten
+ {
+ get { return _EndeKontaktFreundenBekannten; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktFreundenBekannten, value))
+ return;
+
+ _EndeKontaktFreundenBekannten = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktFreundenBekannten, value), nameof(EndeKontaktFreundenBekannten));
+ FirePropertyChanged(nameof(EndeKontaktFreundenBekannten));
+ }
+ }
+
+ public bool EndeKontaktSelbsthilfe
+ {
+ get { return _EndeKontaktSelbsthilfe; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktSelbsthilfe, value))
+ return;
+
+ _EndeKontaktSelbsthilfe = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktSelbsthilfe, value), nameof(EndeKontaktSelbsthilfe));
+ FirePropertyChanged(nameof(EndeKontaktSelbsthilfe));
+ }
+ }
+
+ public bool EndeKontaktSonstige
+ {
+ get { return _EndeKontaktSonstige; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktSonstige, value))
+ return;
+
+ _EndeKontaktSonstige = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktSonstige, value), nameof(EndeKontaktSonstige));
+ FirePropertyChanged(nameof(EndeKontaktSonstige));
+ }
+ }
+
+ public Krankenversicherung BeginnKrankenversicherung
+ {
+ get { return _BeginnKrankenversicherung; }
+ set
+ {
+ if (!AreDifferent(_BeginnKrankenversicherung, value))
+ return;
+
+ _BeginnKrankenversicherung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKrankenversicherung, value), nameof(BeginnKrankenversicherung));
+ FirePropertyChanged(nameof(BeginnKrankenversicherung));
+ }
+ }
+
+ public Krankenversicherung EndeKrankenversicherung
+ {
+ get { return _EndeKrankenversicherung; }
+ set
+ {
+ if (!AreDifferent(_EndeKrankenversicherung, value))
+ return;
+
+ _EndeKrankenversicherung = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKrankenversicherung, value), nameof(EndeKrankenversicherung));
+ FirePropertyChanged(nameof(EndeKrankenversicherung));
+ }
+ }
+
+ public KontaktArzt BeginnKontaktArzt
+ {
+ get { return _BeginnKontaktArzt; }
+ set
+ {
+ if (!AreDifferent(_BeginnKontaktArzt, value))
+ return;
+
+ _BeginnKontaktArzt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.BeginnKontaktArzt, value), nameof(BeginnKontaktArzt));
+ FirePropertyChanged(nameof(BeginnKontaktArzt));
+ }
+ }
+
+ public KontaktArzt EndeKontaktArzt
+ {
+ get { return _EndeKontaktArzt; }
+ set
+ {
+ if (!AreDifferent(_EndeKontaktArzt, value))
+ return;
+
+ _EndeKontaktArzt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.EndeKontaktArzt, value), nameof(EndeKontaktArzt));
+ FirePropertyChanged(nameof(EndeKontaktArzt));
+ }
+ }
+
+ public WohnhilfeBoolData VorlageSchwerbehindertenausweises
+ {
+ get { return _VorlageSchwerbehindertenausweises; }
+ set
+ {
+ if (!AreDifferent(_VorlageSchwerbehindertenausweises, value))
+ return;
+
+ _VorlageSchwerbehindertenausweises = value;
+ StoreDirtyInformation(AreDifferent(DataContract.VorlageSchwerbehindertenausweises, value), nameof(VorlageSchwerbehindertenausweises));
+ FirePropertyChanged(nameof(VorlageSchwerbehindertenausweises));
+ }
+ }
+
+ protected override void InitByDataContract(CustomerWohnhilfeBereichSozialeKontakteDC pDataContract)
+ {
+ _BeginnSozialeKontakte = pDataContract.BeginnSozialeKontakte;
+ _BeginnKontaktPartner = pDataContract.BeginnKontaktPartner;
+ _BeginnKontaktMindKinder = pDataContract.BeginnKontaktMindKinder;
+ _BeginnKontaktVolljahrKinderElternVerwandten = pDataContract.BeginnKontaktVolljahrKinderElternVerwandten;
+ _BeginnKontaktFreundenBekannten = pDataContract.BeginnKontaktFreundenBekannten;
+ _BeginnKontaktSelbsthilfe = pDataContract.BeginnKontaktSelbsthilfe;
+ _BeginnKontaktSonstige = pDataContract.BeginnKontaktSonstige;
+ _EndeSozialeKontakte = pDataContract.EndeSozialeKontakte;
+ _EndeKontaktPartner = pDataContract.EndeKontaktPartner;
+ _EndeKontaktMindKinder = pDataContract.EndeKontaktMindKinder;
+ _EndeKontaktVolljahrKinderElternVerwandten = pDataContract.EndeKontaktVolljahrKinderElternVerwandten;
+ _EndeKontaktFreundenBekannten = pDataContract.EndeKontaktFreundenBekannten;
+ _EndeKontaktSelbsthilfe = pDataContract.EndeKontaktSelbsthilfe;
+ _EndeKontaktSonstige = pDataContract.EndeKontaktSonstige;
+ _BeginnKrankenversicherung = pDataContract.BeginnKrankenversicherung;
+ _EndeKrankenversicherung = pDataContract.EndeKrankenversicherung;
+ _BeginnKontaktArzt = pDataContract.BeginnKontaktArzt;
+ _EndeKontaktArzt = pDataContract.EndeKontaktArzt;
+ _VorlageSchwerbehindertenausweises = pDataContract.VorlageSchwerbehindertenausweises;
+ }
+
+ protected override CustomerWohnhilfeBereichSozialeKontakteDC MapToDataContract(CustomerWohnhilfeBereichSozialeKontakteDC pDataContract, bool doCommit)
+ {
+ pDataContract.BeginnSozialeKontakte = _BeginnSozialeKontakte;
+ pDataContract.BeginnKontaktPartner = _BeginnKontaktPartner;
+ pDataContract.BeginnKontaktMindKinder = _BeginnKontaktMindKinder;
+ pDataContract.BeginnKontaktVolljahrKinderElternVerwandten = _BeginnKontaktVolljahrKinderElternVerwandten;
+ pDataContract.BeginnKontaktFreundenBekannten = _BeginnKontaktFreundenBekannten;
+ pDataContract.BeginnKontaktSelbsthilfe = _BeginnKontaktSelbsthilfe;
+ pDataContract.BeginnKontaktSonstige = _BeginnKontaktSonstige;
+ pDataContract.EndeSozialeKontakte = _EndeSozialeKontakte;
+ pDataContract.EndeKontaktPartner = _EndeKontaktPartner;
+ pDataContract.EndeKontaktMindKinder = _EndeKontaktMindKinder;
+ pDataContract.EndeKontaktVolljahrKinderElternVerwandten = _EndeKontaktVolljahrKinderElternVerwandten;
+ pDataContract.EndeKontaktFreundenBekannten = _EndeKontaktFreundenBekannten;
+ pDataContract.EndeKontaktSelbsthilfe = _EndeKontaktSelbsthilfe;
+ pDataContract.EndeKontaktSonstige = _EndeKontaktSonstige;
+ pDataContract.BeginnKrankenversicherung = _BeginnKrankenversicherung;
+ pDataContract.EndeKrankenversicherung = _EndeKrankenversicherung;
+ pDataContract.BeginnKontaktArzt = _BeginnKontaktArzt;
+ pDataContract.EndeKontaktArzt = _EndeKontaktArzt;
+ pDataContract.VorlageSchwerbehindertenausweises = _VorlageSchwerbehindertenausweises;
+
+ return pDataContract;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialstrukturVM.cs b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialstrukturVM.cs
new file mode 100644
index 000000000..b8c216196
--- /dev/null
+++ b/BeWo/ViewModel/Wohnhilfe/CustomerWohnhilfeBereichSozialstrukturVM.cs
@@ -0,0 +1,360 @@
+using System;
+using System.Collections.Generic;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Wohnhilfe;
+
+namespace BeWo.ViewModel.Wohnhilfe
+{
+ public class CustomerWohnhilfeBereichSozialstrukturVM : AbstractDCMapperVM
+ {
+ private Bundesland? _Bundesland;
+ private bool? _IsWohnungslosenhilfe;
+ private ArtDesHilfeangebots _ArtDesHilfeangebots;
+ private DateTime? _Betreuungsbeginn;
+ private DateTime? _Betreuungsende;
+ private int? _BetreuungsdauerInTagen;
+ private ArtDerBeendigung _ArtDerBeendigung;
+ private DateTime? _Geburtsdatum;
+ private Geschlechtidentitat _Geschlechtidentitat;
+ private Staatsangehorigkeit? _Staatsangehorigkeit;
+ private Aufenthaltsstatus _Aufenthaltsstatus;
+ private WohnhilfeBoolData _Migrationshintergrund;
+ private HochsterSchulabschluss _HochsterSchulabschluss;
+ private Familienstand _Familienstand;
+ private Haushaltsstruktur _Haushaltsstruktur;
+ private WohnhilfeBoolData _EigeneMindKinderAuserhalbHaushaltsstruktur;
+
+ public CustomerWohnhilfeBereichSozialstrukturVM()
+ {
+ _Bundesland = BS.Shared.DataContracts.Wohnhilfe.Bundesland.Bayern;
+ _IsWohnungslosenhilfe = true;
+ _ArtDesHilfeangebots = BS.Shared.DataContracts.Wohnhilfe.ArtDesHilfeangebots.vollstationär;
+ }
+
+ public CustomerWohnhilfeBereichSozialstrukturVM(CustomerWohnhilfeBereichSozialstrukturDC dc) : base(dc, dc.Oid == null)
+ {
+
+ }
+
+ public IEnumerable WohnhilfeBoolDataTypes => Utils.GetAllEnumValues();
+ public IEnumerable BundeslandTypes => Utils.GetAllEnumValues();
+ public IEnumerable ArtDesHilfeangebotsTypes => Utils.GetAllEnumValues();
+ public IEnumerable ArtDerBeendigungTypes => Utils.GetAllEnumValues();
+ public IEnumerable GeschlechtidentitatTypes => Utils.GetAllEnumValues();
+ public IEnumerable StaatsangehorigkeitTypes => Utils.GetAllEnumValues();
+ public IEnumerable AufenthaltsstatusTypes => Utils.GetAllEnumValues();
+ public IEnumerable