- DSGVO-Gedöns

- Serientermine im Kalender können jetzt gelöscht werden.
- Bearbeitete Serientermine kann man wieder zurücksetzen.
- Klickt man in der Klientenübersicht auf Reaktivieren, wird der richtige Klient ausgewählt.
This commit is contained in:
Lyndon
2018-05-20 13:19:28 +02:00
parent b268633d6b
commit 3b6e1e8f6a
41 changed files with 1551 additions and 345 deletions

View File

@@ -543,12 +543,14 @@
<Compile Include="BSLogoControl.xaml.cs">
<DependentUpon>BSLogoControl.xaml</DependentUpon>
</Compile>
<Compile Include="Converter\AnonymizationRight2VisibilityConverter.cs" />
<Compile Include="Converter\BoolNullCheckConverter.cs" />
<Compile Include="Converter\BoolReverseConverter.cs" />
<Compile Include="Converter\CellColorConverter.cs" />
<Compile Include="Converter\CollectionContainsTag2BoolConverter.cs" />
<Compile Include="Converter\CollectionCountToBoolConverter.cs" />
<Compile Include="Converter\CollectionCountToVisibilityConverter.cs" />
<Compile Include="Converter\DeleteForGoodRight2VisibilityConverter.cs" />
<Compile Include="Converter\EnumToDescriptionConverter.cs" />
<Compile Include="Converter\FileAttachmentTypeConverter.cs" />
<Compile Include="Converter\IndividualGoalMassnahmeUncheckPreventConverter.cs" />

View File

@@ -64,6 +64,8 @@
<conv:IndividualGoalMassnahmeUncheckPreventConverter x:Key="IndividualGoalMassnahmeUncheckPreventConverter" />
<conv:Rights2DefaultBooleanConverter x:Key="Rights2DefaultBooleanConverter"/>
<conv:CollectionCountToVisibilityConverter x:Key="CollectionCountToVisibilityConverter" />
<conv:DeleteForGoodRight2VisibilityConverter x:Key="DeleteForGoodRight2VisibilityConverter" />
<conv:AnonymizationRight2VisibilityConverter x:Key="AnonymizationRight2VisibilityConverter" />
<Style x:Key="SupportConceptDetailStyle" TargetType="{x:Type ListBoxItem}">

View File

@@ -0,0 +1,39 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using BS.Shared;
namespace BeWo.Converter
{
public class AnonymizationRight2VisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(parameter == null)
{
return Visibility.Collapsed;
}
var hasRight = false;
switch(parameter.ToString())
{
case "Customer":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_Anonymization);
break;
case "Employee":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.Employee_Anonymization);
break;
}
return value != null && (bool) value && hasRight ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using BS.Shared;
namespace BeWo.Converter
{
public class DeleteForGoodRight2VisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(parameter == null)
{
return Visibility.Collapsed;
}
var hasRight = false;
switch(parameter.ToString())
{
case "Customer":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_Full_Delete);
break;
case "Employee":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.Employee_Full_Delete);
break;
case "Person":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.Person_Full_Delete);
break;
}
return value != null && (bool)value && hasRight ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -31,6 +31,9 @@ namespace BeWo.Converter
case "Customer":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerAllowReactivation);
break;
case "Employee":
hasRight = BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeAllowReactivation);
break;
}
return (bool)value && hasRight ? Visibility.Visible : Visibility.Collapsed;

View File

@@ -13,6 +13,7 @@
xmlns:converter="clr-namespace:BeWo.Converter"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
<localView:BeWoView.Resources>
<ResourceDictionary>
@@ -613,6 +614,9 @@
<Button Margin="1" Height="24" Width="24" ToolTip="Zeitleiste anzeigen" Click="ButtonTimelineView_Click">
<Image Source="/BeWoPlaner;component/Ressources/Icons/History24.png" />
</Button>
<Button Margin="1" Height="24" Width="24" ToolTip="Termine in Intervall löschen" Click="ButtonDeleteAppointmentsInInterval_Click">
<Image Source="/BeWoPlaner;component/Ressources/Icons/Delete24.png" />
</Button>
<StackPanel x:Name="DayViewOptions" Orientation="Horizontal" Visibility="Visible">
<Label VerticalAlignment="Center" Content="anz Tage:" />
<dxe:SpinEdit MaxValue="100" VerticalAlignment="Center" x:Name="SpinEditDayViewDayCount" AllowNullInput="False"
@@ -935,8 +939,8 @@
</Grid.RowDefinitions>
<GroupBox Header="Ausgewählte Elemente" Style="{StaticResource ObjectEditGroupBox}" Grid.Row="0" Margin="0,3,0,0">
<ListBox Background="Transparent" ItemsSource="{Binding Path=SelectedItems}" IsSynchronizedWithCurrentItem="True"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch"
ItemContainerStyle="{DynamicResource MultiElementSelectionControlStyle}">
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch"
ItemContainerStyle="{DynamicResource MultiElementSelectionControlStyle}">
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border x:Name="Bd" SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
@@ -1004,9 +1008,9 @@
</dxsch:SchedulerControl.TimelineView>
<dxsch:SchedulerControl.Storage>
<dxsch:SchedulerStorage AppointmentsChanged="NewSchedulerStorage_AppointmentsChanged"
AppointmentDeleting="NewSchedulerStorage_AppointmentDeleting"
AppointmentsInserted="NewSchedulerStorage_AppointmentsInserted"
FetchAppointments="SchedulerStorage_OnFetchAppointments">
AppointmentDeleting="NewSchedulerStorage_AppointmentDeleting"
AppointmentsInserted="NewSchedulerStorage_AppointmentsInserted"
FetchAppointments="SchedulerStorage_OnFetchAppointments">
<dxsch:SchedulerStorage.AppointmentStorage>
<dxsch:AppointmentStorage>
<dxsch:AppointmentStorage.Mappings>
@@ -1038,16 +1042,19 @@
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxsch:SchedulerMenuItemName.NewAllDayEvent}" />
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxsch:SchedulerMenuItemName.NewRecurringAppointment}" />
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxsch:SchedulerMenuItemName.NewRecurringEvent}" />
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="MitarbeiterVerfuegbarkeitPruefenButtonItem"
Content="{markup:Translate Verfügbare Mitarbeiter anzeigen}"
ItemClick="MitarbeiterVerfuegbarkeitPruefenButtonItem_OnItemClick" />
Content="{markup:Translate Verfügbare Mitarbeiter anzeigen}"
ItemClick="MitarbeiterVerfuegbarkeitPruefenButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:BarButtonItemLink BarItemName="MitarbeiterVerfuegbarkeitPruefenButtonItem" />
</dxsch:SchedulerControl.DefaultMenuCustomizations>
<dxsch:SchedulerControl.AppointmentMenuCustomizations>
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxsch:SchedulerMenuItemName.RestoreOccurrence}" />
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="RestoreAppointmentButtonItem" Content="Serientermin wiederherstellen" ItemClick="RestoreAppointmentButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="ZusagenButtonItem" Content="Zusagen" ItemClick="ZusagenButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
@@ -1087,5 +1094,23 @@
</dxe:DateNavigator>
</Grid>
<Border Grid.Row="0" Grid.RowSpan="2" x:Name="PopupContent" />
<Popup Grid.Row="0" StaysOpen="True" Placement="MousePoint" Width="290" Height="80" Closed="popup_Closed" Opened="popup_Opened" x:Name="DeleteAppointmentsPopup">
<Grid Background="{StaticResource ControlBackground}" Margin="2,2,2,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Termine löschen bis: " Height="24" Margin="0,0,0,0" />
<dxe:DateEdit Grid.Column="1" Grid.Row="0" MaskType="DateTimeAdvancingCaret" Width="150" Height="24" VerticalAlignment="Center" Margin="0,0,0,0" x:Name="DeleteForGoodIntervalEndDateEdit" />
<StackPanel Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
<Button Content="OK" Click="DeleteAppointmentsForGood_Click" />
<Button Content="Abbrechen" Margin="3,0,0,0" Click="AbortDeletingAppointments_Click" />
</StackPanel>
</Grid>
</Popup>
</Grid>
</localView:BeWoView>

View File

