diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index e578cd2ca..3443b90cb 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -2386,12 +2386,14 @@
-
+
+
+
diff --git a/BeWo/MainWindow.xaml.cs b/BeWo/MainWindow.xaml.cs
index 7ea221032..590d61053 100644
--- a/BeWo/MainWindow.xaml.cs
+++ b/BeWo/MainWindow.xaml.cs
@@ -82,11 +82,11 @@ namespace BeWo
try
{
- if (BeWoApp.MainControl.HomeView.clientSocket.Connected)
- {
+ // if (BeWoApp.MainControl.HomeView.clientSocket.Connected)
+ // {
BeWoApp.MainControl.HomeView.CloseServerConnection();
- }
+ // }
}
catch (Exception edf)
{
diff --git a/BeWo/View/ChatDokumentationsView.xaml.cs b/BeWo/View/ChatDokumentationsView.xaml.cs
index f208654cc..5d82ae403 100644
--- a/BeWo/View/ChatDokumentationsView.xaml.cs
+++ b/BeWo/View/ChatDokumentationsView.xaml.cs
@@ -21,7 +21,9 @@ using System.Text;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media.Imaging;
+using BeWo.Core.Service;
using BeWo.View.Detail;
+using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
@@ -40,14 +42,14 @@ namespace BeWo.View
private ServiceRecordVM serviceRecord;
- public ChatDokumentationsView(List _listarray, long? _loggedOnMitarbeiter,long _customerPersonOid)
+ public ChatDokumentationsView(List _listarray, long? _loggedOnMitarbeiter,long _customerPersonOid,CompactCustomerDC _compactCustomer)
{
InitializeComponent();
listarray = _listarray;
loggedOnMitarbeiter = _loggedOnMitarbeiter;
- ServiceRecordEditView newView = new ServiceRecordEditView();
+
long? customerOid = _customerPersonOid;
string message = "";
@@ -71,91 +73,89 @@ namespace BeWo.View
dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0);
return dt;
});
+ CompactCustomerDC customerCompact = _compactCustomer;
+
+ Cache.GetInstance().GetActiveSupportConceptCostbearer(scList =>
+ VMFactory.CreateServiceRecordVMAsync(
+ BeWoApp.LoggedOnUser.Employee.EmployeeOid,
+ vm => this.Dispatch(
+ delegate
+ {
+ ServiceRecordEditView newView = new ServiceRecordEditView();
+
+ vm.DispatcherObject = this;
+
+ var dc = new ServiceRecordDC();
+ dc.Start = firstTime;
+ dc.End = lastTime;
+ dc.Employee = BeWoApp.LoggedOnUser.Employee;
+ dc.Customer = customerCompact;
+ dc.SupportConcept = HoleHilfeplanAusListe(scList, customerCompact, firstTime, lastTime);
+
+ if (vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
+ {
+ var cat1 = vm.PrototypeVM.SortedCategories[0];
+
+ dc.ServiceDescription = vm.PrototypeVM.Category2Services[cat1][0];
+ }
+ serviceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals);
+ serviceRecord.Notice = message;
+
+ newView.InitView(vm, serviceRecord,false);
+ if (customerCompact != null)
+ {
+ newView.SetSearchText(customerCompact.LastName);
+ }
+ else
+ {
+ newView.SetSearchText("");
+ }
+
+ if (newView.CommandBindings.Count == 0)
+ {
+ newView.CommandBindings.Add(
+ new CommandBinding(
+ ApplicationCommands.Close,
+ (s, e) =>
+ {
+ if (!newView.DoSaveCheck())
+ {
+ return;
+ }
+
+ Close();
+ }));
+ newView.CommandBindings.Add(
+ new CommandBinding(
+ ApplicationCommands.Save,
+ (s, e) =>
+ {
+ bool save = newView.IsValid();
+
+ if (!save)
+ {
+ return;
+ }
+
+ newView.SaveData();
+ Close();
+
+ }));
+ }
+
+
+ popup_contentChat.Child = newView;
+
+ popup_contentChat.Visibility = Visibility.Visible;
+
+
+
+ //newView.SetStartTimeEndTime(first, last);
+ //newView.SetLoggedOnEmployee();
+
+ })));
- CustomerDC customer;
- CompactCustomerDC customerCompact = null;
-
- if (customerOid.HasValue)
- {
- customer = ServiceFacade.DoCustomerServiceSync(s => s.GetCustomerWithPersonOid(customerOid.Value));
-
- customerCompact =
- ServiceFacade.DoCustomerServiceSync(s => s.GetCompactCustomerDC(customer.CustomerOid.Value));
- }
-
- VMFactory.CreateServiceRecordVMAsync(
- BeWoApp.LoggedOnUser.Employee.EmployeeOid,
- vm => this.Dispatch(
- delegate
- {
- vm.DispatcherObject = this;
-
- var dc = new ServiceRecordDC();
- dc.Start = firstTime;
- dc.End = lastTime;
- dc.Employee = BeWoApp.LoggedOnUser.Employee;
- dc.Customer = customerCompact;
-
- if (vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
- {
- var cat1 = vm.PrototypeVM.SortedCategories[0];
-
- dc.ServiceDescription = vm.PrototypeVM.Category2Services[cat1][0];
- }
- serviceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals);
- serviceRecord.Notice = message;
-
- newView.InitView(vm, serviceRecord,false);
- if (customerCompact != null)
- {
- newView.SetSearchText(customerCompact.LastName);
- }
- else
- {
- newView.SetSearchText("");
- }
-
- //newView.SetStartTimeEndTime(first, last);
- newView.SetLoggedOnEmployee();
- }));
-
- if (newView.CommandBindings.Count == 0)
- {
- newView.CommandBindings.Add(
- new CommandBinding(
- ApplicationCommands.Close,
- (s, e) =>
- {
- if (!newView.DoSaveCheck())
- {
- return;
- }
-
- Close();
- }));
- newView.CommandBindings.Add(
- new CommandBinding(
- ApplicationCommands.Save,
- (s, e) =>
- {
- bool save = newView.IsValid();
-
- if (!save)
- {
- return;
- }
-
- newView.SaveData();
- Close();
-
- }));
- }
-
-
- popup_contentChat.Child = newView;
-
- popup_contentChat.Visibility = Visibility.Visible;
@@ -170,7 +170,24 @@ namespace BeWo.View
SetChatSetting();*/
}
+ private CompactSupportConceptDC HoleHilfeplanAusListe(List scList, CompactCustomerDC customerCompact, DateTime firstTime, DateTime lastTime)
+ {
+ foreach (var sc in scList)
+ {
+ if (sc.Customer.Oid == customerCompact.Oid)
+ {
+ if (sc.StartDate.HasValue && sc.EndDate.HasValue && sc.StartDate <= lastTime &&
+ sc.EndDate >= firstTime)
+ {
+ return sc;
+ }
+ }
+ }
+ return null;
+ }
+
+
private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
diff --git a/BeWo/View/ChatView.xaml b/BeWo/View/ChatView.xaml
index 81f5a9b90..99f7ba591 100644
--- a/BeWo/View/ChatView.xaml
+++ b/BeWo/View/ChatView.xaml
@@ -18,8 +18,8 @@
-
+