diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index dcca5ba80..45394fa26 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -543,12 +543,14 @@
BSLogoControl.xaml
+
+
diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml
index 3086c9add..c49238e41 100644
--- a/BeWo/BeWoApp.xaml
+++ b/BeWo/BeWoApp.xaml
@@ -64,6 +64,8 @@
+
+
+
+
+
+
diff --git a/BeWo/Styles/OrangeBlack.xaml.cs b/BeWo/Styles/OrangeBlack.xaml.cs
index 1de24a986..90887d05f 100644
--- a/BeWo/Styles/OrangeBlack.xaml.cs
+++ b/BeWo/Styles/OrangeBlack.xaml.cs
@@ -4,6 +4,7 @@ using System.Windows.Navigation;
using BeWo.Core;
using BeWo.View.Navigation;
+
using BS.Shared.DataContracts.Compact;
namespace BeWo.Styles
@@ -19,11 +20,11 @@ namespace BeWo.Styles
{
var av = BeWoApp.MainControl.ActiveView;
- var orgaNavView = (OrganisationNavigationView)av;
+ var orgaNavView = (OrganisationNavigationView) av;
- if (orgaNavView != null)
+ if(orgaNavView != null)
{
- var supportConcept = (CompactOrganisationDC)((Hyperlink)sender).Tag;
+ var supportConcept = (CompactOrganisationDC) ((Hyperlink) sender).Tag;
orgaNavView.ReactivateOrganisation(supportConcept);
}
}
@@ -32,13 +33,65 @@ namespace BeWo.Styles
{
var av = BeWoApp.MainControl.ActiveView;
- var personNavView = (PersonNavigationView)av;
+ var personNavView = (PersonNavigationView) av;
- if (personNavView != null)
+ if(personNavView != null)
{
- var person = (CompactPersonDC)((Hyperlink)sender).Tag;
+ var person = (CompactPersonDC) ((Hyperlink) sender).Tag;
personNavView.ReactivatePerson(person);
}
}
+
+ private void Hyperlink_Person_Delete_For_Good_Click(object sender, RoutedEventArgs e)
+ {
+ var av = BeWoApp.MainControl.ActiveView;
+
+ var personNavView = (PersonNavigationView) av;
+
+ if(personNavView != null)
+ {
+ var person = (CompactPersonDC) ((Hyperlink) sender).Tag;
+ personNavView.DeleteForGood(person);
+ }
+ }
+
+ private void Hyperlink_Employee_Reaktivieren_Click(object sender, RoutedEventArgs e)
+ {
+ var av = BeWoApp.MainControl.ActiveView;
+
+ var employeeNavView = (EmployeeNavigationView) av;
+
+ if(employeeNavView != null)
+ {
+ var employee = (CompactEmployeeDC) ((Hyperlink) sender).Tag;
+ employeeNavView.ReactivateEmployee(employee);
+ }
+ }
+
+ private void Hyperlink_Employee_Delete_For_Good_Click(object sender, RoutedEventArgs e)
+ {
+ var av = BeWoApp.MainControl.ActiveView;
+
+ var employeeNavView = (EmployeeNavigationView) av;
+
+ if(employeeNavView != null)
+ {
+ var employee = (CompactEmployeeDC) ((Hyperlink) sender).Tag;
+ employeeNavView.DeleteEmployeeForGood(employee);
+ }
+ }
+
+ private void Hyperlink_Employee_Anonymize_Click(object sender, RoutedEventArgs e)
+ {
+ var av = BeWoApp.MainControl.ActiveView;
+
+ var employeeNavView = (EmployeeNavigationView) av;
+
+ if(employeeNavView != null)
+ {
+ var employee = (CompactEmployeeDC) ((Hyperlink) sender).Tag;
+ employeeNavView.AnonymizeEmployee(employee);
+ }
+ }
}
}
diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml
index fb77fc5de..5fff9a5d1 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -17,6 +17,7 @@
VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus">
+
diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs
index 45fa3d0ab..88c325503 100644
--- a/BeWo/View/Detail/CustomerView.xaml.cs
+++ b/BeWo/View/Detail/CustomerView.xaml.cs
@@ -225,9 +225,6 @@ namespace BeWo.View.Detail
}
Img.EditValueChanged += Image_EditValueChanged;
-
-
-
}
void Image_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
@@ -470,26 +467,35 @@ namespace BeWo.View.Detail
private void AfterSave(long oid)
{
- if (oid > 0)
+ if(oid > 0)
{
Cache.GetInstance().ClearSupportConceptTree();
Cache.GetInstance().ClearCustomers();
+
+ if(BeWoApp.LoggedOnUser == null)
+ {
+ return;
+ }
+
BeWoApp.MainControl.ResetView(UIContext.Customer);
ReloadViewModel(oid);
- if (DoOwnChatSync && BeWoApp.AppSettings.IsChatAllowed)
+ if(DoOwnChatSync && BeWoApp.AppSettings.IsChatAllowed)
{
BeWoUtils.OwnChatSynchronisationVeranlassen();
}
}
}
-
+
private void ReloadViewModel(long pCustomerOID)
{
// reload to update version information and oid
- VMFactory.CreateCustomerVMAsync(pCustomerOID, cb => this.Dispatch(delegate { ViewModel = cb; UpdateUris(); }));
+ VMFactory.CreateCustomerVMAsync(pCustomerOID, cb => this.Dispatch(delegate {
+ ViewModel = cb;
+ UpdateUris();
+ }));
ModalEditViewUpdateCallback?.Invoke();
@@ -1391,15 +1397,15 @@ namespace BeWo.View.Detail
private void UpdateUris()
{
- if (ViewModel.AktuelleMedikamentenverordnungsliste != null)
+ if(ViewModel.AktuelleMedikamentenverordnungsliste != null)
{
- var url = BeWoWpfUtils.GetHTMLEncodedURL(string.Format("{0}/ReportView.aspx?mvlOid={1}&type={2}", BeWoApp.SiteOfOrigin, ViewModel.AktuelleMedikamentenverordnungsliste.CommitToDataContract().MedikamentenverordnungslistenOid, Utils.EnumName(ReportTypes.Medikamentenverordnungsliste)));
+ var url = BeWoWpfUtils.GetHTMLEncodedURL($"{BeWoApp.SiteOfOrigin}/ReportView.aspx?mvlOid={ViewModel.AktuelleMedikamentenverordnungsliste.CommitToDataContract().MedikamentenverordnungslistenOid}&type={Utils.EnumName(ReportTypes.Medikamentenverordnungsliste)}");
LinkListeMitZusatzFeldern.NavigateUri = new Uri(url);
}
- if (ViewModel.Bedarfsmedikamentenverordnungsliste != null)
+ if(ViewModel.Bedarfsmedikamentenverordnungsliste != null)
{
- var url2 = BeWoWpfUtils.GetHTMLEncodedURL(string.Format("{0}/ReportView.aspx?mvlOid={1}&type={2}", BeWoApp.SiteOfOrigin, ViewModel.Bedarfsmedikamentenverordnungsliste.CommitToDataContract().MedikamentenverordnungslistenOid, Utils.EnumName(ReportTypes.Medikamentenverordnungsliste)));
+ var url2 = BeWoWpfUtils.GetHTMLEncodedURL($"{BeWoApp.SiteOfOrigin}/ReportView.aspx?mvlOid={ViewModel.Bedarfsmedikamentenverordnungsliste.CommitToDataContract().MedikamentenverordnungslistenOid}&type={Utils.EnumName(ReportTypes.Medikamentenverordnungsliste)}");
LinkBedarfsListeMitZusatzFeldern.NavigateUri = new Uri(url2);
}
}
@@ -1808,12 +1814,14 @@ namespace BeWo.View.Detail
}
}
- public class MedVerDetailOrderClass : IComparer
+ public class MedVerDetailOrderClass : IComparer
{
- public int Compare(String x, String y)
+ public int Compare(string x, string y)
{
- if (x.Equals(y))
+ if(x == null || x.Equals(y))
+ {
return 0;
+ }
switch (y)
{
diff --git a/BeWo/View/Detail/CustomerView2.xaml b/BeWo/View/Detail/CustomerView2.xaml
index a236ba1f1..47035c36b 100644
--- a/BeWo/View/Detail/CustomerView2.xaml
+++ b/BeWo/View/Detail/CustomerView2.xaml
@@ -201,18 +201,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/EmployeeView.xaml b/BeWo/View/Detail/EmployeeView.xaml
index 96f9798ae..c47b82b52 100644
--- a/BeWo/View/Detail/EmployeeView.xaml
+++ b/BeWo/View/Detail/EmployeeView.xaml
@@ -8,8 +8,8 @@
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:val="clr-namespace:BeWo.Validation"
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
- xmlns:detail="clr-namespace:BeWo.View.Detail"
- xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:security="clr-namespace:BeWo.Security"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus">
@@ -594,7 +594,6 @@
-
@@ -614,12 +613,12 @@
-
-
-
-
+
-
@@ -701,16 +695,15 @@
-
-
-
+
+
-
+
diff --git a/BeWo/View/Detail/EmployeeView.xaml.cs b/BeWo/View/Detail/EmployeeView.xaml.cs
index 3ea4698a9..20b7cba1b 100644
--- a/BeWo/View/Detail/EmployeeView.xaml.cs
+++ b/BeWo/View/Detail/EmployeeView.xaml.cs
@@ -108,9 +108,9 @@ namespace BeWo.View.Detail
return;
}
- Point p = e.GetPosition(btnSave);
+ Point p = e.GetPosition(BtnSave);
- if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
+ if (p.X >= 0 && p.X < BtnSave.ActualWidth && p.Y >= 0 && p.Y < BtnSave.ActualHeight)
{
root.Focus();
}
@@ -149,7 +149,6 @@ namespace BeWo.View.Detail
}
Img.EditValueChanged += Image_EditValueChanged;
-
}
@@ -297,7 +296,7 @@ namespace BeWo.View.Detail
private void CustomerSearchView_CustomerSelected(object sender, EventArgs e)
{
- popup_customer.IsOpen = false;
+ PopupCustomer.IsOpen = false;
ViewModel.CustomerRelations.NewVM.Customer = e.Data;
popupedit_customerRelations.Focus();
}
@@ -322,7 +321,7 @@ namespace BeWo.View.Detail
ModalEditViewUpdateCallback?.Invoke();
PreselectEmployeeBrush();
-
+
if (DoOwnChatSync && BeWoApp.AppSettings.IsChatAllowed)
{
BeWoUtils.OwnChatSynchronisationVeranlassen();
@@ -459,7 +458,7 @@ namespace BeWo.View.Detail
private void popupedit_customerRelations_PopUpClick(object sender, RoutedEventArgs e)
{
- popup_customer.IsOpen = true;
+ PopupCustomer.IsOpen = true;
}
private void tabitem_documents_Selected(object sender, RoutedEventArgs e)
diff --git a/BeWo/View/Detail/PersonView.xaml b/BeWo/View/Detail/PersonView.xaml
index 1160ef5ea..df5ba34ce 100644
--- a/BeWo/View/Detail/PersonView.xaml
+++ b/BeWo/View/Detail/PersonView.xaml
@@ -9,6 +9,7 @@
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:security="clr-namespace:BeWo.Security"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
@@ -352,6 +353,9 @@
+
+
+
diff --git a/BeWo/View/Detail/PersonView.xaml.cs b/BeWo/View/Detail/PersonView.xaml.cs
index bdaf1acdf..49c743b61 100644
--- a/BeWo/View/Detail/PersonView.xaml.cs
+++ b/BeWo/View/Detail/PersonView.xaml.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Windows;
-using System.Windows.Controls;
using System.Windows.Input;
using BeWo.Controls;
@@ -38,21 +37,32 @@ namespace BeWo.View.Detail
tabitem_varFields.Visibility = Visibility.Collapsed;
}
- comboBox_Title.ItemsSource = pPersonVM.Titles;
- comboBox_Function.ItemsSource = pPersonVM.Functions;
+ comboBox_Title.ItemsSource = pPersonVM.Titles;
+ comboBox_Function.ItemsSource = pPersonVM.Functions;
ComboBox_RoleInOrganisation.ItemsSource = pPersonVM.RoleInOrganisations;
- comboBox_Nationalitaet.ItemsSource = pPersonVM.Nationalitaeten;
- comboBox_Aufenthalt.ItemsSource = pPersonVM.AufenthaltsStatuse;
+ comboBox_Nationalitaet.ItemsSource = pPersonVM.Nationalitaeten;
+ comboBox_Aufenthalt.ItemsSource = pPersonVM.AufenthaltsStatuse;
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Person_AllowArchiving))
{
lblArchiviert.Visibility = Visibility.Hidden;
chkArchiviert.Visibility = Visibility.Hidden;
}
+
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.DocumentsAllowViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.DokumentePersonen))
{
tabitem_documents.Visibility = Visibility.Collapsed;
}
+
+ HideDeleteForGoodButton();
+ }
+
+ private void HideDeleteForGoodButton()
+ {
+ if(ViewModel.IsNew || ViewModel.DataContract != null && ViewModel.DataContract.ActivationType != ActivationTypeId.Deleted)
+ {
+ BtnDeleteForGood.Visibility = Visibility.Collapsed;
+ }
}
public event EventHandler> PersonSavedOrUpdated;
@@ -149,17 +159,13 @@ namespace BeWo.View.Detail
cb => this.Dispatch(
delegate
{
- if (PersonSavedOrUpdated != null)
- {
- PersonSavedOrUpdated(this, new EventArgs(cb));
- }
+ PersonSavedOrUpdated?.Invoke(this, new EventArgs(cb));
ViewModel = cb;
- if (ModalEditViewUpdateCallback != null)
- {
- ModalEditViewUpdateCallback();
- }
+ ModalEditViewUpdateCallback?.Invoke();
+
+ HideDeleteForGoodButton();
}));
IsDoneWithInsertOrUpdate = true;
@@ -367,6 +373,37 @@ namespace BeWo.View.Detail
}))
));
}
+
+ private void BtnDeleteForGood_OnClick(object sender, RoutedEventArgs e)
+ {
+ if(ViewModel.DataContract.PersonOid == null)
+ {
+ return;
+ }
+
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ if(ViewModel.DataContract.PersonOid != null)
+ {
+ s.DeletePersonForGood(ViewModel.DataContract.PersonOid.Value);
+ }
+ }, ReloadViewModel);
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Person, ViewModel.DataContract.PersonOid.Value, MessageType.DeleteForGood), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
}
public class KlientenUmfeldGridControl
diff --git a/BeWo/View/MessageDialog.xaml b/BeWo/View/MessageDialog.xaml
index 15585bbb7..e7a5c8c6e 100644
--- a/BeWo/View/MessageDialog.xaml
+++ b/BeWo/View/MessageDialog.xaml
@@ -1,9 +1,11 @@
-
+
+
+
@@ -24,13 +26,27 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Reaktivieren
-
-
- Drucken
+
+ Anonymisieren
+
+
+ Endgültig löschen
+
+
+ Reaktivieren
+
+
+ Drucken
diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
index 2a60badd9..ed31d02d0 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
@@ -4,7 +4,6 @@ using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
-using System.Windows.Media;
using System.Windows.Navigation;
using BeWo.Core;
@@ -21,6 +20,7 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Translation;
+
using Microsoft.Win32;
@@ -43,8 +43,7 @@ namespace BeWo.View.Navigation
InitializeComponent();
mainNavigationView.Sorter = new CustomerSorter();
- mainNavigationView.ArchiveButtonVisible =
- BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_AllowArchiving);
+ mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_AllowArchiving);
mainNavigationView.ShowArchivedObjectsVisible = true;
@@ -61,12 +60,12 @@ namespace BeWo.View.Navigation
supportConceptFilterComboBox.Style = FindResource("SortComboBox") as Style;
- if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ if(BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
{
supportConceptFilterComboBox.Items.Add(new CustomerFilterItem(CustomerFilterEnum.All));
}
- if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams))
+
+ if(BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams))
{
supportConceptFilterComboBox.Items.Add(new CustomerFilterItem(CustomerFilterEnum.TeamCustomer));
}
@@ -74,28 +73,31 @@ namespace BeWo.View.Navigation
CustomerFilterItem selectedItem = null;
- switch (BeWoApp.AppSettings.CustomerFilterSupportConcepts)
+ switch(BeWoApp.AppSettings.CustomerFilterSupportConcepts)
{
case CustomerFilterEnum.All:
- if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ if(BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
{
selectedItem = new CustomerFilterItem(CustomerFilterEnum.All);
}
+
break;
case CustomerFilterEnum.TeamCustomer:
- if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) ||
- BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams))
+ if(BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) ||
+ BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) ||
+ BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams))
{
-
selectedItem = new CustomerFilterItem(CustomerFilterEnum.TeamCustomer);
}
+
break;
}
- if (selectedItem == null)
+
+ if(selectedItem == null)
{
selectedItem = new CustomerFilterItem(CustomerFilterEnum.MyCustomer);
}
+
supportConceptFilterComboBox.SelectedItem = selectedItem;
supportConceptFilterComboBox.SelectionChanged += SupportConceptFilterComboBoxOnSelectionChanged;
@@ -148,13 +150,15 @@ namespace BeWo.View.Navigation
//mainNavigationView.AddControlToSortPanel(chkShowOnlyMyCustomers);
//mainNavigationView.AddControlToSortPanel(chkShowOnlyTeamCustomers);
- TextBlock lbl = new TextBlock();
- lbl.Text = "Filter:";
- lbl.FontSize = 12;
- lbl.Margin = new Thickness(8, 2, -3, 0);
+ var lbl = new TextBlock
+ {
+ Text = "Filter:",
+ FontSize = 12,
+ Margin = new Thickness(8, 2, -3, 0)
+ };
- this.mainNavigationView.sortPanel.Children.Insert(3, lbl);
- this.mainNavigationView.sortPanel.Children.Insert(4, this.supportConceptFilterComboBox);
+ mainNavigationView.sortPanel.Children.Insert(3, lbl);
+ mainNavigationView.sortPanel.Children.Insert(4, supportConceptFilterComboBox);
UpdateCustomFilter();
}
@@ -185,7 +189,7 @@ namespace BeWo.View.Navigation
mainNavigationView.CustomFilter = CreateNewCustomFilter();
}
- private void chkShowOnlyMyCustomers_Click(object sender, RoutedEventArgs e)
+ private void ChkShowOnlyMyCustomers_Click(object sender, RoutedEventArgs e)
{
//if (chkShowOnlyMyCustomers.IsChecked != null)
// BeWoApp.AppSettings.ShowOnlyMyClients = chkShowOnlyMyCustomers.IsChecked.Value;
@@ -342,34 +346,85 @@ namespace BeWo.View.Navigation
private void MainNavigationView_OnOpenMailMergeWindow(List allCustomers, IFilterableDC selectedCustomer)
{
- var mmw = new MailMergeWindow(this, typeof(CustomerDC), objectList.ToList(), selectedCustomer)
- {
- Sorter = new CustomerSorter()
- };
+ var mmw = new MailMergeWindow(this, typeof(CustomerDC), objectList.ToList(), selectedCustomer) { Sorter = new CustomerSorter() };
+
mmw.Show();
}
private void Hyperlink_Reaktivieren_Click(object sender, RoutedEventArgs e)
{
- var cdc = (CompactCustomerDC) mainNavigationView.objectListBox.SelectedItem;
+ var customer = (CompactCustomerDC)((Hyperlink)sender).Tag;
- if (MessageBox.Show(Translator.Translate("Wollen Sie den Klient '{0}' wirklich reaktivieren?", cdc.FirstName + " " + cdc.LastName), "Reaktivieren", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.No)
+ if (MessageBox.Show(Translator.Translate("Wollen Sie den Klient '{0}' wirklich reaktivieren?", customer.FirstName + " " + customer.LastName), "Reaktivieren", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.No)
{
return;
}
ServiceFacade.DoCustomerServiceAsync(s =>
{
- s.ReactivateCustomer(cdc.CustomerOid, cdc.CustomerVersion);
- return cdc;
+ s.ReactivateCustomer(customer.CustomerOid, customer.CustomerVersion);
+ return customer;
}, cb => cb.CustomerVersion++);
Cache.GetInstance().ClearSupportConceptTree();
- cdc.ActivationType = ActivationTypeId.Active;
+ customer.ActivationType = ActivationTypeId.Active;
var context = mainNavigationView.objectListBox.DataContext;
mainNavigationView.objectListBox.DataContext = null;
mainNavigationView.objectListBox.DataContext = context;
}
+
+ private void Hyperlink_Anonymize_Click(object sender, RoutedEventArgs e)
+ {
+ var customer = (CompactCustomerDC) ((Hyperlink) sender).Tag;
+
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ s.AnonymizeCustomer(customer.CustomerOid);
+ }, () =>
+ {
+ ReloadData(true);
+ });
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Customer, customer.CustomerOid, MessageType.Anonymization), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
+
+ private void Hyperlink_Delete_For_Good_Click(object sender, RoutedEventArgs e)
+ {
+ var customer = (CompactCustomerDC) ((Hyperlink) sender).Tag;
+
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ s.DeleteCustomerForGood(customer.CustomerOid);
+ }, () => { ReloadData(true); });
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Customer, customer.CustomerOid, MessageType.DeleteForGood), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Navigation/EmployeeNavigationView.xaml b/BeWo/View/Navigation/EmployeeNavigationView.xaml
index ba64688f2..e361bd614 100644
--- a/BeWo/View/Navigation/EmployeeNavigationView.xaml
+++ b/BeWo/View/Navigation/EmployeeNavigationView.xaml
@@ -1,21 +1,25 @@
-
-
+
\ No newline at end of file
diff --git a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
index ac84c5bff..6d97ab089 100644
--- a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
@@ -48,10 +48,9 @@ namespace BeWo.View.Navigation
//###CB SERIENBRIEF mainNavigationView.MailMergeButton.Visibility = Visibility.Collapsed;
- mainNavigationView.EditButtonsVisible = true;
- mainNavigationView.DeleteButtonVisible = false;
- mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Employee_AllowArchiving);
- mainNavigationView.chkShowDeleted.Visibility = Visibility.Collapsed;
+ mainNavigationView.EditButtonsVisible = true;
+ mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Employee_AllowArchiving);
+ mainNavigationView.DeleteButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_Delete) || BeWoApp.LoggedOnUser.HasRight(UserRightType.DeleteAll);
}
private void OnLoaded(object sender, RoutedEventArgs e)
@@ -59,7 +58,7 @@ namespace BeWo.View.Navigation
ReloadData(false);
}
- private bool mainNavigationView_ArchiveObject(IFilterableDC obj)
+ private bool MainNavigationView_ArchiveObject(IFilterableDC obj)
{
if (obj is CompactEmployeeDC dc)
{
@@ -79,7 +78,7 @@ namespace BeWo.View.Navigation
return false;
}
- private void mainNavigationView_CreateNewObject()
+ private void MainNavigationView_CreateNewObject()
{
var licenseInfo = ServiceFacade.DoOperationsServiceSync(s => s.GetLicenseInfo());
@@ -96,7 +95,7 @@ namespace BeWo.View.Navigation
}
}
- private bool mainNavigationView_DeleteObject(IFilterableDC obj)
+ private bool MainNavigationView_DeleteObject(IFilterableDC obj)
{
if (obj is CompactEmployeeDC dc)
{
@@ -110,7 +109,7 @@ namespace BeWo.View.Navigation
return false;
}
- private void mainNavigationView_ExcelExport(object sender, EventArgs> e)
+ private void MainNavigationView_ExcelExport(object sender, EventArgs> e)
{
var path = BeWoApp.GetAndCreateUserAppDataPath() + Translator.Translate("\\Mitarbeiter.xls");
@@ -123,7 +122,7 @@ namespace BeWo.View.Navigation
ServiceFacade.DoDownloadServiceSync(s => BeWoUtils.WriteExcelFile(s.PrepareExcelFileEmployeeExport(mainNavigationView.DownloadLinkEngine.ExcelFileId, e.Data.Cast().Select(c => c.EmployeeOid).ToList()), sf.FileName));
}
- private void mainNavigationView_OpenObject(IFilterableDC obj)
+ private void MainNavigationView_OpenObject(IFilterableDC obj)
{
if (obj is CompactEmployeeDC dc)
{
@@ -146,7 +145,7 @@ namespace BeWo.View.Navigation
{
if (refresh || recentList == null)
{
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllActiveAndArchivedEmployeesCompact(), r =>
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllCompactEmployees(), r =>
this.Dispatch(delegate
{
if(BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
@@ -166,7 +165,7 @@ namespace BeWo.View.Navigation
objectList = new List();
}
- mainNavigationView.ShowSearchResult(objectList);
+ mainNavigationView.ShowSearchResult(objectList);
}));
ServiceFacade.DoEmployeeServiceAsync(s => s.GetLastOpenedEmployees(), lastOpenedEmployees =>
@@ -203,5 +202,70 @@ namespace BeWo.View.Navigation
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(((Hyperlink) sender).NavigateUri.ToString()));
}
+
+ public void ReactivateEmployee(CompactEmployeeDC pEmployee)
+ {
+ if(MessageBox.Show("Wollen Sie den Mitarbeiter '" + pEmployee.FirstName + " " + pEmployee.LastName + "' wirklich reaktivieren?", "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.No)
+ {
+ return;
+ }
+
+ ServiceFacade.DoEmployeeServiceAsync(s =>
+ {
+ s.ReactivateEmployee(pEmployee.EmployeeOid, pEmployee.Version);
+ return pEmployee;
+ }, cb => cb.EmployeeVersion++);
+
+ pEmployee.ActivationType = ActivationTypeId.Active;
+ var context = mainNavigationView.objectListBox.DataContext;
+ mainNavigationView.objectListBox.DataContext = null;
+ mainNavigationView.objectListBox.DataContext = context;
+ }
+
+ public void AnonymizeEmployee(CompactEmployeeDC pEmployee)
+ {
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ s.AnonymizeEmployee(pEmployee.EmployeeOid);
+ }, () => { ReloadData(true); });
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Employee, pEmployee.EmployeeOid, MessageType.Anonymization), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
+
+ public void DeleteEmployeeForGood(CompactEmployeeDC pEmployee)
+ {
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ s.DeleteEmployeeForGood(pEmployee.EmployeeOid);
+ }, () => { ReloadData(true); });
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Employee, pEmployee.EmployeeOid, MessageType.DeleteForGood), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Navigation/PersonNavigationView.xaml.cs b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
index d71a2a2e6..b2cd10035 100644
--- a/BeWo/View/Navigation/PersonNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
@@ -180,5 +180,28 @@ namespace BeWo.View.Navigation
mainNavigationView.objectListBox.DataContext = null;
mainNavigationView.objectListBox.DataContext = context;
}
+
+ public void DeleteForGood(CompactPersonDC person)
+ {
+ var dialog = new MessageDialog(() =>
+ {
+ this.Dispatch(() =>
+ {
+ ServiceFacade.DoOperationsServiceAsync(s =>
+ {
+ s.DeletePersonForGood(person.PersonOid);
+ }, () => { ReloadData(true); });
+ });
+ });
+
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetMessageFromServer(TableID.Person, person.PersonOid, MessageType.DeleteForGood), xaml =>
+ {
+ this.Dispatch(() =>
+ {
+ dialog.SetXaml(xaml);
+ dialog.ShowDialog();
+ });
+ });
+ }
}
}
\ No newline at end of file
diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs
index d355796f4..9b9813786 100644
--- a/Data/Access/SearchDAO.cs
+++ b/Data/Access/SearchDAO.cs
@@ -1315,7 +1315,7 @@ namespace BeWo.Data.Access
public IEnumerable FindServiceRecordsForDays(long? costBearer2SupportConceptOid, int dayCount, long? employeeOid)
{
- var minStart = DateTime.Now.AddDays(-dayCount);
+ var minStart = DateTime.Now.GetShortDateTime().AddDays(-dayCount);
var c = CreateCriteriaIsActive();
if (costBearer2SupportConceptOid.HasValue)
@@ -2080,13 +2080,18 @@ namespace BeWo.Data.Access
return c.List();
}
- public IList LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
+ public IList LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pIncludeInactiveOnes)
{
- var recurrenceBetween = string.Format("'{0} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", pIntervalStart.ToString("yyyy-MM-dd"), SchedulerAppointment.PropertyName_RecurrenceInfo);
+ var recurrenceBetween = string.Format("'{0:yyyy-MM-dd} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", pIntervalStart, SchedulerAppointment.PropertyName_RecurrenceInfo);
- var criteria = CreateCriteria()
- .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
- .Add(Restrictions.Or(
+ var criteria = CreateCriteria();
+
+ if(!pIncludeInactiveOnes)
+ {
+ criteria.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active));
+ }
+
+ criteria.Add(Restrictions.Or(
Restrictions.And(Restrictions.Not(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "Range", MatchMode.Anywhere)),
Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "OccurrenceCount=\"10\"", MatchMode.Anywhere)),
Restrictions.Or(
@@ -2171,16 +2176,16 @@ namespace BeWo.Data.Access
return criteria.List();
}
- public IEnumerable LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long? pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
+ public IEnumerable LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long? pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pIncludeInactiveOnes)
{
- var mainCriteria = CreateRecurrenceCriteria(pIntervalStart, pIntervalEnd);
+ var mainCriteria = CreateRecurrenceCriteria(pIntervalStart, pIntervalEnd, pIncludeInactiveOnes);
ICriterion ownAppointmentCriterion = null;
ICriterion employeeCriterion = null;
ICriterion customerCriterion = null;
ICriterion resourceCriterion = null;
- if (pEmployeeOid.HasValue)
+ if(pEmployeeOid.HasValue)
{
ownAppointmentCriterion = CreateOwnAppointmentsCriteria(pEmployeeOid.Value);
}
@@ -2227,7 +2232,7 @@ namespace BeWo.Data.Access
//this_0_.NewSchAppOid = this_.Oid
// )
var detachedCriteria2 = DetachedCriteria.For("e2s2")
- .SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_Oid))
+ .SetProjection(Projections.Property(BeWoEntityBase.PropertyName_Oid))
.Add(Restrictions.EqProperty("e2s2." + Employee2SchedulerAppointment.PropertyName_SchedulerAppointment, "sa.Oid"));
//.Add(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment + ".Oid", mainCriteria.SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_Oid))));
@@ -2283,7 +2288,7 @@ namespace BeWo.Data.Access
resourceCriterion
};
- if (!pHasRightToSeeAllEmployeeAppointments && pSelectedEmployees.Count == 0)
+ if(!pHasRightToSeeAllEmployeeAppointments && pSelectedEmployees.Count == 0)
{
mainCriteria.Add(ownAppointmentCriterion);
}
@@ -2294,7 +2299,7 @@ namespace BeWo.Data.Access
var orCriteria = CreateOrCriteria(listOfCriterias);
- if (orCriteria != null)
+ if(orCriteria != null)
{
mainCriteria.Add(orCriteria);
}
@@ -2346,6 +2351,8 @@ namespace BeWo.Data.Access
appointments.Add(replacingAppointment);
}
+ var oids = appointments.Select(s => s.Oid.Value).ToList();
+
return appointments;
}
@@ -2386,14 +2393,19 @@ namespace BeWo.Data.Access
return ownAppointmentCriterion;
}
- private ICriteria CreateRecurrenceCriteria(DateTime start, DateTime end)
+ private ICriteria CreateRecurrenceCriteria(DateTime start, DateTime end, bool pIncludeInactiveOnes = false)
{
var recurrenceBetween = string.Format("'{0:yyyy-MM-dd} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", start, SchedulerAppointment.PropertyName_RecurrenceInfo);
var recurrenceAfter = $"'{start:yyyy-MM-dd} 00:00:00' > STR_TO_DATE(SUBSTRING({SchedulerAppointment.PropertyName_RecurrenceInfo}, 24, 19), '%m/%d/%Y %H:%i:%s')";
- var criteria = CreateCriteria("sa")
- .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
- .Add(Restrictions.Or(
+ var criteria = CreateCriteria("sa");
+
+ if(!pIncludeInactiveOnes)
+ {
+ criteria.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active));
+ }
+
+ criteria.Add(Restrictions.Or(
Restrictions.And(
Restrictions.Not(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "Range", MatchMode.Anywhere)),
Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, "OccurrenceCount=\"10\"", MatchMode.Anywhere)),
@@ -2422,5 +2434,24 @@ namespace BeWo.Data.Access
return c.List();
}
+
+ public IList FindAppointmentsByRecurrenceId(List pRecurrenceIds)
+ {
+ var criterionList = new List();
+
+ pRecurrenceIds.DoForEach(id =>
+ {
+ criterionList.AddIfNotIn(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, id, MatchMode.Anywhere));
+ });
+
+ var recurrenceIdOr = CreateOrCriteria(criterionList);
+
+ var c = CreateCriteria()
+ .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
+ .Add(Restrictions.IsNotNull(SchedulerAppointment.PropertyName_RecurrenceInfo))
+ .Add(recurrenceIdOr);
+
+ return c.List();
+ }
}
}
diff --git a/Service/Core/Utils.cs b/Service/Core/Utils.cs
index 3b5d930ed..10c87febf 100644
--- a/Service/Core/Utils.cs
+++ b/Service/Core/Utils.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
+using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Security.Cryptography;
@@ -11,9 +12,11 @@ using System.ServiceModel.Channels;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
+
using BeWo.Data.Entities;
using BeWo.Service.ServiceContracts;
using BeWo.Data;
+
using BS.Shared;
using BS.Shared.Extensions;
@@ -268,5 +271,22 @@ namespace BeWo.Service.Core
return null;
}
+
+ public static List ExtractRecurrenceIdFromRecurrenceString(List appointments)
+ {
+ var result = new List();
+
+ foreach(var recurrenceInfo in appointments.Where(w => w.RecurrenceInfo != null).Select(s => s.RecurrenceInfo))
+ {
+ var id = GetRecurrenceIdFromRecurrenceInfo(recurrenceInfo);
+
+ if(id != null)
+ {
+ result.AddIfNotIn(id);
+ }
+ }
+
+ return result;
+ }
}
}
\ No newline at end of file
diff --git a/Service/ServiceContracts/IEmployeeService.cs b/Service/ServiceContracts/IEmployeeService.cs
index 611ffc1f9..26d10fbc8 100644
--- a/Service/ServiceContracts/IEmployeeService.cs
+++ b/Service/ServiceContracts/IEmployeeService.cs
@@ -363,5 +363,13 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
ChatBewoMessageSyncDC GetChatBewoMessageSync(long? eOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void ReactivateEmployee(long pOid, long pVersion);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ List GetAllCompactEmployees();
}
}
\ No newline at end of file
diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs
index bcd092eb0..a6b2a2c14 100644
--- a/Service/ServiceContracts/IOperationsService.cs
+++ b/Service/ServiceContracts/IOperationsService.cs
@@ -723,5 +723,37 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void DeleteTextbausteine(Dictionary pOid2Version);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void AnonymizeCustomer(long pCustomerOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void DeleteCustomerForGood(long pCustomerOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void DeletePersonForGood(long pPersonOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void DeleteEmployeeForGood(long pEmployeeOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ string GetMessageFromServer(TableID pObjectTid, long? pObjectOid, MessageType pMessageType);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void AnonymizeEmployee(long pEmployeeOid);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary pUserRights);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void DeleteAppointmentsInInterval(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary pUserRights);
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/EmployeeServiceImp.cs b/Service/ServiceImplementations/EmployeeServiceImp.cs
index f02d19736..0d9632dc7 100644
--- a/Service/ServiceImplementations/EmployeeServiceImp.cs
+++ b/Service/ServiceImplementations/EmployeeServiceImp.cs
@@ -1177,8 +1177,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
-
-
public List GetAllChatActiveEmployeesCompact()
{
try
@@ -1404,5 +1402,30 @@ namespace BeWo.Service.ServiceImplementations
}
}
+ public void ReactivateEmployee(long pOid, long pVersion)
+ {
+ try
+ {
+ ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Active);
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public List GetAllCompactEmployees()
+ {
+ try
+ {
+ var employees = DAOFactory.GenericDAO.GetAll();
+
+ return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(employees);
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index d16e139f7..1934a1625 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -3835,28 +3835,21 @@ namespace BeWo.Service.ServiceImplementations
public List VertretungsListe(DateTime datum)
{
try
- {
- VertretungsListe liste = new VertretungsListe();
-
-
- liste.Vertretunglist = (List)DAOFactory.GenericDAO.GetAllActive();
-
- liste.AbsenceTimelist = (List)DAOFactory.GenericDAO.GetAllActive();
-
- liste.Arbeitszeitliste = (List)DAOFactory.GenericDAO.GetAllActive();
-
- liste.Employeelist = (List)DAOFactory.GenericDAO.GetAllActive(); ;
-
- liste.Customerlist = (List)DAOFactory.GenericDAO.GetAllActive();
-
+ {
+ var liste = new VertretungsListe
+ {
+ Vertretunglist = (List) DAOFactory.GenericDAO.GetAllActive(),
+ AbsenceTimelist = (List) DAOFactory.GenericDAO.GetAllActive(),
+ Arbeitszeitliste = (List) DAOFactory.GenericDAO.GetAllActive(),
+ Employeelist = (List) DAOFactory.GenericDAO.GetAllActive(),
+ Customerlist = (List) DAOFactory.GenericDAO.GetAllActive()
+ };
var schulbegleitenderDienst = MapperFactory.VertretungsListeDC_VertretungsListe.MapToNewDC(liste);
+ var algorithmus = new VertretungsAlgorithmus(schulbegleitenderDienst,datum);
- VertretungsAlgorithmus alorythmus = new VertretungsAlgorithmus(schulbegleitenderDienst,datum);
-
-
- return alorythmus.vertretungsliste;
+ return algorithmus.vertretungsliste;
}
catch (Exception e)
{
@@ -3931,7 +3924,6 @@ namespace BeWo.Service.ServiceImplementations
}
-
public List GetLastVertreter(long? klientenOid)
{
try
@@ -3972,11 +3964,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
-
-
-
- //Token Bereich für Token
-
public List GetAllTokens(SchulbegleitenderZugehoerigkeitsTyp zugehoerigkeitsTyp, long? oid)
{
try
@@ -4495,7 +4482,6 @@ namespace BeWo.Service.ServiceImplementations
return factory.CreateSupportConceptStatistics(costBearer2SupportConceptOid, statisticsDate);
}
-
public void ResetTenant(String tenant)
{
WCFHibernateSessionManager.ResetSessionFactory(tenant);
@@ -4613,7 +4599,6 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
-
public PdfChatHandoutDC GetHandOutPdfForChat(string customerId,string apikey)
{
@@ -4978,7 +4963,7 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- List lOriginals = DAOFactory.GenericDAO.LoadByIDs(pOid2Version.Select(e => e.Key));
+ var lOriginals = DAOFactory.GenericDAO.LoadByIDs(pOid2Version.Select(e => e.Key));
lOriginals.DoForEach(or => MapperFactory.TextbausteinDC_Textbaustein.ConcurrencyCheck(pOid2Version[or.Oid.Value], or));
DAOFactory.GenericDAO.Delete(lOriginals);
@@ -4989,6 +4974,293 @@ namespace BeWo.Service.ServiceImplementations
}
}
+ public void AnonymizeCustomer(long pCustomerOid)
+ {
+ try
+ {
+ const string anonimyzedName = "Anonymisiert";
+ var customer = DAOFactory.GenericDAO.GetByID(pCustomerOid);
+
+ customer.Person.Abbreviation = null;
+ if(customer.Person.DateOfBirth != null)
+ {
+ customer.Person.DateOfBirth = new DateTime(customer.Person.DateOfBirth.Value.Year, 1, 1);
+ }
+
+ customer.Person.FirstName = anonimyzedName;
+ customer.Person.LastName = anonimyzedName;
+ customer.Person.Notice = null;
+
+ if(customer.Person.Address != null)
+ {
+ customer.Person.Address.AddressLine1 = null;
+ customer.Person.Address.AddressLine2 = null;
+ customer.Person.Address.Country = null;
+ customer.Person.Address.Street = null;
+ customer.Person.Address.State = null;
+ customer.Person.Address.InsUser = anonimyzedName;
+ customer.Person.Address.UdpUser = anonimyzedName;
+ }
+
+ customer.Person.AufenthaltsStatus = null;
+ customer.Person.Profession = null;
+ customer.Person.Title = null;
+ customer.Person.InsUser = anonimyzedName;
+ customer.Person.UdpUser = anonimyzedName;
+ var bankaccountOid = customer.Person.BankAccount?.Oid;
+
+ if(bankaccountOid != null)
+ {
+ customer.Person.BankAccount = null;
+ }
+
+ customer.Person.FamilyStatus = null;
+ if(customer.Person.InvoiceAddress != null)
+ {
+ customer.Person.InvoiceAddress.AddressLine1 = null;
+ customer.Person.InvoiceAddress.AddressLine2 = null;
+ customer.Person.InvoiceAddress.Country = null;
+ customer.Person.InvoiceAddress.Street = null;
+ customer.Person.InvoiceAddress.State = null;
+ customer.Person.InvoiceAddress.InsUser = anonimyzedName;
+ customer.Person.InvoiceAddress.UdpUser = anonimyzedName;
+ }
+
+ customer.Person.IsMigrant = false;
+ customer.Person.Nationalitaet = null;
+ customer.Person.Contacts.Clear();
+
+ customer.Person.Images?.Clear();
+ customer.VarFieldValueList?.Clear();
+
+ customer.AbWelchemKrankheitsTag = 0;
+ customer.AbsenceTimes.DoForEach(at =>
+ {
+ at.Notice = null;
+ at.InsUser = anonimyzedName;
+ at.UdpUser = anonimyzedName;
+ });
+
+ customer.Ansprechpartner = null;
+ customer.AssessmentSheetCategoryList?.Clear();
+ customer.AssistanceBegin = null;
+ customer.AusstVersAmt = null;
+ customer.AusweisGueltigBis = null;
+ customer.AusweisGueltigVon = null;
+ customer.AusweisUnbefristetGueltig = null;
+ customer.BehinderungsartenListe?.Clear();
+ customer.BeiblattGueltigBis = null;
+ customer.Childs = null;
+ customer.CostCenter = null;
+ customer.Ansprechpartner = null;
+ customer.AssistanceBegin = null;
+ customer.Customer2CostBearerList?.Clear();
+ customer.Customer2OrganisationList?.Clear();
+
+ var personRelations2Delete = customer.Customer2PersonList.Where(person => !person.IstFamilie && person.Oid != null).ToList();
+
+ customer.Customer2PersonList.RemoveRange(personRelations2Delete);
+
+ customer.Customer2PersonList.DoForEach(personRelation =>
+ {
+ personRelation.InsUser = anonimyzedName;
+ personRelation.UdpUser = anonimyzedName;
+ personRelation.Notice = null;
+ });
+
+ customer.CustomerAlias = null;
+ customer.DebitorNumber = null;
+ customer.Diagnosis = null;
+ customer.Diagnosis2CustomerList?.Clear();
+ customer.DistanceInMeter = null;
+ customer.Employee2CustomerList?.Clear();
+ customer.Environment = null;
+ customer.EquityContribution = null;
+ customer.FamilyData = null;
+ customer.GradDerBehinderung = null;
+ customer.ICD10Diagnosis = null;
+ customer.InsUser = anonimyzedName;
+ customer.IsAdvisedOrAttended = null;
+ customer.Jugendamt = null;
+ customer.Medication = null;
+ customer.Medikamentenverordnungslisten?.Clear();
+ customer.MerkzeichenListe?.Clear();
+ customer.Notice = null;
+ customer.Pflegegrad = null;
+ customer.PlacementList?.Clear();
+ customer.ReferenceNumber = null;
+ customer.Team2CustomerList?.Clear();
+ customer.TerminationDate = null;
+ customer.TerminationReason = null;
+ customer.UdpUser = anonimyzedName;
+ customer.ValueList?.Clear();
+ customer.VertretungDringendErforderlich = false;
+ customer.VertretungGewuenscht = false;
+
+ customer.ServiceRecordList?.DoForEach(record => {
+ record.Notice = null;
+ record.Notice2 = null;
+ record.Notice3 = null;
+ record.Notice4 = null;
+ record.Notice5 = null;
+ record.RTFNotice1 = null;
+ record.RTFNotice2 = null;
+ record.RTFNotice3 = null;
+ record.RTFNotice4 = null;
+ record.RTFNotice5 = null;
+ record.InsUser = anonimyzedName;
+ record.UdpUser = anonimyzedName;
+ });
+
+ customer.SupportConcepts?.DoForEach(supportConcept =>
+ {
+ supportConcept.Notice = null;
+ supportConcept.InsUser = anonimyzedName;
+ supportConcept.UdpUser = anonimyzedName;
+
+ supportConcept.CostBearer2SupportConceptList.DoForEach(cb2SC =>
+ {
+ cb2SC.CustomerReferenceNumber = null;
+ cb2SC.Notice = null;
+ cb2SC.InsUser = anonimyzedName;
+ cb2SC.UdpUser = anonimyzedName;
+ });
+ });
+
+ if(customer.Oid != null)
+ {
+ var bargeldKassen = DAOFactory.SearchDAO.FindBargeldkasse(TableID.Customer, customer.Oid.Value);
+
+ DAOFactory.GenericDAO.Delete(bargeldKassen);
+
+ var fileAttachments = DAOFactory.SearchDAO.FindFileAttachments(TableID.Customer, customer.Oid.Value);
+
+ DAOFactory.GenericDAO.Delete(fileAttachments);
+ }
+
+ DAOFactory.GenericDAO.Update(customer);
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ // TODO: implementieren!
+ public void DeleteCustomerForGood(long pCustomerOid)
+ {
+ try
+ {
+
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ // TODO: implementieren!
+ public void DeletePersonForGood(long pPersonOid)
+ {
+ try
+ {
+
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ // TODO: implementieren!
+ public void DeleteEmployeeForGood(long pEmployeeOid)
+ {
+ try
+ {
+
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ // TODO: implementieren!
+ public void AnonymizeEmployee(long pEmployeeOid)
+ {
+ try
+ {
+
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ // TODO: implementieren!
+ public void DeleteAppointmentsInInterval(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary pUserRights)
+ {
+ try
+ {
+
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public string GetMessageFromServer(TableID pObjectTid, long? pObjectOid, MessageType pMessageType)
+ {
+ try
+ {
+ var actualTextMessage = "";
+ const string foreground = "Foreground=\"Red\"";
+ const string fontWeight = "FontWeight=\"Bold\"";
+
+ if(pObjectTid == TableID.Customer && pMessageType == MessageType.Anonymization)
+ {
+ actualTextMessage = "Achtung!
Das Anonymisieren eines Klienten kann nicht rückgängig gemacht werden!
";
+ }
+
+ if(pObjectTid == TableID.Customer && pMessageType == MessageType.DeleteForGood)
+ {
+ actualTextMessage = "Achtung!
Das endgültige Löschen eines Klienten kann nicht rückgängig gemacht werden!
";
+ }
+
+ if(pObjectTid == TableID.Person && pMessageType == MessageType.DeleteForGood)
+ {
+ actualTextMessage = "Achtung!
Das endgültige Löschen einer Person kann nicht rückgängig gemacht werden!
";
+ }
+
+ if(pObjectTid == TableID.Employee && pMessageType == MessageType.Anonymization)
+ {
+ actualTextMessage = "Achtung!
Das Anonymisieren eines Mitarbeiters kann nicht rückgängig gemacht werden!
";
+ }
+
+ if(pObjectTid == TableID.Employee && pMessageType == MessageType.DeleteForGood)
+ {
+ actualTextMessage = "Achtung!
Das endgültige Löschen eines Mitarbeiters kann nicht rückgängig gemacht werden!
";
+ }
+
+ return $"";
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List pSelectedEmployees, List pSelectedCustomers, List pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary pUserRights)
+ {
+ var appointments2Delete = DAOFactory.SearchDAO.LoadFilteredAppointments(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, new DateTime(1, 1, 1), pIntervalEnd, pSelectedEmployees, pSelectedCustomers, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, true);
+
+ var actualTextMessage = $"Achtung!
Das Löschen von {appointments2Delete.Count} {(appointments2Delete.Count == 1 ? "Termin" : "Terminen")} bis zum {pIntervalEnd.ToShortDateString()} kann nicht rückgängig gemacht werden!
";
+
+ return $"";
+ }
+
#endregion
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/ResourceServiceImp.cs b/Service/ServiceImplementations/ResourceServiceImp.cs
index c280becb3..2cfed993e 100644
--- a/Service/ServiceImplementations/ResourceServiceImp.cs
+++ b/Service/ServiceImplementations/ResourceServiceImp.cs
@@ -824,7 +824,9 @@ namespace BeWo.Service.ServiceImplementations
try
{
foreach (var kvp in pOid2Version)
- ServiceLogic.SetActivationType(new Dictionary { { kvp.Key, kvp.Value } }, ActivationTypeId.Deleted);
+ {
+ ServiceLogic.SetActivationType(new Dictionary { { kvp.Key, kvp.Value } }, ActivationTypeId.Deleted);
+ }
}
catch (Exception e)
{
@@ -836,10 +838,20 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
+ /*
+ * Type:
+ * 0: Normal
+ * 1: Pattern
+ * 2: Occurence
+ * 3: ChangedOccurence
+ * 4: DeletedOccurence
+ */
+
var lOriginals = DAOFactory.GenericDAO.LoadByIDs(pOid2Version.Keys);
if(lOriginals.Count > 0 && lOriginals.Any(a => a.Type == 3 && a.Oid.HasValue && pOid2Version.Keys.Contains(a.Oid.Value)))
{
+ // Bearbeitete Serientermine werden auf "gelöscht" gesetzt
var originalsToUpdate = lOriginals.Where(w => w.Type == 3 && w.Oid.HasValue && pOid2Version.Keys.Contains(w.Oid.Value)).ToList();
foreach(var original in originalsToUpdate)
{
@@ -852,6 +864,7 @@ namespace BeWo.Service.ServiceImplementations
foreach(var appointment in updatedAppointments)
{
+ // Die auf "gelöscht" gesetzten, bearbeiteten Serientermine werden aus dem Dictionary entfernt
if(appointment.Oid.HasValue && appointment.Version.HasValue && pOid2Version.ContainsKey(appointment.Oid.Value))
{
pOid2Version.Remove(appointment.Oid.Value);
@@ -859,7 +872,23 @@ namespace BeWo.Service.ServiceImplementations
}
}
- foreach (var kvp in pOid2Version)
+ // Geänderte Serientermine werden anhand der RecurrenceId aus der Datenbank geladen und der Typ auf "gelöscht" gesetzt
+ var recurrenceIds = Utils.ExtractRecurrenceIdFromRecurrenceString(lOriginals);
+
+ if(recurrenceIds.Count > 0)
+ {
+ var exceptionsToDelete = DAOFactory.SearchDAO.FindAppointmentsByRecurrenceId(recurrenceIds);
+
+ exceptionsToDelete.DoForEach(exception =>
+ {
+ if(exception.Oid != null && exception.Version != null)
+ {
+ pOid2Version.AddIfNotIn(new KeyValuePair(exception.Oid.Value, exception.Version.Value));
+ }
+ });
+ }
+
+ foreach(var kvp in pOid2Version)
{
ServiceLogic.SetActivationType(new Dictionary { { kvp.Key, kvp.Value } }, ActivationTypeId.Deleted);
}
@@ -1052,9 +1081,9 @@ namespace BeWo.Service.ServiceImplementations
if(!(!pHasRightToSeeAllEmployeeAppointments && pSelectedEmployees != null && pSelectedEmployees.Count == 1 && pSelectedEmployees.Contains(pEmployeeOid)))
{
- //rausnehmen, sonst werden termine nicht gezeigt, bei denen man owner und kein Employee ausgewählt wurde.
- //wird nicht rausgenommen, wenn man die termine anderer mitarbeiter nicht sehen darf und "nur meine termine" ausgewählt hat.
- //sonst werden die filter mit and und nicht mit or verknüpft.
+ //Rausnehmen, sonst werden Termine nicht gezeigt, bei denen man Owner ist und kein Employee ausgewählt wurde.
+ //Wird nicht rausgenommen, wenn man die Termine anderer Mitarbeiter nicht sehen darf und "nur meine Termine" ausgewählt hat.
+ //Sonst werden die Filter mit and und nicht mit or verknüpft.
pSelectedEmployees?.Remove(pEmployeeOid);
}
@@ -1064,9 +1093,8 @@ namespace BeWo.Service.ServiceImplementations
{
ownerOid = pEmployeeOid;
}
-
- var appointments = DAOFactory.SearchDAO.LoadFilteredAppointmentsForEmployee(pHasRightToSeeAllEmployeeAppointments, ownerOid, pIntervalStart, pIntervalEnd, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments).ToList();
-
+
+ var appointments = DAOFactory.SearchDAO.LoadFilteredAppointmentsForEmployee(pHasRightToSeeAllEmployeeAppointments, ownerOid, pIntervalStart, pIntervalEnd, pSelectedEmployees, pSelectedCustomer, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, false).ToList();
return MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDCs(appointments).OrderBy(a => a.StartDate).ToList();
////var appointments = DAOFactory.GenericDAO.GetAll();
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index d0e311a86..7fb73c306 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -436,6 +436,7 @@ namespace BS.Shared
CustomerAllowReactivation = 21101,
OrganisationAllowReactivation = 21102,
PersonAllowReactivation = 21103,
+ EmployeeAllowReactivation = 21104,
ServiceRecordAllowRebooking = 22000,
@@ -484,7 +485,13 @@ namespace BS.Shared
CustomerTeam_View = 40000,
CustomerTeam_Edit = 40001,
CustomerTeam_Delete = 40002,
- CustomerTeam_Create = 40003
+ CustomerTeam_Create = 40003,
+
+ Customer_Anonymization = 171717,
+ Customer_Full_Delete = 171718,
+ Person_Full_Delete = 171719,
+ Employee_Full_Delete = 171720,
+ Employee_Anonymization = 171721
}
public enum PersonType
@@ -945,4 +952,10 @@ namespace BS.Shared
Mitarbeiter,
Klient
}
+
+ public enum MessageType
+ {
+ Anonymization,
+ DeleteForGood
+ }
}
\ No newline at end of file
diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs
index 787f07417..618032b26 100644
--- a/Shared/Core/EnumTranslations.cs
+++ b/Shared/Core/EnumTranslations.cs
@@ -509,7 +509,10 @@ namespace BS.Shared.Core
{
UserRightType.PersonAllowReactivation, Translator.Translate("Personen reaktivieren")
},
- {
+ {
+ UserRightType.EmployeeAllowReactivation, Translator.Translate("Mitarbeiter reaktivieren")
+ },
+ {
UserRightType.ServiceRecordAllowRebooking, Translator.Translate("Zeiterfassung umbuchen")
},
{
@@ -607,6 +610,21 @@ namespace BS.Shared.Core
,
{
UserRightType.CustomerTeam_Delete, Translator.Translate("Kliententeams löschen")
+ },
+ {
+ UserRightType.Customer_Anonymization, Translator.Translate("Klienten anonymisieren")
+ },
+ {
+ UserRightType.Customer_Full_Delete, Translator.Translate("Klienten endgültig löschen")
+ },
+ {
+ UserRightType.Person_Full_Delete, Translator.Translate("Personen endgültig löschen")
+ },
+ {
+ UserRightType.Employee_Full_Delete, Translator.Translate("Mitarbeiter endgültig löschen")
+ },
+ {
+ UserRightType.Employee_Anonymization, Translator.Translate("Mitarbeiter anonymisieren")
}
};
#endregion
diff --git a/Shared/Core/Utils.cs b/Shared/Core/Utils.cs
index 67b1b4d92..b5ed5ca6b 100644
--- a/Shared/Core/Utils.cs
+++ b/Shared/Core/Utils.cs
@@ -473,7 +473,6 @@ namespace BS.Shared.Core
return smallData;
}
-
public static Image CreateImageFromByteArray(byte[] data)
{
try
@@ -540,22 +539,22 @@ namespace BS.Shared.Core
public static List GetParentTextModules(List childTextModules)
{
- Parents.Clear();
+ _Parents.Clear();
foreach(var textModule in childTextModules)
{
GetParentTextModule(textModule);
}
- return Parents;
+ return _Parents;
}
- private static readonly List Parents = new List();
+ private static readonly List _Parents = new List();
private static void GetParentTextModule(TextModuleDC textModule)
{
if(textModule.Parent != null)
{
- Parents.AddIfNotIn(textModule.Parent);
+ _Parents.AddIfNotIn(textModule.Parent);
if(textModule.Parent.Parent != null)
{
@@ -563,6 +562,21 @@ namespace BS.Shared.Core
}
}
}
+
+ public static string CollectionToString(string pSeperator, IEnumerable pCollection)
+ {
+ pSeperator += " ";
+ var result = "";
+ var enumerator = pCollection.GetEnumerator();
+
+ while(enumerator.MoveNext())
+ {
+ var currentString = enumerator.Current?.ToString();
+ result += currentString + pSeperator;
+ }
+
+ return result.Trim(pSeperator?.ToCharArray());
+ }
}
public struct NullCompareResult
diff --git a/Shared/DataContracts/Compact/ClientPartials/CompactCustomerDC.cs b/Shared/DataContracts/Compact/ClientPartials/CompactCustomerDC.cs
index 5f22db1ef..ec8bd3dae 100644
--- a/Shared/DataContracts/Compact/ClientPartials/CompactCustomerDC.cs
+++ b/Shared/DataContracts/Compact/ClientPartials/CompactCustomerDC.cs
@@ -92,11 +92,8 @@ namespace BS.Shared.DataContracts.Compact
get { return ActivationType == ActivationTypeId.Archived; }
}
- public bool IsDeleted
- {
- get { return ActivationType == ActivationTypeId.Deleted; }
- }
-
+ public bool IsDeleted => ActivationType == ActivationTypeId.Deleted;
+
public string Name
{
get
diff --git a/Shared/DataContracts/Compact/ClientPartials/CompactEmployeeDC.cs b/Shared/DataContracts/Compact/ClientPartials/CompactEmployeeDC.cs
index 16b46f332..e187be3b4 100644
--- a/Shared/DataContracts/Compact/ClientPartials/CompactEmployeeDC.cs
+++ b/Shared/DataContracts/Compact/ClientPartials/CompactEmployeeDC.cs
@@ -4,65 +4,27 @@ namespace BS.Shared.DataContracts.Compact
{
public partial class CompactEmployeeDC : IFilterableDC
{
- public string DetailDescription
- {
- get
- {
- return this.LastName + ", " + this.FirstName;
- }
- }
+ public string DetailDescription => LastName + ", " + FirstName;
- public string FilterRelevants
- {
- get
- {
- return this.FirstName + " " + this.LastName + " " + this.PersonnelNumber;
- }
- }
+ public string FilterRelevants => FirstName + " " + LastName + " " + PersonnelNumber;
- public string IconPath
- {
- get
- {
- return @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
- }
- }
+ public string IconPath => @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
- public string SimpleDescription
- {
- get
- {
- return this.LastName + ", " + this.FirstName;
- }
- }
+ public string SimpleDescription => LastName + ", " + FirstName;
- public bool SupportsActivationType
- {
- get
- {
- return true;
- }
- }
+ public bool SupportsActivationType => true;
public long Version
{
- get
- {
- return this.EmployeeVersion;
- }
+ get => EmployeeVersion;
- set
- {
- this.EmployeeVersion = value;
- }
+ set => EmployeeVersion = value;
}
public override bool Equals(object obj)
{
- if (obj is CompactEmployeeDC)
+ if(obj is CompactEmployeeDC employee)
{
- var employee = (CompactEmployeeDC) obj;
-
return EmployeeOid == employee.EmployeeOid;
}
@@ -76,15 +38,13 @@ namespace BS.Shared.DataContracts.Compact
public override string ToString()
{
- return this.LastName + ", " + this.FirstName;
+ return LastName + ", " + FirstName;
}
- public SolidColorBrush FilterableBrush
- {
- get
- {
- return new SolidColorBrush((Color)ColorConverter.ConvertFromString(EmployeeColor ?? Colors.Transparent.ToString()));
- }
- }
+ public SolidColorBrush FilterableBrush => new SolidColorBrush((Color) ColorConverter.ConvertFromString(EmployeeColor ?? Colors.Transparent.ToString()));
+
+ public bool IsArchived => ActivationType == ActivationTypeId.Archived;
+
+ public bool IsDeleted => ActivationType == ActivationTypeId.Deleted;
}
}
\ No newline at end of file