@@ -19,7 +19,7 @@ using BeWo.Core.Service;
using BeWo.Scheduler.Converter;
using BeWo.Scheduler.ViewModel;
using BeWo.ServiceProxy;
using BeWo.View;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -33,11 +33,11 @@ using DevExpress.Xpf.Scheduler;
using DevExpress.Xpf.Scheduler.Reporting;
using DevExpress.XtraScheduler;
using Appointment = DevExpress.XtraScheduler.Appointment;
using ColorConverter = System.Windows.Media.ColorConverter;
using DateTime = System.DateTime;
using Appointment = DevExpress.XtraScheduler.Appointment;
using ColorConverter = System.Windows.Media.ColorConverter;
using DateTime = System.DateTime;
using InplaceEditorEventArgs = DevExpress.Xpf.Scheduler.InplaceEditorEventArgs;
using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl;
using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl;
namespace BeWo.Scheduler.View
{
@@ -948,11 +948,11 @@ namespace BeWo.Scheduler.View
{
//WriteToDebugLog("Appointment deleting");
if (e.Object is Appointment app && app.Type != AppointmentType.ChangedOccurrence)
{
if(e.Object is Appointment app && app.Type != AppointmentType.ChangedOccurrence)
{
const string msg = "Möchten Sie den gewählten Termin wirklich löschen?";
if (app.Type != AppointmentType.DeletedOccurrence && MessageBox.Show(msg, "BeWoPlaner", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
if(app.Type != AppointmentType.DeletedOccurrence && MessageBox.Show(msg, "BeWoPlaner", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
e.Cancel = true;
}
@@ -960,7 +960,7 @@ namespace BeWo.Scheduler.View
{
var appList = new List<Appointment>();
if (app.Type != AppointmentType.ChangedOccurrence)
if(app.Type != AppointmentType.ChangedOccurrence)
{
appList.Add(app);
}
@@ -1038,6 +1038,30 @@ namespace BeWo.Scheduler.View
}
if(Scheduler.SelectedAppointments.Count == 0 || Scheduler.SelectedAppointments[0]?.Type != AppointmentType.ChangedOccurrence)
{
var restoreMenu = e.Menu.ItemLinks.FirstOrDefault(f =>
{
var type = f.GetType();
if(type == typeof(BarButtonItemLink))
{
var item = (BarButtonItemLink) f;
if(item != null && item.Name.Contains("RestoreAppointmentButtonItem"))
{
return true;
}
}
return false;
});
if(restoreMenu != null)
{
e.Menu.ItemLinks.Remove(restoreMenu);
}
}
//if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderInZeiterfassungUebernehmen))
//{
// var menuitem = e.Menu.ItemLinks.FirstOrDefault(f => f.GetType() == typeof(BarButtonItemLink) && ((BarButtonItemLink)f).Item.Name.Contains("ZeiterfassungButtonItem"));
@@ -1990,6 +2014,122 @@ namespace BeWo.Scheduler.View
_IsNew = false;
}
}
private void ButtonDeleteAppointmentsInInterval_Click(object sender, RoutedEventArgs e)
{
DeleteAppointmentsPopup.IsOpen = true;
}
private void AbortDeletingAppointments_Click(object sender, RoutedEventArgs e)
{
DeleteAppointmentsPopup.IsOpen = false;
}
private void DeleteAppointmentsForGood_Click(object sender, RoutedEventArgs e)
{
var employeesOnly = MitarbeiterEbenenCheckBox.IsChecked != null && MitarbeiterEbenenCheckBox.IsChecked.Value;
var customersOnly = KlientenEbenenCheckBox.IsChecked != null && KlientenEbenenCheckBox.IsChecked.Value;
var resourcesOnly = RessourcenEbenenCheckBox.IsChecked != null && RessourcenEbenenCheckBox.IsChecked.Value;
var onlyPrivateAppointments = ShowPrivateAppointmentsCheckBox.IsChecked != null && ShowPrivateAppointmentsCheckBox.IsChecked.Value;
var showOnlyMyAppointments = ZeigeNurMeineTermine;
var loggedOnUserHasRightToSeeAllAppointments = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll);
var loggedOnEmployeeOid = BeWoApp.LoggedOnEmployee.EmployeeOid.Value;
var date = DeleteForGoodIntervalEndDateEdit.DateTime;
var userRights = new Dictionary<UserRightType, bool>
{
{
UserRightType.KalenderKliententermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern)
},
{
UserRightType.KalenderMitarbeitertermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern)
},
{
UserRightType.KalenderRessourcentermineAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern)
},
{
UserRightType.KalenderRessourcentermineAndererAendern, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAndererAendern)
}
};
var dialog = new MessageDialog(() =>
{
ServiceFacade.DoOperationsServiceAsync(s => s.DeleteAppointmentsInInterval(
loggedOnUserHasRightToSeeAllAppointments,
loggedOnEmployeeOid,
date,
SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(),
SelectedCustomers.Select(customer => customer.CustomerOid).ToList(),
SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(),
employeesOnly,
customersOnly,
resourcesOnly,
onlyPrivateAppointments,
showOnlyMyAppointments,
userRights), () =>
{
this.Dispatch(() =>
{
DeleteAppointmentsPopup.IsOpen = false;
UpdateVM(true);
});
});
});
ServiceFacade.DoOperationsServiceAsync(
s => s.GetMessageFromServerForDeletingAppointments(
loggedOnUserHasRightToSeeAllAppointments,
loggedOnEmployeeOid,
date,
SelectedEmployees.Select(employee => employee.EmployeeOid).ToList(),
SelectedCustomers.Select(customer => customer.CustomerOid).ToList(),
SelectedResources.Select(resource => resource.ResourceOid.Value).ToList(),
employeesOnly,
customersOnly,
resourcesOnly,
onlyPrivateAppointments,
showOnlyMyAppointments,
userRights), xaml =>
{
this.Dispatch(() =>
{
dialog.SetXaml(xaml);
dialog.ShowDialog();
});
});
}
private void RestoreAppointmentButtonItem_OnItemClick(object sender, ItemClickEventArgs e)
{
var appointmentToRestore = Scheduler.SelectedAppointments[0];
var appointmentVM = (SchedulerAppointmentVM) appointmentToRestore.GetSourceObject(Scheduler.GetCoreStorage());
var appointmentDC = appointmentVM?.CommitToDataContract();
if(appointmentDC?.SchedulerAppointmentOid == null || appointmentDC.NewSchedulerAppointmentVersion == null || appointmentToRestore.Type != AppointmentType.ChangedOccurrence)
{
return;
}
ServiceFacade.DoResourceServiceAsync(s => s.GetSchedulerAppointmentByid(appointmentDC.SchedulerAppointmentOid.Value), appointment =>
{
if(appointment.SchedulerAppointmentOid == null || appointment.NewSchedulerAppointmentVersion == null)
{
return;
}
ServiceFacade.DoResourceServiceAsync(s => s.DeleteSchedulerAppointments(new Dictionary<long, long> { { appointment.SchedulerAppointmentOid.Value, appointment.NewSchedulerAppointmentVersion.Value } }),
() =>
{
this.Dispatch(() =>
{
UpdateVM(true);
});
});
});
}
}
#region Converter

View File

@@ -344,7 +344,7 @@
<dxsch:DailyRecurrenceControl Visibility="{Binding RecurrenceVisualController.IsDailyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}"
RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />
<dxsch:WeeklyRecurrenceControl Visibility="{Binding RecurrenceVisualController.IsWeeklyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}"
RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />
RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" x:Name="WeeklyRecurrenceControl" />
<dxsch:MonthlyRecurrenceControl x:Name="MonthlyRecurrenceControl"
Visibility="{Binding RecurrenceVisualController.IsMonthlyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}"
RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />

View File

