DevExpress Designer Nullpointer Exception wenn andere TimeScales verwendet werden
This commit is contained in:
@@ -484,7 +484,6 @@ namespace BeWo.View.Detail.Report
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
linkPdfExport.NavigateUri = new Uri(url);
|
||||
}
|
||||
|
||||
|
||||
@@ -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" >
|
||||
<localView:BeWoView.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="timelineView.Style" TargetType="dxsch:TimelineView">
|
||||
<Setter Property="ShowInCommandBar" Value="False"/>
|
||||
<Setter Property="AppointmentMinHeight" Value="36"/>
|
||||
<Setter Property="AppointmentMinWidth" Value="40"/>
|
||||
<Setter Property="ResourceMinHeight" Value="44"/>
|
||||
<Setter Property="ResourceMaxHeight" Value="116"/>
|
||||
<Setter Property="SnapToCellsMode" Value="Never"/>
|
||||
</Style>
|
||||
<Style x:Key="radiobutton" TargetType="{x:Type RadioButton}">
|
||||
<Setter Property="Margin" Value="3"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</localView:BeWoView.Resources>
|
||||
<Grid x:Name="rootGrid">
|
||||
<uc:ShadowChrome>
|
||||
<GroupBox Style="{StaticResource MainContentGroupBoxStyle}">
|
||||
@@ -445,51 +459,43 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<dxsch:SchedulerControl dx:ThemeManager.ThemeName="Office2010Black" GroupType="Resource" PopupMenuShowing="SchedulerControl_PopupMenuShowing" >
|
||||
<dxsch:SchedulerControl.DefaultMenuCustomizations>
|
||||
<dxb:RemoveBarItemAndLinkAction ItemName="NewAllDayEvent" />
|
||||
<dxb:RemoveBarItemAndLinkAction ItemName="NewRecurringAppointment" />
|
||||
<dxb:RemoveBarItemAndLinkAction ItemName="NewRecurringEvent" />
|
||||
</dxsch:SchedulerControl.DefaultMenuCustomizations>
|
||||
<dxsch:SchedulerControl.OptionsCustomization>
|
||||
<dxsch:OptionsCustomization AllowAppointmentCopy="None" AllowAppointmentCreate="All" AllowAppointmentDelete="None" AllowAppointmentDrag="None"
|
||||
AllowAppointmentDragBetweenResources="None" AllowAppointmentEdit="All" AllowAppointmentResize="None" AllowInplaceEditor="None"
|
||||
AllowAppointmentMultiSelect="False" />
|
||||
</dxsch:SchedulerControl.OptionsCustomization>
|
||||
<dxsch:SchedulerControl.OptionsView>
|
||||
<dxsch:OptionsView />
|
||||
</dxsch:SchedulerControl.OptionsView>
|
||||
<dxsch:SchedulerControl.OptionsBehavior>
|
||||
<dxsch:OptionsBehavior />
|
||||
</dxsch:SchedulerControl.OptionsBehavior>
|
||||
<dxsch:SchedulerControl.DayView>
|
||||
<dxsch:DayView Enabled="false" />
|
||||
</dxsch:SchedulerControl.DayView>
|
||||
<dxsch:SchedulerControl.FullWeekView>
|
||||
<dxsch:FullWeekView Enabled="false" />
|
||||
</dxsch:SchedulerControl.FullWeekView>
|
||||
<dxsch:SchedulerControl.MonthView>
|
||||
<dxsch:MonthView Enabled="False" />
|
||||
</dxsch:SchedulerControl.MonthView>
|
||||
<dxsch:SchedulerControl.WeekView>
|
||||
<dxsch:WeekView Enabled="false" />
|
||||
</dxsch:SchedulerControl.WeekView>
|
||||
<dxsch:SchedulerControl.WorkWeekView>
|
||||
<dxsch:WorkWeekView Enabled="false" />
|
||||
</dxsch:SchedulerControl.WorkWeekView>
|
||||
<dxsch:SchedulerControl.TimelineView>
|
||||
<dxsch:TimelineView ResourcesPerPage="10" IntervalCount="31" TimelineScrollBarVisibility="Auto" AppointmentToolTipVisibility="Never">
|
||||
<dxsch:TimelineView.Scales>
|
||||
<XtraScheduler:TimeScaleYear />
|
||||
<XtraScheduler:TimeScaleMonth />
|
||||
<XtraScheduler:TimeScaleDay />
|
||||
</dxsch:TimelineView.Scales>
|
||||
<dxsch:TimelineView.AppointmentDisplayOptions>
|
||||
<dxsch:SchedulerTimelineViewAppointmentDisplayOptions SnapToCellsMode="Auto" EndTimeVisibility="Never" StartTimeVisibility="Never" />
|
||||
</dxsch:TimelineView.AppointmentDisplayOptions>
|
||||
</dxsch:TimelineView>
|
||||
</dxsch:SchedulerControl.TimelineView>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
|
||||
<!--<RadioButton GroupName="schedular_time" Content="Unbegrenzt" IsEnabled="True" Click="{DXEvent '@e(timelineView).IsActive = true'}" Style="{StaticResource radiobutton}"/>-->
|
||||
<RadioButton GroupName="schedular_time" Content="Jahr" Click="{DXEvent '@e(timelineViewYear).IsActive = true'}" Style="{StaticResource radiobutton}"/>
|
||||
<RadioButton GroupName="schedular_time" Content="Monat" Click="{DXEvent '@e(timelineViewMonth).IsActive = true'}" Style="{StaticResource radiobutton}"/>
|
||||
<RadioButton GroupName="schedular_time" Content="Wochen" Click="{DXEvent '@e(timelineViewWeek).IsActive = true'}" Style="{StaticResource radiobutton}"/>
|
||||
</StackPanel>
|
||||
<dxsch:SchedulerControl x:Name="scheduler_buchungsplan"
|
||||
Grid.Row="1"
|
||||
Width="auto"
|
||||
Height="auto"
|
||||
dx:ThemeManager.ThemeName="Office2010Black"
|
||||
GroupType="Resource"
|
||||
PopupMenuShowing="scheduler_buchungsplan_PopupMenuShowing"
|
||||
ActiveViewChanged="scheduler_ActiveViewChanged"
|
||||
ActiveViewIndex="0" FirstDayOfWeek="Monday"
|
||||
>
|
||||
<!--<dxsch:TimelineView x:Name="timelineView" ViewMode="Standard" Style="{StaticResource timelineView.Style}"/>-->
|
||||
<dxsch:TimelineView x:Name="timelineViewYear" ViewMode="Standard" Style="{StaticResource timelineView.Style}">
|
||||
<dxsch:TimelineView.TimeScales>
|
||||
<dxsch:TimeScale ScaleUnit="Year" UnitCount="1"/>
|
||||
<dxsch:TimeScale ScaleUnit="Month" UnitCount="1" MinWidth="60"/>
|
||||
<dxsch:TimeScale ScaleUnit="Day" UnitCount="1" MinWidth="15"/>
|
||||
</dxsch:TimelineView.TimeScales>
|
||||
</dxsch:TimelineView>
|
||||
<dxsch:TimelineView x:Name="timelineViewWeek" ViewMode="Standard" Style="{StaticResource timelineView.Style}" AppointmentMinWidth="1000">
|
||||
<dxsch:TimelineView.TimeScales>
|
||||
<dxsch:TimeScale ScaleUnit="Day" UnitCount="1"/>
|
||||
</dxsch:TimelineView.TimeScales>
|
||||
</dxsch:TimelineView>
|
||||
<dxsch:TimelineView x:Name="timelineViewMonth" ViewMode="Standard" Style="{StaticResource timelineView.Style}" AppointmentMinWidth="1000">
|
||||
<dxsch:TimelineView.TimeScales>
|
||||
<dxsch:TimeScale ScaleUnit="Day" UnitCount="1"/>
|
||||
</dxsch:TimelineView.TimeScales>
|
||||
</dxsch:TimelineView>
|
||||
<dxsch:TimelineView IsEnabled="False"/>
|
||||
</dxsch:SchedulerControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -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<CompactEmployeeDC> 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<BeWoFault>)
|
||||
{
|
||||
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<BeWoFault>)
|
||||
{
|
||||
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<CompactTeamDC> 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<CompactCustomerDC> 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<WohnheimCustomerRelationVM>());
|
||||
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>(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<EmployeeVM, EmployeeDC, WohnheimView>(cb, this, () => this.Dispatch(
|
||||
() => BeWoUtils.UpdateAllViews((pDC as CompactEmployeeDC))))));
|
||||
VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
|
||||
cb => this.Dispatch(
|
||||
() => BeWoUtils.OpenModalViewWindow<EmployeeVM, EmployeeDC, WohnheimView>(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<ViewBase> e)
|
||||
{
|
||||
e.Handled = true;
|
||||
if (e.NewValue == null) return;
|
||||
var selectionStart = scheduler_buchungsplan.SelectedInterval.Start;
|
||||
var dates = new List<DateTime>() { 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<DateTime> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user