diff --git a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
index c56245c66..553c353d3 100644
--- a/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
+++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml.cs
@@ -484,7 +484,6 @@ namespace BeWo.View.Detail.Report
}
}
-
linkPdfExport.NavigateUri = new Uri(url);
}
diff --git a/BeWo/View/Detail/WohnheimView.xaml b/BeWo/View/Detail/WohnheimView.xaml
index a5d526cc1..337612310 100644
--- a/BeWo/View/Detail/WohnheimView.xaml
+++ b/BeWo/View/Detail/WohnheimView.xaml
@@ -4,8 +4,7 @@
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:uvc="clr-namespace:BeWo.View.Controls"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
- xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
- xmlns:XtraScheduler="clr-namespace:DevExpress.XtraScheduler;assembly=DevExpress.XtraScheduler.v23.2.Core"
+ xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduling"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:localSearchView="clr-namespace:BeWo.View.Search"
@@ -23,6 +22,21 @@
d:DesignHeight="800" d:DesignWidth="1400"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus" >
+
+
+
+
+
+
@@ -445,51 +459,43 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/WohnheimView.xaml.cs b/BeWo/View/Detail/WohnheimView.xaml.cs
index 6262d64fb..195e15c86 100644
--- a/BeWo/View/Detail/WohnheimView.xaml.cs
+++ b/BeWo/View/Detail/WohnheimView.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.ServiceModel;
using System.Text.RegularExpressions;
using System.Windows;
@@ -18,25 +19,30 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Translation;
+using DevExpress.Mvvm;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Editors;
using DevExpress.Xpf.Grid;
+using DevExpress.Xpf.Scheduling;
using DevExpress.XtraGrid.Views.Grid;
+using DevExpress.XtraScheduler.Native;
namespace BeWo.View.Detail
{
- public partial class WohnheimView : BeWoView
- {
- private WohnheimVM _ViewModel;
+ public partial class WohnheimView : BeWoView
+ {
+ private WohnheimVM _ViewModel;
- private bool initTabIndex;
+ private bool initTabIndex;
private List regelmaessigeDiensteVonMitarbeiternLoeschen;
private CompactTeamDC gewaehltesTeam;
public WohnheimView(WohnheimVM vm)
- {
- InitializeComponent();
- ViewModel = vm;
+ {
+ SchedulerControl.AllowInfiniteSize = true;
+
+ InitializeComponent();
+ ViewModel = vm;
vm.WohneinheitListVM.PropertyChanged += (s, e) => datagridview.BestFitColumns();
vm.WohneinheitListVM.WohneinheitBelegungListVM.PropertyChanged += (s, e) => datagridview2.BestFitColumns();
@@ -45,20 +51,20 @@ namespace BeWo.View.Detail
// HACK: Force the devexpress grid to end editing when the mouse is over savebutton
// by setting the focus to another element.
MouseMove += (s, e) =>
- {
- if ((grid_EmployeeRelation == null || !grid_EmployeeRelation.IsVisible) &&
+ {
+ if ((grid_EmployeeRelation == null || !grid_EmployeeRelation.IsVisible) &&
(grid_CustomerRelation == null || !grid_CustomerRelation.IsVisible))
- {
- return;
- }
+ {
+ return;
+ }
- var p = e.GetPosition(btnSave);
+ var p = e.GetPosition(btnSave);
- if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
- {
- root.Focus();
- }
- };
+ if (p.X >= 0 && p.X < btnSave.ActualWidth && p.Y >= 0 && p.Y < btnSave.ActualHeight)
+ {
+ root.Focus();
+ }
+ };
var b = Convert.ToBoolean(ViewModel.PflichtbesetzungEinblenden);
if (!b)
@@ -81,6 +87,7 @@ namespace BeWo.View.Detail
//popup_newBelegung.Wohneinheiten = ViewModel.WohneinheitListVM.VMList;
InitUserRights();
+ InitScheduler();
}
private void UserControl_GotFocus(object sender, RoutedEventArgs e)
@@ -91,59 +98,61 @@ namespace BeWo.View.Detail
}
}
- public override bool IsDirty
- {
- get { return ViewModel != null && ViewModel.IsDirty; }
- }
+ public override bool IsDirty
+ {
+ get { return ViewModel != null && ViewModel.IsDirty; }
+ }
- public override string Title
- {
- get { return Translator.Translate("Wohnprojekt"); }
- }
+ public override string Title
+ {
+ get { return Translator.Translate("Wohnprojekt"); }
+ }
- internal override DependencyObject ValidationOnSaveRootElement
- {
- get { return grid_details; }
- }
+ internal override DependencyObject ValidationOnSaveRootElement
+ {
+ get { return grid_details; }
+ }
- internal WohnheimVM ViewModel
- {
- get { return _ViewModel; }
+ internal WohnheimVM ViewModel
+ {
+ get { return _ViewModel; }
- set
- {
+ set
+ {
_ViewModel = value;
DataContext = value;
- }
- }
+ }
+ }
- protected override UserRightType[] GetSaveDemands()
- {
- return ViewModel.IsNew ? new[] {UserRightType.CreateAll, UserRightType.WohnheimView_Create} : new[] {UserRightType.EditAll, UserRightType.WohnheimView_Edit};
- }
+ protected override UserRightType[] GetSaveDemands()
+ {
+ return ViewModel.IsNew ? new[] { UserRightType.CreateAll, UserRightType.WohnheimView_Create } : new[] { UserRightType.EditAll, UserRightType.WohnheimView_Edit };
+ }
- protected override void Save()
- {
- var lDataContract = ViewModel.CommitToDataContract();
+ protected override void Save()
+ {
+ var lDataContract = ViewModel.CommitToDataContract();
//Abfrage if Name is null or empty -> Message Bitte den Namen eingeben
- if(textbox_first.Text.Equals("")){
- textbox_first.Focus();
+ if (textbox_first.Text.Equals(""))
+ {
+ textbox_first.Focus();
MessageBox.Show("Bitte dem Wohnprojekt einen Namen geben.");
}
- else{
- //sonst
- try
- {
- if (ViewModel.IsNew)
- {
- IsDoneWithInsertOrUpdate = false;
+ else
+ {
+ //sonst
+ try
+ {
+ if (ViewModel.IsNew)
+ {
+ IsDoneWithInsertOrUpdate = false;
ServiceFacade.DoCustomerServiceAsync(s => s.InsertNewWohnheim(lDataContract), ReloadViewModel);
- }
- else
- {
- IsDoneWithInsertOrUpdate = false;
+ }
+ else
+ {
+ IsDoneWithInsertOrUpdate = false;
ServiceFacade.DoCustomerServiceAsync(s => s.UpdateWohnheim(lDataContract, regelmaessigeDiensteVonMitarbeiternLoeschen), ReloadViewModel);
}
//if (regelmaessigeDiensteVonMitarbeiternLoeschen.Count > 0 && ViewModel.DataContract.WohnheimOid != null)
@@ -151,17 +160,17 @@ namespace BeWo.View.Detail
// ServiceFacade.DoOperationsServiceSync(s => s.DeleteRegelmaessigeDiensteOfRemovedEmployee(regelmaessigeDiensteVonMitarbeiternLoeschen, (long)ViewModel.DataContract.WohnheimOid));
//}
- Cache.GetInstance().ClearEmployees();
- BeWoApp.MainControl.ResetView(UIContext.Wohnheim);
- }
- catch (FaultException)
- {
- MessageBox.Show(
- "Dieser Datensatz wurde in der Zwischenzeit von " + Translator.Translate("einem anderen Benutzer") + " geändert. Klicken Sie Ok um den Datensatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
- ReloadViewModel(lDataContract.WohnheimOid.Value);
- }
+ Cache.GetInstance().ClearEmployees();
+ BeWoApp.MainControl.ResetView(UIContext.Wohnheim);
+ }
+ catch (FaultException)
+ {
+ MessageBox.Show(
+ "Dieser Datensatz wurde in der Zwischenzeit von " + Translator.Translate("einem anderen Benutzer") + " geändert. Klicken Sie Ok um den Datensatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
+ ReloadViewModel(lDataContract.WohnheimOid.Value);
+ }
}
- }
+ }
private void InitUserRights()
{
@@ -177,30 +186,49 @@ namespace BeWo.View.Detail
chkArchiviert.Visibility = Visibility.Visible;
}
}
+ private void InitScheduler()
+ {
+ //timelineView.TimeScales.Clear();
+ //timelineView.TimeScales.Add(new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 });
+ //timelineView.TimeScales.Add(new TimeScale(TimeScaleUnit.Quarter) { MinWidth = 0 });
+ //timelineView.TimeScales.Add(new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 });
+ //timelineView.TimeScales.Add(new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 });
+ //timelineView.TimeScales.Add(new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 });
- private void ReloadViewModel(long pOid)
- {
- VMFactory.CreateWohnheimVMAsync(pOid, cb => this.Dispatch(delegate { ViewModel = cb; }));
-
- IsDoneWithInsertOrUpdate = true;
- }
+ //timelineViewYear.TimeScales.Clear();
+ //timelineViewYear.TimeScales.Add(new TimeScale(TimeScaleUnit.Year) { MinWidth = 0 });
+ //timelineViewYear.TimeScales.Add(new TimeScale(TimeScaleUnit.Month) { MinWidth = 0 });
+ //timelineViewYear.TimeScales.Add(new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 });
- private void button_addMitarbeiterRelation_Klick(object sender, RoutedEventArgs e)
- {
+ //timelineViewWeek.TimeScales.Clear();
+ //timelineViewWeek.TimeScales.Add(new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 });
+
+ //timelineViewMonth.TimeScales.Clear();
+ //timelineViewMonth.TimeScales.Add(new TimeScale(TimeScaleUnit.Week) { MinWidth = 0 });
+ //timelineViewMonth.TimeScales.Add(new TimeScale(TimeScaleUnit.Day) { MinWidth = 0 });
+ }
+
+ private void ReloadViewModel(long pOid)
+ {
+ VMFactory.CreateWohnheimVMAsync(pOid, cb => this.Dispatch(delegate { ViewModel = cb; }));
+
+ IsDoneWithInsertOrUpdate = true;
+ }
+
+ private void button_addMitarbeiterRelation_Klick(object sender, RoutedEventArgs e)
+ {
popup_newEmployeeRel.IsOpen = true;
- }
-
+ }
private void button_addKlientRelation_Klick(object sender, RoutedEventArgs e)
{
popup_newKlientRel.IsOpen = true;
}
-
private void button_addEmployeeRelation_Click(object sender, RoutedEventArgs e)
{
if (ValidationTrigger.Validate(groupbox_newEmployeeRel))
{
-
+
bool contains = false;
foreach (var item in ViewModel.WohnheimEmployeeRelations.VMList)
{
@@ -241,7 +269,7 @@ namespace BeWo.View.Detail
continue;
ViewModel.WohnheimEmployeeRelations.NewVM.Employee = emp;
- ViewModel.WohnheimEmployeeRelations.NewVM.Notice= notice;
+ ViewModel.WohnheimEmployeeRelations.NewVM.Notice = notice;
ViewModel.WohnheimEmployeeRelations.AddNewVMToList();
}
@@ -251,7 +279,6 @@ namespace BeWo.View.Detail
{
popup_newTeamRel.IsOpen = true;
}
-
private void button_cancelEmployeeRelation_Click(object sender, RoutedEventArgs e)
{
popup_newEmployeeRel.IsOpen = false;
@@ -268,13 +295,11 @@ namespace BeWo.View.Detail
ViewModel.WohnheimEmployeeRelations.NewVM.Employee = e.Data;
popup_employee.Focus();
}
-
private void popupedit_EmployeeRelations_PopUpClick(object sender, RoutedEventArgs e)
{
employeesearchview.ItemSelected += Employeesearchview_EnvironmentEmployeeSelected;
popup_employee.IsOpen = true;
}
-
private void Teamsearchview_EnvironmentTeamSelected(object sender, EventArgs e)
{
popup_team.IsOpen = false;
@@ -291,7 +316,6 @@ namespace BeWo.View.Detail
teamsearchview.ItemSelected += Teamsearchview_EnvironmentTeamSelected;
popup_team.IsOpen = true;
}
-
private void Popupedit_EmployeeRelations_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
@@ -328,7 +352,6 @@ namespace BeWo.View.Detail
BeWoWpfUtils.RefreshDXGrid(grid_EmployeeRelation);
}
-
private void button_addKlientRelation_Click(object sender, RoutedEventArgs e)
{
bool contains = false;
@@ -346,12 +369,10 @@ namespace BeWo.View.Detail
popup_newKlientRel.IsOpen = false;
ViewModel.WohnheimCustomerRelations.AddNewVMToList();
}
-
private void button_cancelKlientRelation_Click(object sender, RoutedEventArgs e)
{
popup_newKlientRel.IsOpen = false;
}
-
private void Klientsearchview_EnvironmentKlientSelected(object sender, EventArgs e)
{
popup_klient.IsOpen = false;
@@ -359,29 +380,25 @@ namespace BeWo.View.Detail
ViewModel.WohnheimCustomerRelations.NewVM.Customer = e.Data;
popup_klient.Focus();
}
-
private void popupedit_KlientRelations_PopUpClick(object sender, RoutedEventArgs e)
{
klientsearchview.ItemSelected += Klientsearchview_EnvironmentKlientSelected;
popup_klient.IsOpen = true;
}
-
private void Popupedit_KlientRelations_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
- if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit) sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.WohnheimView_View))
+ if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.WohnheimView_View))
{
return;
}
CreateModalViewWindow(ViewModel.WohnheimCustomerRelations.NewVM.Customer);
}
-
public void Button_RemoveCustomerRelation_Click(object sender, RoutedEventArgs e)
{
ViewModel.WohnheimCustomerRelations.VMList.Remove(grid_CustomerRelation.GetCurrentValue());
BeWoWpfUtils.RefreshDXGrid(grid_CustomerRelation);
}
-
private void TableViewCustomer_OnRowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
var tableView = (TableView)sender;
@@ -394,11 +411,10 @@ namespace BeWo.View.Detail
CreateModalViewWindow((selectedVM).Customer);
}
-
private void TableViewEmployee_OnRowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
- var tableView = (TableView) sender;
- var selectedVM = (WohnheimEmployeeRelationVM) tableView.Grid.GetRow(e.HitInfo.RowHandle);
+ var tableView = (TableView)sender;
+ var selectedVM = (WohnheimEmployeeRelationVM)tableView.Grid.GetRow(e.HitInfo.RowHandle);
if (selectedVM == null)
{
@@ -407,7 +423,6 @@ namespace BeWo.View.Detail
CreateModalViewWindow((selectedVM).Employee);
}
-
private void CreateModalViewWindow(T pDC) where T : IDataContract
{
if (pDC == null)
@@ -417,13 +432,13 @@ namespace BeWo.View.Detail
if (pDCType == typeof(CompactEmployeeDC))
{
- VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
- cb => this.Dispatch(
- () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
- () => BeWoUtils.UpdateAllViews((pDC as CompactEmployeeDC))))));
+ VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
+ cb => this.Dispatch(
+ () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
+ () => BeWoUtils.UpdateAllViews((pDC as CompactEmployeeDC))))));
}
- if (pDCType == typeof (CompactCustomerDC))
+ if (pDCType == typeof(CompactCustomerDC))
{
VMFactory.CreateCustomerVMAsync((pDC as CompactCustomerDC).CustomerOid,
cb => this.Dispatch(
@@ -431,7 +446,6 @@ namespace BeWo.View.Detail
() => BeWoUtils.UpdateAllViews((pDC as CompactCustomerDC))))));
}
}
-
private void chkStatuszeile_Checked(object sender, RoutedEventArgs e)
{
//textedit_pflichtStart.IsEnabled = true;
@@ -446,13 +460,12 @@ namespace BeWo.View.Detail
//textedit_pflichtStart.Opacity = 50;
//textedit_pflichtEnde.Opacity = 50;
}
-
private void chkStatuszeile_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
var checkbox = sender as CheckEdit;
if ((bool)checkbox.EditValue == false)
{
- textedit_pflichtStart.IsEnabled = false;
+ textedit_pflichtStart.IsEnabled = false;
textedit_pflichtEnde.IsEnabled = false;
textedit_pflichtStart.Opacity = 50;
textedit_pflichtEnde.Opacity = 50;
@@ -478,7 +491,6 @@ namespace BeWo.View.Detail
popup_newWohneinheit.IsOpen = true;
}
-
private void Button_NewBelegung_Click(object sender, RoutedEventArgs e)
{
if (!ViewModel.PermissionWohneinheitBelegungCreate)
@@ -497,7 +509,6 @@ namespace BeWo.View.Detail
popup_newBelegung.IsOpen = true;
}
-
private void btn_delete_Click(object sender, RoutedEventArgs e)
{
if (!ViewModel.PermissionWohneinheitDelete)
@@ -512,7 +523,6 @@ namespace BeWo.View.Detail
e.Handled = true;
}
-
private void btn_belegung_delete_Click(object sender, RoutedEventArgs e)
{
if (!ViewModel.PermissionWohneinheitBelegungDelete)
@@ -533,8 +543,7 @@ namespace BeWo.View.Detail
e.Handled = true;
}
-
- private void datagridview_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
+ private void datagridview_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
if (!ViewModel.PermissionWohneinheitEdit)
return;
@@ -549,7 +558,6 @@ namespace BeWo.View.Detail
popup_newWohneinheit.IsOpen = true;
}
-
private void datagridview2_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
{
if (!ViewModel.PermissionWohneinheitBelegungEdit)
@@ -566,9 +574,71 @@ namespace BeWo.View.Detail
popup_newBelegung.IsOpen = true;
}
- private void SchedulerControl_PopupMenuShowing(object sender, DevExpress.Xpf.Scheduler.SchedulerMenuEventArgs e)
+ void scheduler_ActiveViewChanged(object sender, ValueChangedEventArgs e)
{
- e.Handled = true;
+ if (e.NewValue == null) return;
+ var selectionStart = scheduler_buchungsplan.SelectedInterval.Start;
+ var dates = new List() { selectionStart.Date };
+ if (!CoerceDateNavigatorSelectedDates(dates))
+ return;
+
+ var min = dates.Min();
+ scheduler_buchungsplan.Start = min;
+ var intervalDuration = dates.Max().AddDays(1) - min;
+
+ var timeline = (TimelineView)e.NewValue;
+ timeline.IntervalDuration = intervalDuration;
+ timeline.ViewportStart = selectionStart;
+ timeline.Zoom = intervalDuration;
+
+ scheduler_buchungsplan.SelectedInterval = new DateTimeRange(selectionStart, TimeSpan.Zero);
+ }
+ bool CoerceDateNavigatorSelectedDates(IList dates)
+ {
+ if (dates.Count == 0) return false;
+ var start = dates.Min();
+ var end = dates.Max();
+ if (timelineViewWeek.IsActive)
+ {
+ var actualStart = DateTimeHelper.GetStartOfWeekUI(start, scheduler_buchungsplan.FirstDayOfWeek);
+ var actualEnd = actualStart.AddDays(7);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineViewMonth.IsActive)
+ {
+ var actualStart = new DateTime(start.Year, start.Month, 1);
+ var actualEnd = actualStart.AddMonths(1);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ if (timelineViewYear.IsActive)
+ {
+ var actualStart = new DateTime(start.Year, 1, 1);
+ var actualEnd = actualStart.AddYears(1);
+ dates.Clear();
+ while (actualStart < actualEnd)
+ {
+ dates.Add(actualStart);
+ actualStart = actualStart.AddDays(1);
+ }
+ return true;
+ }
+ return false;
+ }
+ private void scheduler_buchungsplan_PopupMenuShowing(object sender, DevExpress.Xpf.Scheduling.PopupMenuShowingEventArgs e)
+ {
+ e.Cancel = true;
}
}
}
\ No newline at end of file
diff --git a/TranslationUnitTest/EnumTranslationTest.cs b/TranslationUnitTest/EnumTranslationTest.cs
index 742d60131..04cc2deda 100644
--- a/TranslationUnitTest/EnumTranslationTest.cs
+++ b/TranslationUnitTest/EnumTranslationTest.cs
@@ -264,9 +264,9 @@ UserRightType.Signature_ProvideMonthlySignatureByProxy,
{
foreach (UserRightType item in Enum.GetValues(typeof(UserRightType)))
{
- var has_base_version = UserRightHelper.GetRightVersion(item) == UserRightHelper.BASE_VERSION;
+ var has_special_version = UserRightHelper.GetRightVersion(item) != UserRightHelper.BASE_VERSION;
- if (!has_base_version)
+ if (has_special_version)
continue;
var is_base_version = UserRightTypesVersion1dot0.Contains(item);