@@ -72,9 +72,12 @@ namespace BeWo.Scheduler.View
get => _SelectedEmployees ?? (_SelectedEmployees = new ObservableCollection<Employee2SchedulerAppointmentDC>(NewSchedulerAppointmentFormController.EmployeeList ?? new List<Employee2SchedulerAppointmentDC>()));
set
{
if (_SelectedEmployees.Equals(value)) return;
if(_SelectedEmployees.Equals(value))
{
return;
}
_SelectedEmployees = value;
_SelectedEmployees = value;
SelectedEmployees.CollectionChanged += SelectedEmployeesCollectionChanged;
NewSchedulerAppointmentFormController.EmployeeList = value.ToList();
OnPropertyChanged(nameof(SelectedEmployees));
@@ -87,9 +90,12 @@ namespace BeWo.Scheduler.View
get => _SelectedCustomers ?? (_SelectedCustomers = new ObservableCollection<CompactCustomerDC>(NewSchedulerAppointmentFormController.CustomerList ?? new List<CompactCustomerDC>()));
set
{
if (_SelectedCustomers.Equals(value)) return;
if(_SelectedCustomers.Equals(value))
{
return;
}
_SelectedCustomers = value;
_SelectedCustomers = value;
SelectedCustomers.CollectionChanged += SelectedCustomersCollectionChanged;
NewSchedulerAppointmentFormController.CustomerList = value.ToList();
OnPropertyChanged(nameof(SelectedCustomers));
@@ -112,7 +118,7 @@ namespace BeWo.Scheduler.View
Categories = categoriesToResources.Keys.ToList();
if (categoriesToResources.Count > 0)
if(categoriesToResources.Count > 0)
{
ResourceList = categoriesToResources.First().Value;
}
@@ -139,46 +145,46 @@ namespace BeWo.Scheduler.View
private void InitRights()
{
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnlegen))
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnlegen))
{
MitarbeiterPopUpOeffnenBtn.Visibility = Visibility.Collapsed;
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAnlegen))
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAnlegen))
{
KlientenPopUpOeffnenBtn.Visibility = Visibility.Collapsed;
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnlegen))
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnlegen))
{
RessourcenPopUpOeffnenBtn.Visibility = Visibility.Collapsed;
}
var m = SelectedEmployees;
var k = SelectedCustomers;
var r = SelectedResources;
var selectedEmployees = SelectedEmployees;
var selectedCustomers = SelectedCustomers;
var selectedResources = SelectedResources;
var allowedToChange = true;
if (!NewSchedulerAppointmentFormController.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))
if(!NewSchedulerAppointmentFormController.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))
{
if (m.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern))
if(selectedEmployees.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern))
{
allowedToChange = false;
}
if (k.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern))
if(selectedCustomers.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern))
{
allowedToChange = false;
}
if (r.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern))
if(selectedResources.Count > 0 && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern))
{
allowedToChange = false;
}
}
if (allowedToChange)
if(allowedToChange)
{
return;
}
@@ -250,7 +256,17 @@ namespace BeWo.Scheduler.View
{
try
{
Controller.Storage.BeginUpdate();
var isWeeklyRecurrence = RecurrenceVisualController.IsWeeklyRecurrence;
var weekDays = WeeklyRecurrenceControl.WeekDays;
if(isWeeklyRecurrence && weekDays == 0)
{
MessageBox.Show("Bei einem sich wöchentlich wiederholenden Termin muss mindestens ein Wochentag ausgewählt sein!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
Controller.Storage.BeginUpdate();
ViewModel.NewVM.EmployeeList = NewSchedulerAppointmentFormController.EmployeeList;
@@ -306,12 +322,12 @@ namespace BeWo.Scheduler.View
ViewModel.ShouldLockOverlappingAppointmentCheck = true;
if (Appointment.RecurrenceInfo != null)
if(Appointment.RecurrenceInfo != null)
{
ViewModel.ApplyChangesToChangedOccurencyCustomFields(employees, customers, resources, originator, isPrivate, Appointment.RecurrenceIndex.ToString(), new Guid(Appointment.RecurrenceInfo.Id.ToString()));
}
if (Appointment.IsOccurrence && item == null)
if(Appointment.IsOccurrence && item == null)
{
((List<Employee2SchedulerAppointmentDC>)Appointment.CustomFields["EmployeeList"]).ForEach(each =>
{
@@ -351,7 +367,7 @@ namespace BeWo.Scheduler.View
var y = SelectedKlient.Items;
if (y.Count == 0)
if(y.Count == 0)
{
MessageBox.Show("Bitte wählen Sie mindestens einen Klienten aus!");
}
@@ -390,7 +406,7 @@ namespace BeWo.Scheduler.View
break;
}
if (!(obj is Employee2SchedulerAppointmentDC))
if(!(obj is Employee2SchedulerAppointmentDC))
{
return;
}
@@ -501,12 +517,12 @@ namespace BeWo.Scheduler.View
public override bool IsAppointmentChanged()
{
if (base.IsAppointmentChanged())
if(base.IsAppointmentChanged())
{
return true;
}
if (SourceResourceList != null && ResourceList != null ||
if(SourceResourceList != null && ResourceList != null ||
SourceEmployeeList != null && EmployeeList != null ||
SourceCustomerList != null && CustomerList != null ||
SourceOriginator != null && Originator != null)

View File

@@ -211,7 +211,9 @@ namespace BeWo.Scheduler.ViewModel
public void DeleteAppointments(SchedulerControl control, IEnumerable<Appointment> list)
{
var dcList = list.Select(item => item.GetSourceObject(control.GetCoreStorage())).OfType<SchedulerAppointmentVM>().Select(vm => vm.CommitToDataContract()).Where(dc => dc.SchedulerAppointmentOid.HasValue).ToList();
var appointments = list as IList<Appointment> ?? list.ToList();
var dcList = appointments.Select(item => item.GetSourceObject(control.GetCoreStorage())).OfType<SchedulerAppointmentVM>().Select(vm => vm.CommitToDataContract()).Where(dc => dc.SchedulerAppointmentOid.HasValue).ToList();
var idList = (from item in dcList where item.SchedulerAppointmentOid.HasValue select item.SchedulerAppointmentOid.Value).ToList();
NewSchedulerView.IgnoreChangeEvents = true;
@@ -221,6 +223,8 @@ namespace BeWo.Scheduler.ViewModel
UpdateViewModel(mostRecentAppointments);
control.ActiveView.LayoutChanged();
NewSchedulerView.IgnoreChangeEvents = false;
// TODO: zu Async umbauen
}
public void InsertAppointments(SchedulerControl control, IEnumerable<Appointment> list)

View File

@@ -270,6 +270,14 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/GetChatBewoMessageSyncBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.ChatBewoMessageSyncDC GetChatBewoMessageSync(System.Nullable<long> eOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/ReactivateEmployee", ReplyAction="http://tempuri.org/IEmployeeService/ReactivateEmployeeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/ReactivateEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void ReactivateEmployee(long pOid, long pVersion);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/GetAllCompactEmployees", ReplyAction="http://tempuri.org/IEmployeeService/GetAllCompactEmployeesResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/GetAllCompactEmployeesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactEmployeeDC> GetAllCompactEmployees();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IEmployeeService/ArchiveEmployee", ReplyAction="http://tempuri.org/IEmployeeService/ArchiveEmployeeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IEmployeeService/ArchiveEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void ArchiveEmployee(long pOid, long pVersion);
@@ -696,6 +704,16 @@ namespace BeWo.ServiceProxy
return base.Channel.GetChatBewoMessageSync(eOid);
}
public void ReactivateEmployee(long pOid, long pVersion)
{
base.Channel.ReactivateEmployee(pOid, pVersion);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactEmployeeDC> GetAllCompactEmployees()
{
return base.Channel.GetAllCompactEmployees();
}
public void ArchiveEmployee(long pOid, long pVersion)
{
base.Channel.ArchiveEmployee(pOid, pVersion);
@@ -1218,10 +1236,11 @@ namespace BeWo.ServiceProxy
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.CustomerPersonRelationDC> GetEnvironmentCustomerForPerson(long personOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetCustomerOidsRelatedToEmployee", ReplyAction="http://tempuri.org/ICustomerService/GetCustomerOidsRelatedToEmployeeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetCustomerOidsRelatedToEmployeeBeWoFaultFaul" +
"t", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<long> GetCustomerOidsRelatedToEmployee(long pEmployeeOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetSupportConceptCostBearerRelationsById", ReplyAction="http://tempuri.org/ICustomerService/GetSupportConceptCostBearerRelationsByIdRespo" +
"nse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetSupportConceptCostBearerRelationsByIdBeWoF" +
"aultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.SupportConceptCostBearerRelDC> GetSupportConceptCostBearerRelationsById(System.Collections.Generic.List<long> relOids);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/UpdateCustomersAbsenceTimes", ReplyAction="http://tempuri.org/ICustomerService/UpdateCustomersAbsenceTimesResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdateCustomersAbsenceTimesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
@@ -2021,9 +2040,9 @@ namespace BeWo.ServiceProxy
return base.Channel.GetEnvironmentCustomerForPerson(personOid);
}
public System.Collections.Generic.List<long> GetCustomerOidsRelatedToEmployee(long pEmployeeOid)
public System.Collections.Generic.List<BS.Shared.DataContracts.SupportConceptCostBearerRelDC> GetSupportConceptCostBearerRelationsById(System.Collections.Generic.List<long> relOids)
{
return base.Channel.GetCustomerOidsRelatedToEmployee(pEmployeeOid);
return base.Channel.GetSupportConceptCostBearerRelationsById(relOids);
}
public void UpdateCustomersAbsenceTimes(long pCustomerOid, System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC> pAbsenceTimes)
@@ -4307,6 +4326,41 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteTextbausteineBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeleteTextbausteine(System.Collections.Generic.Dictionary<long, long> pOid2Version);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/AnonymizeCustomer", ReplyAction="http://tempuri.org/IOperationsService/AnonymizeCustomerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/AnonymizeCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void AnonymizeCustomer(long pCustomerOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteCustomerForGood", ReplyAction="http://tempuri.org/IOperationsService/DeleteCustomerForGoodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteCustomerForGoodBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeleteCustomerForGood(long pCustomerOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeletePersonForGood", ReplyAction="http://tempuri.org/IOperationsService/DeletePersonForGoodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeletePersonForGoodBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeletePersonForGood(long pPersonOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteEmployeeForGood", ReplyAction="http://tempuri.org/IOperationsService/DeleteEmployeeForGoodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteEmployeeForGoodBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeleteEmployeeForGood(long pEmployeeOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetMessageFromServer", ReplyAction="http://tempuri.org/IOperationsService/GetMessageFromServerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetMessageFromServerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
string GetMessageFromServer(BS.Shared.TableID pObjectTid, System.Nullable<long> pObjectOid, BS.Shared.MessageType pMessageType);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/AnonymizeEmployee", ReplyAction="http://tempuri.org/IOperationsService/AnonymizeEmployeeResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/AnonymizeEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void AnonymizeEmployee(long pEmployeeOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetMessageFromServerForDeletingAppointments" +
"", ReplyAction="http://tempuri.org/IOperationsService/GetMessageFromServerForDeletingAppointments" +
"Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetMessageFromServerForDeletingAppointments" +
"BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, System.DateTime pIntervalEnd, System.Collections.Generic.List<long> pSelectedEmployees, System.Collections.Generic.List<long> pSelectedCustomers, System.Collections.Generic.List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, System.Collections.Generic.Dictionary<BS.Shared.UserRightType, bool> pUserRights);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteAppointmentsInInterval", ReplyAction="http://tempuri.org/IOperationsService/DeleteAppointmentsInIntervalResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteAppointmentsInIntervalBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeleteAppointmentsInInterval(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, System.DateTime pIntervalEnd, System.Collections.Generic.List<long> pSelectedEmployees, System.Collections.Generic.List<long> pSelectedCustomers, System.Collections.Generic.List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, System.Collections.Generic.Dictionary<BS.Shared.UserRightType, bool> pUserRights);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateServiceDescriptions", ReplyAction="http://tempuri.org/IOperationsService/UpdateServiceDescriptionsResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateServiceDescriptionsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void UpdateServiceDescriptions(System.Collections.Generic.List<BS.Shared.DataContracts.ServiceDescriptionDC> pServiceDescriptions);
@@ -5138,6 +5192,46 @@ namespace BeWo.ServiceProxy
base.Channel.DeleteTextbausteine(pOid2Version);
}
public void AnonymizeCustomer(long pCustomerOid)
{
base.Channel.AnonymizeCustomer(pCustomerOid);
}
public void DeleteCustomerForGood(long pCustomerOid)
{
base.Channel.DeleteCustomerForGood(pCustomerOid);
}
public void DeletePersonForGood(long pPersonOid)
{
base.Channel.DeletePersonForGood(pPersonOid);
}
public void DeleteEmployeeForGood(long pEmployeeOid)
{
base.Channel.DeleteEmployeeForGood(pEmployeeOid);
}
public string GetMessageFromServer(BS.Shared.TableID pObjectTid, System.Nullable<long> pObjectOid, BS.Shared.MessageType pMessageType)
{
return base.Channel.GetMessageFromServer(pObjectTid, pObjectOid, pMessageType);
}
public void AnonymizeEmployee(long pEmployeeOid)
{
base.Channel.AnonymizeEmployee(pEmployeeOid);
}
public string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, System.DateTime pIntervalEnd, System.Collections.Generic.List<long> pSelectedEmployees, System.Collections.Generic.List<long> pSelectedCustomers, System.Collections.Generic.List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, System.Collections.Generic.Dictionary<BS.Shared.UserRightType, bool> pUserRights)
{
return base.Channel.GetMessageFromServerForDeletingAppointments(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, pIntervalEnd, pSelectedEmployees, pSelectedCustomers, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, pUserRights);
}
public void DeleteAppointmentsInInterval(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, System.DateTime pIntervalEnd, System.Collections.Generic.List<long> pSelectedEmployees, System.Collections.Generic.List<long> pSelectedCustomers, System.Collections.Generic.List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, System.Collections.Generic.Dictionary<BS.Shared.UserRightType, bool> pUserRights)
{
base.Channel.DeleteAppointmentsInInterval(pHasRightToSeeAllEmployeeAppointments, pEmployeeOid, pIntervalEnd, pSelectedEmployees, pSelectedCustomers, pSelectedResources, pEmployeesOnly, pCustomersOnly, pResourcesOnly, pPrivateAppointmentsOnly, pOnlyMyAppointments, pUserRights);
}
public void UpdateServiceDescriptions(System.Collections.Generic.List<BS.Shared.DataContracts.ServiceDescriptionDC> pServiceDescriptions)
{
base.Channel.UpdateServiceDescriptions(pServiceDescriptions);

View File

@@ -413,6 +413,11 @@ namespace BeWo.ServiceProxy
DoAsync<ResourceServiceClient, IResourceService>(pAction, true);
}
public static void DoResourceServiceAsync(Action<IResourceService> pAction, Action pCallback)
{
DoAsync<ResourceServiceClient, IResourceService>(pAction, pCallback, true);
}
public static void DoStreamingServiceAsync<T>(Func<IStreamingService, T> pFunc, Action<T> pCallBack, Action pErrorCallBack)
{
DoAsync<StreamingServiceClient, IStreamingService, T>(pFunc, pCallBack, pErrorCallBack, true);

View File

@@ -1,2 +1 @@
svcutil.exe /noConfig /edb /n:*,BeWo.ServiceProxy /out:ServiceProxy\Generated.cs /ct:System.Collections.Generic.List`1 /r:..\Shared\bin\Debug\BS.Shared.dll http://localhost:3777/Host/EmployeeService.svc?wsdl http://localhost:3777/Host/CustomerService.svc?wsdl http://localhost:3777/Host/UserService.svc?wsdl http://localhost:3777/Host/StreamingService.svc?wsdl http://localhost:3777/Host/ValueListService.svc?wsdl http://localhost:3777/Host/DownloadService.svc?wsdl http://localhost:3777/Host/ResourceService.svc?wsdl http://localhost:3777/Host/OperationsService.svc?wsdl http://localhost:3777/Host/AnalysisService.svc?wsdl http://localhost:3777/Host/MailService.svc?wsdl http://localhost:3777/Host/AccountingService.svc?wsdl http://localhost:3777/Host/ReportService.svc?wsdl http://localhost:3777/Host/QueryService.svc?wsdl
CMD /K

View File

@@ -2582,10 +2582,11 @@
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="personDetailColumn1"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="personDetailColumn2"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="personDetailColumn3"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="personDetailColumn2"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="personDetailColumn3"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -2657,7 +2658,19 @@
</TextBlock.Text>
</TextBlock>
</StackPanel>
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="4" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="4" Margin="0,0,3,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock.Visibility>
<Binding Path="IsDeleted" ConverterParameter="Person">
<Binding.Converter>
<conv:DeleteForGoodRight2VisibilityConverter/>
</Binding.Converter>
</Binding>
</TextBlock.Visibility>
<Hyperlink Click="Hyperlink_Person_Delete_For_Good_Click" TargetName="_NewWindow" Foreground="#FFF97E7B" Tag="{Binding}">
Endgültig löschen
</Hyperlink>
</TextBlock>
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="5" Margin="0,0,3,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock.Visibility>
<Binding Path="IsDeleted" ConverterParameter="Person">
<Binding.Converter>
@@ -2665,12 +2678,11 @@
</Binding.Converter>
</Binding>
</TextBlock.Visibility>
<Hyperlink Click="Hyperlink_Person_Reaktivieren_Click" TargetName="_NewWindow" Foreground="#FFD2D2D2" Tag="{Binding}">
<Hyperlink Click="Hyperlink_Person_Reaktivieren_Click" TargetName="_NewWindow" Foreground="#FFD2D2D2" Tag="{Binding}">
Reaktivieren
</Hyperlink>
</Hyperlink>
</TextBlock>
</Grid>
</Border>
</Grid>
@@ -2730,6 +2742,127 @@
</Style>
<!-- EndRegion -->
<!-- Region Employee Styles -->
<Style x:Key="EmployeeDetailStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />
<Setter Property="Margin" Value="0,2,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<Border x:Name="ItemBorder" CornerRadius="5" MinHeight="30" Background="#FF000000">
<Border.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#19000000" Offset="0" />
<GradientStop Color="#26000000" Offset="1" />
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<Border x:Name="ItemContent" CornerRadius="5" MinHeight="30">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Grid.Row="0" Grid.Column="0" Source="..\Ressources\Icons\AnonymousUserDisabled.png" Margin="0,0,5,0" Height="30" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="Auto" RenderTransformOrigin="0.5, 0.5" />
<TextBlock x:Name="txtDetail1" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Text="{Binding Path=DetailDescription}" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center" />
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="2" Margin="0,0,3,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock.Visibility>
<Binding Path="IsDeleted" ConverterParameter="Employee">
<Binding.Converter>
<conv:AnonymizationRight2VisibilityConverter/>
</Binding.Converter>
</Binding>
</TextBlock.Visibility>
<Hyperlink Click="Hyperlink_Employee_Anonymize_Click" TargetName="_NewWindow" Foreground="#FFF97E7B" Tag="{Binding}">
Anonymisieren
</Hyperlink>
</TextBlock>
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="3" Margin="0,0,3,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock.Visibility>
<Binding Path="IsDeleted" ConverterParameter="Employee">
<Binding.Converter>
<conv:DeleteForGoodRight2VisibilityConverter/>
</Binding.Converter>
</Binding>
</TextBlock.Visibility>
<Hyperlink Click="Hyperlink_Employee_Delete_For_Good_Click" TargetName="_NewWindow" Foreground="#FFF97E7B" Tag="{Binding}">
Endgültig löschen
</Hyperlink>
</TextBlock>
<TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="4" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" VerticalAlignment="Center">
<TextBlock.Visibility>
<Binding Path="IsDeleted" ConverterParameter="Employee">
<Binding.Converter>
<conv:ReactivationRight2VisibilityConverter/>
</Binding.Converter>
</Binding>
</TextBlock.Visibility>
<Hyperlink Click="Hyperlink_Employee_Reaktivieren_Click" TargetName="_NewWindow" Foreground="#FFD2D2D2" Tag="{Binding}">
Reaktivieren
</Hyperlink>
</TextBlock>
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsArchived}" Value="True">
<Setter Property="Foreground" TargetName="txtDetail1" Value="#FF808080" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsDeleted}" Value="True">
<Setter Property="Foreground" TargetName="txtDetail1" Value="#FFF97E7B" />
</DataTrigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="OpacityMask" TargetName="ItemBorder">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#33000000" Offset="0" />
<GradientStop Color="#66000000" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="ListBoxItem.IsSelected" Value="True">
<Setter Property="OpacityMask" TargetName="ItemBorder">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#99000000" Offset="0" />
<GradientStop Color="#CC000000" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ListBoxItem.IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="OpacityMask" TargetName="ItemBorder">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#99000000" Offset="0" />
<GradientStop Color="#B2000000" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- EndRegion -->
<!-- Region SupportConcept Styles-->
<SolidColorBrush x:Key="SupportConceptContentBrush" Color="#FF993B3B" />
<LinearGradientBrush x:Key="SupportConceptListBrush" EndPoint="0.5,1" StartPoint="0.5,0">

View File

@@ -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);
}
}
}
}

View File

@@ -17,6 +17,7 @@
VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus">
<localView:BeWoView.Resources>
<converter:BoolNullCheckConverter x:Key="BoolNullCheckConverter" />
<converter:BoolReverseConverter x:Key="BoolReverseConverter" />
<detail:MVListConverter x:Key="MVListConverter" />
</localView:BeWoView.Resources>
<localView:BeWoView.Triggers>

View File

@@ -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<String>
public class MedVerDetailOrderClass : IComparer<string>
{
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)
{

View File

@@ -201,18 +201,18 @@
<Label Grid.Column="0" Grid.Row="0" Content="Vorname" />
<Label Grid.Column="0" Grid.Row="1" Content="Nachname" />
<!--<Label x:Name="lblAktenzeichen" Grid.Column="0" Grid.Row="2" Content="Aktenzeichen" />-->
<Grid x:Name="panelDebitor" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label x:Name="lblDebitorNumber" Content="Debitor Nr." />
<TextBox x:Name="txtDebitorNumber" Grid.Column="1" Margin="7,3,3,3" Height="23" Text="{val:ValidationBinding Path=DebitorNumber, UpdateSourceTrigger=PropertyChanged}" />
<Label x:Name="lblCostCenter" Grid.Column="2" Content="Kostenstelle" />
<TextBox x:Name="txtCostCenter" Grid.Column="3" Margin="7,3,3,3" Height="23" Text="{val:ValidationBinding Path=CostCenter, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<Grid x:Name="panelDebitor" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label x:Name="lblDebitorNumber" Content="Debitor Nr." />
<TextBox x:Name="txtDebitorNumber" Grid.Column="1" Margin="7,3,3,3" Height="23" Text="{val:ValidationBinding Path=DebitorNumber, UpdateSourceTrigger=PropertyChanged}" />
<Label x:Name="lblCostCenter" Grid.Column="2" Content="Kostenstelle" />
<TextBox x:Name="txtCostCenter" Grid.Column="3" Margin="7,3,3,3" Height="23" Text="{val:ValidationBinding Path=CostCenter, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<Label Grid.Column="0" Grid.Row="2" Content="Geburtstag" />
<Label Grid.Column="0" Grid.Row="3" Content="Geschlecht" />

View File

@@ -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">
<Grid x:Name="rootGrid">
@@ -594,7 +594,6 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" x:Name="groupbox_newAbsenceTime" Grid.Row="1" Grid.ColumnSpan="2" Header="Abwesenheit hinzufügen" Style="{StaticResource ObjectEditGroupBox}">
<Grid Grid.IsSharedSizeScope="True">
<Grid.ColumnDefinitions>
@@ -614,12 +613,12 @@
<Label Grid.Column="2" Grid.Row="0">Enddatum</Label>
<Label Grid.Column="0" Grid.Row="1">Kategorie</Label>
<Label Grid.Column="2" Grid.Row="1">Erläuterung</Label>
<Button Grid.Row="2" Grid.ColumnSpan="4" HorizontalAlignment="Right" Height="25" Margin="1,10,0,3" Name="button_addAbsence" Click="button_addAbsence_Click" Style="{DynamicResource {x:Type Button}}">
<Button Grid.Row="2" Grid.ColumnSpan="4" HorizontalAlignment="Right" Margin="1,10,0,3" Name="button_addAbsence" Click="button_addAbsence_Click" Style="{DynamicResource {x:Type Button}}">
Abwesenheit hinzufügen
</Button>
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.Start, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="3" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.End, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.Start, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="3" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.End, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<uc:NullItemComboBox Name="combox_reasons" Grid.Column="1" Grid.Row="1" Height="23" Margin="3" ItemsSource="{Binding Path=AbsenceTimes.PossibleReasons}" SelectedItem="{val:ValidationBinding Path=AbsenceTimes.NewVM.Reason}">
<ComboBox.ItemContainerStyle>
@@ -669,8 +668,7 @@
<Label Grid.Column="2" Grid.Row="0">Stunden</Label>
<Label Grid.Column="0" Grid.Row="1">Art der Überstunden</Label>
<Label Grid.Column="2" Grid.Row="1">Erläuterung</Label>
<Button Grid.Column="3" Grid.Row="2" HorizontalAlignment="Right" Height="25" Margin="1,10,0,3" Name="button_addOvertime" Click="button_addOvertime_Click" Style="{DynamicResource {x:Type Button}}" Content="Überstunden hinzufügen" />
<Button Grid.Column="3" Grid.Row="2" HorizontalAlignment="Right" Margin="1,10,0,3" Name="button_addOvertime" Click="button_addOvertime_Click" Style="{DynamicResource {x:Type Button}}" Content="Überstunden hinzufügen" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=Overtimes.NewVM.Date, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<dxe:TextEdit MaskType="Numeric" Grid.Column="3" Grid.Row="0" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=Overtimes.NewVM.Betrag, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<uc:NullItemComboBox Name="combox_art" Grid.Column="1" Grid.Row="1" Height="23" Margin="3" ItemsSource="{Binding Path=PossibleAuszahlungsarten}" SelectedItem="{Binding Path=Overtimes.NewVM.Auszahlungsart}">
@@ -681,17 +679,13 @@
</ComboBox.ItemContainerStyle>
</uc:NullItemComboBox>
<TextBox Grid.Column="3" Grid.Row="1" Height="23" Margin="3" Text="{Binding Path=Overtimes.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</GroupBox>
<GroupBox x:Name="GroupBoxOvertimes" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Header="Erfasste Überstunden" Style="{StaticResource ObjectEditGroupBox}" />
</Grid>
</TabItem>
<TabItem Header="Schulbegleitender Dienst" Name="tabitem_schuldienst" Selector.Selected="tabitem_SchulDienst_Selected" />
<TabItem Header="Schulbegleitender Dienst" Name="tabitem_schuldienst" Selector.Selected="tabitem_SchulDienst_Selected" />
<TabItem Header="ownChat" Name="tabitem_chatservice" Selector.Selected="tabitem_chatservice_Selected" />
<TabItem Header="Dokumente" Name="tabitem_documents" Selector.Selected="tabitem_documents_Selected" />
</TabControl>
<Border Grid.Row="2" Grid.ColumnSpan="3" Height="40" Margin="0,10,0,0" VerticalAlignment="Stretch" Background="#FF000000">
@@ -701,16 +695,15 @@
<GradientStop Color="#33FFFFFF" Offset="1" />
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<StackPanel Grid.ColumnSpan="3" Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="5,10,0,0" HorizontalAlignment="Right">
<Button x:Name="btnSave" Content="Speichern" Margin="0,0,2,0" Command="ApplicationCommands.Save" Height="25" Style="{DynamicResource {x:Type Button}}" />
<Button x:Name="btnClose" Content="Schließen" Margin="0,0,3,0" Command="ApplicationCommands.Close" Height="25" />
<Button x:Name="BtnSave" Content="Speichern" Margin="0,0,2,0" Command="ApplicationCommands.Save" Style="{DynamicResource {x:Type Button}}" />
<Button x:Name="BtnClose" Content="Schließen" Margin="0,0,3,0" Command="ApplicationCommands.Close" Height="25" />
</StackPanel>
</Grid>
</GroupBox>
</uc:ShadowChrome>
<Popup Margin="10" Name="popup_customer" StaysOpen="False" Placement="MousePoint" Width="370" Height="250" Closed="popup_Closed" Opened="popup_Opened">
<Popup Margin="10" Name="PopupCustomer" StaysOpen="False" Placement="MousePoint" Width="370" Height="250" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:CustomerSearchView ItemSelected="CustomerSearchView_CustomerSelected" />
</Popup>
</Grid>

View File

@@ -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<CompactCustomerDC> 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)

View File

@@ -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">
<Grid x:Name="rootGrid">
<Grid.Resources>
@@ -352,6 +353,9 @@
</Border.OpacityMask>
</Border>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal" Height="Auto" Margin="5,10,0,0">
<Button security:DemandUserRight.VisibleDemands="Person_Full_Delete" IsEnabled="{Binding Path=IsNew, Converter={StaticResource BoolReverseConverter}}" Content="Endgültig löschen" Margin="0,0,2,0" Height="25" x:Name="BtnDeleteForGood" Click="BtnDeleteForGood_OnClick" />
</StackPanel>
<StackPanel Grid.ColumnSpan="3" Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="5,10,0,0" HorizontalAlignment="Right">
<Button x:Name="btnSave" Content="Speichern" Margin="0,0,2,0" Command="ApplicationCommands.Save" Height="25" />
<Button x:Name="btnClose" Content="Schließen" Margin="0,0,3,0" Command="ApplicationCommands.Close" Height="25" />

View File

@@ -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<EventArgs<PersonVM>> PersonSavedOrUpdated;
@@ -149,17 +159,13 @@ namespace BeWo.View.Detail
cb => this.Dispatch(
delegate
{
if (PersonSavedOrUpdated != null)
{
PersonSavedOrUpdated(this, new EventArgs<PersonVM>(cb));
}
PersonSavedOrUpdated?.Invoke(this, new EventArgs<PersonVM>(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

View File

@@ -1,9 +1,11 @@
<Window x:Class="BeWo.View.MessageDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BeWo.Core"
xmlns:converter="clr-namespace:BeWo.Converter"
Title="BeWoPlaner" Height="400" Width="500" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize" >
<Window.Resources>
<converter:BoolVisibilityConverter x:Key="BoolVisibilityConverter" />
</Window.Resources>
<Grid Background="{x:Null}" Margin="0,0,0,0">
<Border BorderThickness="1" Padding="5,5,5,5" BorderBrush="Black" Background="{DynamicResource LoginBackgroundColor}">
<Grid Opacity="1">
@@ -24,13 +26,27 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" ></RowDefinition>
<RowDefinition Height="Auto" ></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<TextBox Background="Transparent"
BorderThickness="0" IsReadOnly="True"
BorderThickness="0" IsReadOnly="True"
x:Name="txtMessage" TextWrapping="Wrap" Margin="3" FontSize="14"></TextBox>
<Grid Grid.Row="1" HorizontalAlignment="Center" Visibility="{Binding Path=IsInConfirmationWithPasswordMode, Converter={StaticResource BoolVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Content="Passwort:" />
<PasswordBox Grid.Row="0" Grid.Column="1" Height="24" x:Name="PasswordBox" VerticalContentAlignment="Center" Width="185" VerticalAlignment="Center" HorizontalAlignment="Stretch"></PasswordBox>
</Grid>
<!--<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="*" ></RowDefinition>
@@ -55,8 +71,9 @@
</Border>
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="70" X2="486" Y2="70" StrokeThickness="1"></Line>
<Line x:Name="linkLine" Stroke="#FFADADAD" X1="14" Y1="320" X2="486" Y2="320" StrokeThickness="1" Margin="0,30,0,-30"></Line>
<Button x:Name="CountButton" Width="120" Margin="3,3,15,10" IsDefault="True" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="ButtonBase_OnClick">Schließen</Button>
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="OkayButton" Width="120" Margin="3,3,15,10" VerticalAlignment="Bottom" Click="OkayButton_OnClick">OK</Button>
<Button x:Name="CountButton" Width="120" Margin="3,3,15,10" IsDefault="True" VerticalAlignment="Bottom" Click="ButtonBase_OnClick">Schließen</Button>
</StackPanel>
</Grid>
</Window>

View File

@@ -1,36 +1,43 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Xaml;
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Extensions;
using XamlReader = System.Windows.Markup.XamlReader;
namespace BeWo.View
{
/// <summary>
/// Interaktionslogik für ConfirmDemoDialog.xaml
/// </summary>
public partial class MessageDialog : Window
public partial class MessageDialog
{
public MessageDialog()
{
InitializeComponent();
DataContext = this;
}
private ICommand openBrowserCommand;
public ICommand OpenBrowserCommand
public MessageDialog(Action pAfterPasswordConfirmationCallBack)
{
get
{
if (openBrowserCommand == null)
{
openBrowserCommand = new OpenBrowserCommandImpl();
}
IsInConfirmationWithPasswordMode = true;
return openBrowserCommand;
}
AfterPasswordConfirmationCallBack = pAfterPasswordConfirmationCallBack;
InitializeComponent();
DataContext = this;
OkayButton.IsDefault = true;
CountButton.IsDefault = false;
}
public Action AfterPasswordConfirmationCallBack { get; set; }
public bool IsInConfirmationWithPasswordMode { get; set; }
private ICommand _OpenBrowserCommand;
public ICommand OpenBrowserCommand => _OpenBrowserCommand ?? (_OpenBrowserCommand = new OpenBrowserCommandImpl());
public class OpenBrowserCommandImpl : ICommand
{
@@ -50,31 +57,28 @@ namespace BeWo.View
}
}
public void SetXaml(String xamlCode)
public void SetXaml(string xamlCode)
{
try
{
UIElement element = XamlReader.Parse(xamlCode) as UIElement;
if (element != null)
if(XamlReader.Parse(xamlCode) is UIElement element)
{
txtMessage.Visibility = Visibility.Collapsed;
rootGrid.Children.Add(element);
}
}
catch (Exception e)
catch(Exception e)
{
//ignore
}
}
public String Message
public string Message
{
get { return txtMessage.Text; }
set { txtMessage.Text = value; }
get => txtMessage.Text;
set => txtMessage.Text = value;
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
//DialogResult = true;
@@ -94,5 +98,21 @@ namespace BeWo.View
e.CanExecute = true;
e.Handled = true;
}
private void OkayButton_OnClick(object sender, RoutedEventArgs e)
{
ServiceFacade.DoUserServiceAsync(u => u.IsUserValid(BeWoApp.UserName, PasswordBox.Password, null), result =>
{
if(result == UserValidationResult.UserValid)
{
AfterPasswordConfirmationCallBack?.Invoke();
this.Dispatch(Close);
}
else
{
MessageBox.Show("Anmeldeinformationen nicht bekannt. Bitte überprüfen Sie den Benutzernamen und das Passwort!", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}, true);
}
}
}

View File

@@ -16,43 +16,51 @@
<ControlTemplate>
<Grid>
<Border x:Name="ItemBorder" CornerRadius="5" MinHeight="30" Background="#FF000000">
<Border.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#19000000" Offset="0" />
<GradientStop Color="#26000000" Offset="1" />
</LinearGradientBrush>
</Border.OpacityMask>
<Border.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#19000000" Offset="0" />
<GradientStop Color="#26000000" Offset="1" />
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<Border x:Name="ItemContent" CornerRadius="5" MinHeight="30">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" SharedSizeGroup="CustomerDetailColumn" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" SharedSizeGroup="CustomerDetailColumn" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Source="..\..\Ressources\Icons\UserHomeMaleDisabled.png" Margin="0,0,5,0" Height="30" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="Auto" RenderTransformOrigin="0.5,0.5" Grid.Row="0" />
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<TextBlock x:Name="txtDetail1" Text="{Binding Path=SimpleDescription}" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<TextBlock x:Name="txtDetail2" Text="{Binding Path=DateOfBirthString}" Margin="6,0,0,0" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<TextBlock x:Name="txtDetail1" Text="{Binding Path=SimpleDescription}" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<TextBlock x:Name="txtDetail2" Text="{Binding Path=DateOfBirthString}" Margin="6,0,0,0" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
<TextBlock x:Name="txtDetail3" Text="{Binding Path=AddressString}" FontSize="12" Foreground="#FFA0A0A0" FontFamily="Microsoft Sans Serif" />
<TextBlock x:Name="txtDetail3" Text="{Binding Path=AddressString}" FontSize="12" Foreground="#FFA0A0A0" FontFamily="Microsoft Sans Serif" />
</StackPanel>
<TextBlock Grid.Row="0" Grid.Column="2" x:Name="txtDetail4" Text="{Binding Path=CurrentEmployeeRole}" Margin="16,0,0,0" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<TextBlock Grid.Column="2" Grid.Row="1" x:Name="txtDetail5" Text="{Binding Path=MainAttendant}" Margin="16,0,0,0" FontSize="14" Foreground="#FFA0A0A0" FontFamily="Microsoft Sans Serif" />
<!--Image x:Name="imgArchiv" Grid.Row="0" Grid.Column="2" Visibility="Collapsed" Grid.RowSpan="2" Source="..\Ressources\Icons\Archiv.png" Margin="0,0,5,0" Height="30" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="Auto" RenderTransformOrigin="0.5,0.5" /-->
<TextBlock VerticalAlignment="Center" Grid.Column="3" Grid.Row="0" Grid.RowSpan="2" Margin="0,0,3,0" Visibility="{Binding Path=IsDeleted, Converter={StaticResource ReactivationRight2VisibilityConverter}, ConverterParameter=Customer}">
<Hyperlink TargetName="_NewWindow" Foreground="#FFFFFFFF" Click="Hyperlink_Reaktivieren_Click">Reaktivieren</Hyperlink>
</TextBlock>
<TextBlock VerticalAlignment="Center" Grid.Column="4" Grid.Row="0" Grid.RowSpan="2">
<Hyperlink TargetName="_NewWindow" Foreground="#FFFFFFFF" NavigateUri="{Binding Converter={StaticResource CustomerDCPrintURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">Drucken</Hyperlink>
<TextBlock VerticalAlignment="Center" Grid.Column="4" Grid.Row="0" Grid.RowSpan="2" Margin="0,0,3,0" Visibility="{Binding Path=IsDeleted, Converter={StaticResource AnonymizationRight2VisibilityConverter}, ConverterParameter=Customer}">
<Hyperlink TargetName="_NewWindow" Foreground="#FFF97E7B" Click="Hyperlink_Anonymize_Click" Tag="{Binding}">Anonymisieren</Hyperlink>
</TextBlock>
<TextBlock VerticalAlignment="Center" Grid.Column="5" Grid.Row="0" Grid.RowSpan="2" Margin="0,0,3,0" Visibility="{Binding Path=IsDeleted, Converter={StaticResource DeleteForGoodRight2VisibilityConverter}, ConverterParameter=Customer}">
<Hyperlink TargetName="_NewWindow" Foreground="#FFF97E7B" Click="Hyperlink_Delete_For_Good_Click" Tag="{Binding}">Endgültig löschen</Hyperlink>
</TextBlock>
<TextBlock VerticalAlignment="Center" Grid.Column="3" Grid.Row="0" Grid.RowSpan="2" Margin="0,0,3,0" Visibility="{Binding Path=IsDeleted, Converter={StaticResource ReactivationRight2VisibilityConverter}, ConverterParameter=Customer}">
<Hyperlink TargetName="_NewWindow" Foreground="#FFFFFFFF" Click="Hyperlink_Reaktivieren_Click">Reaktivieren</Hyperlink>
</TextBlock>
<TextBlock VerticalAlignment="Center" Grid.Column="6" Grid.Row="0" Grid.RowSpan="2">
<Hyperlink TargetName="_NewWindow" Foreground="#FFFFFFFF" NavigateUri="{Binding Converter={StaticResource CustomerDCPrintURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">Drucken</Hyperlink>
</TextBlock>
</Grid>
</Border>

View File

@@ -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<IFilterableDC> 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();
});
});
}
}
}

View File

@@ -1,21 +1,25 @@
<localView:BeWoView x:Class="BeWo.View.Navigation.EmployeeNavigationView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View" xmlns:localNavView="clr-namespace:BeWo.View.Navigation"
<localView:BeWoView x:Class="BeWo.View.Navigation.EmployeeNavigationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:localNavView="clr-namespace:BeWo.View.Navigation"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
Loaded="OnLoaded">
<Grid>
<localNavView:MainNavigationView
x:Name="mainNavigationView"
MainGroupHeader="{markup:Translate Mitarbeiter}"
CreateNewObject="mainNavigationView_CreateNewObject"
OpenObject="mainNavigationView_OpenObject"
DeleteObject="mainNavigationView_DeleteObject"
ExcelExport="mainNavigationView_ExcelExport"
CreateNewObject="MainNavigationView_CreateNewObject"
OpenObject="MainNavigationView_OpenObject"
DeleteObject="MainNavigationView_DeleteObject"
ExcelExport="MainNavigationView_ExcelExport"
DeleteDemands="DeleteAll, EmployeeView_Delete"
CreateDemands="CreateAll, EmployeeView_Create"
ArchiveObject="mainNavigationView_ArchiveObject"
ArchiveObject="MainNavigationView_ArchiveObject"
ContentGroupStyle="{StaticResource EmployeeNavigationStyle}"
MainListItemStyle="{StaticResource SearchDetailStyle}"
MainListItemStyle="{StaticResource EmployeeDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
</Grid>
<!-- MainListItemStyle="{StaticResource SearchDetailStyle}" -->
</localView:BeWoView>

View File

@@ -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<IEnumerable<IFilterableDC>> e)
private void MainNavigationView_ExcelExport(object sender, EventArgs<IEnumerable<IFilterableDC>> 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<CompactEmployeeDC>().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<IFilterableDC>();
}
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();
});
});
}
}
}

View File

@@ -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();
});
});
}
}
}

View File

@@ -1315,7 +1315,7 @@ namespace BeWo.Data.Access
public IEnumerable<ServiceRecord> FindServiceRecordsForDays(long? costBearer2SupportConceptOid, int dayCount, long? employeeOid)
{
var minStart = DateTime.Now.AddDays(-dayCount);
var minStart = DateTime.Now.GetShortDateTime().AddDays(-dayCount);
var c = CreateCriteriaIsActive<ServiceRecord>();
if (costBearer2SupportConceptOid.HasValue)
@@ -2080,13 +2080,18 @@ namespace BeWo.Data.Access
return c.List<Customer2Person>();
}
public IList<SchedulerAppointment> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
public IList<SchedulerAppointment> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> 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<SchedulerAppointment>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
.Add(Restrictions.Or(
var criteria = CreateCriteria<SchedulerAppointment>();
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<SchedulerAppointment>();
}
public IEnumerable<SchedulerAppointment> LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long? pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments)
public IEnumerable<SchedulerAppointment> LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long? pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> 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<Employee2SchedulerAppointment>("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<SchedulerAppointment>("sa")
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
.Add(Restrictions.Or(
var criteria = CreateCriteria<SchedulerAppointment>("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<SchedulerAppointment>();
}
public IList<SchedulerAppointment> FindAppointmentsByRecurrenceId(List<string> pRecurrenceIds)
{
var criterionList = new List<ICriterion>();
pRecurrenceIds.DoForEach(id =>
{
criterionList.AddIfNotIn(Restrictions.Like(SchedulerAppointment.PropertyName_RecurrenceInfo, id, MatchMode.Anywhere));
});
var recurrenceIdOr = CreateOrCriteria(criterionList);
var c = CreateCriteria<SchedulerAppointment>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
.Add(Restrictions.IsNotNull(SchedulerAppointment.PropertyName_RecurrenceInfo))
.Add(recurrenceIdOr);
return c.List<SchedulerAppointment>();
}
}
}

View File

@@ -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<string> ExtractRecurrenceIdFromRecurrenceString(List<SchedulerAppointment> appointments)
{
var result = new List<string>();
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;
}
}
}

View File

@@ -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<CompactEmployeeDC> GetAllCompactEmployees();
}
}

View File

@@ -723,5 +723,37 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void DeleteTextbausteine(Dictionary<long, long> 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<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary<UserRightType, bool> pUserRights);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void DeleteAppointmentsInInterval(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary<UserRightType, bool> pUserRights);
}
}

View File

@@ -1177,8 +1177,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
public List<CompactEmployeeDC> GetAllChatActiveEmployeesCompact()
{
try
@@ -1404,5 +1402,30 @@ namespace BeWo.Service.ServiceImplementations
}
}
public void ReactivateEmployee(long pOid, long pVersion)
{
try
{
ServiceLogic.SetActivationType<Employee>(pOid, pVersion, ActivationTypeId.Active);
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public List<CompactEmployeeDC> GetAllCompactEmployees()
{
try
{
var employees = DAOFactory.GenericDAO.GetAll<Employee>();
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(employees);
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
}
}

View File

@@ -3835,28 +3835,21 @@ namespace BeWo.Service.ServiceImplementations
public List<VertretungsListeItemsDC> VertretungsListe(DateTime datum)
{
try
{
VertretungsListe liste = new VertretungsListe();
liste.Vertretunglist = (List<Vertretung>)DAOFactory.GenericDAO.GetAllActive<Vertretung>();
liste.AbsenceTimelist = (List<AbsenceTime>)DAOFactory.GenericDAO.GetAllActive<AbsenceTime>();
liste.Arbeitszeitliste = (List<Arbeitszeit>)DAOFactory.GenericDAO.GetAllActive<Arbeitszeit>();
liste.Employeelist = (List<Employee>)DAOFactory.GenericDAO.GetAllActive<Employee>(); ;
liste.Customerlist = (List<Customer>)DAOFactory.GenericDAO.GetAllActive<Customer>();
{
var liste = new VertretungsListe
{
Vertretunglist = (List<Vertretung>) DAOFactory.GenericDAO.GetAllActive<Vertretung>(),
AbsenceTimelist = (List<AbsenceTime>) DAOFactory.GenericDAO.GetAllActive<AbsenceTime>(),
Arbeitszeitliste = (List<Arbeitszeit>) DAOFactory.GenericDAO.GetAllActive<Arbeitszeit>(),
Employeelist = (List<Employee>) DAOFactory.GenericDAO.GetAllActive<Employee>(),
Customerlist = (List<Customer>) DAOFactory.GenericDAO.GetAllActive<Customer>()
};
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<CompactVertreterEmployeeDC> GetLastVertreter(long? klientenOid)
{
try
@@ -3972,11 +3964,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
//Token Bereich für Token
public List<CompactTokenDC> 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<Textbaustein> lOriginals = DAOFactory.GenericDAO.LoadByIDs<Textbaustein>(pOid2Version.Select(e => e.Key));
var lOriginals = DAOFactory.GenericDAO.LoadByIDs<Textbaustein>(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<Customer>(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<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary<UserRightType, bool> 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!&#x0a;&#x0a;Das Anonymisieren eines Klienten kann nicht rückgängig gemacht werden!&#x0a;";
}
if(pObjectTid == TableID.Customer && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!&#x0a;&#x0a;Das endgültige Löschen eines Klienten kann nicht rückgängig gemacht werden!&#x0a;";
}
if(pObjectTid == TableID.Person && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!&#x0a;&#x0a;Das endgültige Löschen einer Person kann nicht rückgängig gemacht werden!&#x0a;";
}
if(pObjectTid == TableID.Employee && pMessageType == MessageType.Anonymization)
{
actualTextMessage = "Achtung!&#x0a;&#x0a;Das Anonymisieren eines Mitarbeiters kann nicht rückgängig gemacht werden!&#x0a;";
}
if(pObjectTid == TableID.Employee && pMessageType == MessageType.DeleteForGood)
{
actualTextMessage = "Achtung!&#x0a;&#x0a;Das endgültige Löschen eines Mitarbeiters kann nicht rückgängig gemacht werden!&#x0a;";
}
return $"<TextBlock xmlns =\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Grid.Row=\"0\" TextAlignment=\"Center\" {fontWeight} TextWrapping=\"Wrap\" Background=\"Transparent\" FontSize=\"14\" Margin=\"3\" {foreground} HorizontalAlignment=\"Center\" Text=\"{actualTextMessage}\"/>";
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public string GetMessageFromServerForDeletingAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, Dictionary<UserRightType, bool> 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!&#x0a;&#x0a;Das Löschen von {appointments2Delete.Count} {(appointments2Delete.Count == 1 ? "Termin" : "Terminen")} bis zum {pIntervalEnd.ToShortDateString()} kann nicht rückgängig gemacht werden!&#x0a;";
return $"<TextBlock xmlns =\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Grid.Row=\"0\" TextAlignment=\"Center\" FontWeight=\"Bold\" TextWrapping=\"Wrap\" Background=\"Transparent\" FontSize=\"14\" Margin=\"3\" Foreground=\"Red\" HorizontalAlignment=\"Center\" Text=\"{actualTextMessage}\"/>";
}
#endregion
}
}

View File

@@ -824,7 +824,9 @@ namespace BeWo.Service.ServiceImplementations
try
{
foreach (var kvp in pOid2Version)
ServiceLogic.SetActivationType<SchedulerAppointment>(new Dictionary<long, long> { { kvp.Key, kvp.Value } }, ActivationTypeId.Deleted);
{
ServiceLogic.SetActivationType<SchedulerAppointment>(new Dictionary<long, long> { { 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<SchedulerAppointment>(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<long, long>(exception.Oid.Value, exception.Version.Value));
}
});
}
foreach(var kvp in pOid2Version)
{
ServiceLogic.SetActivationType<SchedulerAppointment>(new Dictionary<long, long> { { 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<SchedulerAppointment>();

View File

@@ -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
}
}

View File

@@ -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

View File

@@ -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<TextModuleDC> GetParentTextModules(List<TextModuleDC> childTextModules)
{
Parents.Clear();
_Parents.Clear();
foreach(var textModule in childTextModules)
{
GetParentTextModule(textModule);
}
return Parents;
return _Parents;
}
private static readonly List<TextModuleDC> Parents = new List<TextModuleDC>();
private static readonly List<TextModuleDC> _Parents = new List<TextModuleDC>();
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

View File

@@ -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

View File

@@ -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;
}
}