Abwesentheitstabelle
- Design überarbeitet - GoTo DateTimePicker
This commit is contained in:
@@ -47,30 +47,15 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!--Erste Zeile-->
|
||||
<Grid Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton Grid.Column="0" Grid.Row="0" GroupName="Typ" Content="Mitarbeiter" IsChecked="True" Margin="3"/>
|
||||
<Label Grid.Column="2" Content="Anzahl der angezeigten Tage"/>
|
||||
<dxe:SpinEdit x:Name="_SpinEdit" Grid.Column="3" Grid.Row="0" Text="31" AllowNullInput="False" Height="23" Width="50" IsFloatValue="False" EditValueChanged="SpinEdit_EditValueChanged"/>
|
||||
</Grid>
|
||||
<!--Zweite Zeile-->
|
||||
<Grid Grid.Column="0" Grid.Row="1">
|
||||
<!--Erste Zeile Links-->
|
||||
<Grid Grid.Column="0" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -81,33 +66,56 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Abwesenheitskategorie" Margin="3" />
|
||||
<dxe:ComboBoxEdit x:Name="FilterAbwesenheit" Grid.Column="1" Grid.Row="0" Margin="3" DisplayMember="Description">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Abwesenheitskategorie" Margin="3,3,0,3" />
|
||||
<dxe:ComboBoxEdit x:Name="FilterAbwesenheit" Grid.Column="1" Grid.Row="0" Margin="0,3,3,3" DisplayMember="Description">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
|
||||
<Label Grid.Column="2" Grid.Row="0" Content="Beschäftigungsart" Margin="3,3,0,3"/>
|
||||
<dxe:ComboBoxEdit x:Name="FilterBeschaftigungsart" Grid.Column="3" Grid.Row="0" Margin="0,3,3,3" DisplayMember="Name">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
<Label Grid.Column="2" Grid.Row="0" Content="Beschäftigungsart" Margin="3"/>
|
||||
|
||||
<dxe:ComboBoxEdit x:Name="FilterBeschaftigungsart" Grid.Column="3" Grid.Row="0" Margin="3" DisplayMember="Name">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
</Grid>
|
||||
<!--Dritte Zeile-->
|
||||
<Grid Grid.Column="0" Grid.Row="2">
|
||||
<!--Erste Zeile Rechts-->
|
||||
<Grid Grid.Column="2" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="3" Content="Anzahl der angezeigten Tage"/>
|
||||
<dxe:SpinEdit x:Name="_SpinEdit" Grid.Column="4" Grid.Row="0" AllowNullInput="False" Height="23" Width="50" IsFloatValue="False" EditValueChanged="SpinEdit_EditValueChanged"/>
|
||||
</Grid>
|
||||
<!--Zweite Zeile Links-->
|
||||
<Grid Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left">
|
||||
<Button Grid.Column="0" Grid.Row="0" Content="Erstellen" Margin="3" MinWidth="100" Click="Button_Click"/>
|
||||
</Grid>
|
||||
<!--Zweite Zeile Rechts-->
|
||||
<Grid Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Datum" Margin="3"/>
|
||||
<dxe:DateEdit x:Name="_DateTimePicker" Grid.Column="1" Grid.Row="0" Margin="3,3,0,3" EditValueChanged="DateEdit_EditValueChanged" />
|
||||
</Grid>
|
||||
|
||||
<dxsch:SchedulerControl dx:ThemeManager.ThemeName="Office2010Black" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" x:Name="_SchedulerControl" ActiveViewType="Timeline" Visibility="Collapsed" GroupType="Resource" IsManipulationEnabled="True" AllowDrop="False" IsTabStop="False"
|
||||
<dxsch:SchedulerControl dx:ThemeManager.ThemeName="Office2010Black" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" x:Name="_SchedulerControl" ActiveViewType="Timeline" Visibility="Collapsed" GroupType="Resource" IsManipulationEnabled="True" AllowDrop="False" IsTabStop="False"
|
||||
EditAppointmentFormShowing="SchedularControl_EditAppointmentFormShowing" EditRecurrentAppointmentFormShowing="SchedularControl_EditRecurrentAppointmentFormShowing" FormCustomizationUsingMVVMLocal="False" AppointmentViewInfoCustomizing="SchedulerControl_AppointmentViewInfoCustomizing">
|
||||
<!--<dxsch:SchedulerControl.Storage>
|
||||
<dxsch:SchedulerStorage>
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace BeWo.View.Detail.Report
|
||||
/// </summary>
|
||||
public partial class AbwesenheitstabelleView : BeWoView
|
||||
{
|
||||
private SchedulerStorage _SchedularStorage;
|
||||
private SchedulerStorage _SchedulerStorage;
|
||||
private IAppointmentLabelStorage _LabelStorage;
|
||||
private ResourceStorage _ResourceStorage;
|
||||
private AppointmentStorage _AppointmentStorage;
|
||||
@@ -52,14 +52,14 @@ namespace BeWo.View.Detail.Report
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_SchedularStorage = _SchedulerControl.Storage;
|
||||
_SchedulerStorage = _SchedulerControl.Storage;
|
||||
_LabelStorage = _SchedulerControl.Storage.AppointmentStorage.Labels;
|
||||
_ResourceStorage = _SchedulerControl.Storage.ResourceStorage;
|
||||
_AppointmentStorage = _SchedulerControl.Storage.AppointmentStorage;
|
||||
|
||||
_AppointmentStorage.CustomFieldMappings.Add(new SchedulerCustomFieldMapping("AbsenceTime", "AbsenceTime"));
|
||||
_SchedularStorage.AppointmentsInserted += _SchedularStorage_AppointmentsInserted;
|
||||
_SchedularStorage.AppointmentInserting += _SchedularStorage_AppointmentInserting;
|
||||
_SchedulerStorage.AppointmentsInserted += _SchedularStorage_AppointmentsInserted;
|
||||
_SchedulerStorage.AppointmentInserting += _SchedularStorage_AppointmentInserting;
|
||||
_SchedulerControl.TimelineView.VerticalResourceHeaderStyle = (Style)this.FindResource("VerticalResourceHeaderStyle");
|
||||
|
||||
IMouseHandlerService oldMouseHandler = (IMouseHandlerService)_SchedulerControl.GetService(typeof(IMouseHandlerService));
|
||||
@@ -83,6 +83,10 @@ namespace BeWo.View.Detail.Report
|
||||
{
|
||||
FilterBeschaftigungsart.Items.Add(item);
|
||||
}
|
||||
|
||||
var td = DateTime.Today;
|
||||
_DateTimePicker.DateTime = td.AddDays(1 - td.Day);
|
||||
_SpinEdit.Text = DateTime.DaysInMonth(td.Year, td.Month).ToString();
|
||||
}
|
||||
|
||||
private void _SchedularStorage_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e)
|
||||
@@ -129,6 +133,16 @@ namespace BeWo.View.Detail.Report
|
||||
_SchedulerControl.TimelineView.IntervalCount = count;
|
||||
}
|
||||
|
||||
private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
|
||||
{
|
||||
var dp = _DateTimePicker.DateTime;
|
||||
|
||||
_DateTimePicker.DateTime = dp.AddDays(1 - dp.Day);
|
||||
_SpinEdit.Value = DateTime.DaysInMonth(dp.Year, dp.Month);
|
||||
|
||||
_SchedulerControl.Start = _DateTimePicker.DateTime;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
_AbsenceReasonDCs = ServiceFacade.DoOperationsServiceSync(x => x
|
||||
@@ -147,10 +161,9 @@ namespace BeWo.View.Detail.Report
|
||||
.ToList()
|
||||
.OrderBy(x => x.LastNameFirstName);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
_SchedularStorage.BeginUpdate();
|
||||
_SchedulerStorage.BeginUpdate();
|
||||
|
||||
_LabelStorage.Clear();
|
||||
foreach (var reason in _AbsenceReasonDCs)
|
||||
@@ -166,7 +179,7 @@ namespace BeWo.View.Detail.Report
|
||||
var listEmps = FilterBeschaftigungsart.SelectedItems.Count == 0 ? empWithAbsence : empWithAbsence.Where(x => x.Contracts.Exists(y => FilterBeschaftigungsart.SelectedItems.Contains(y.EmploymentType)));
|
||||
foreach (var employee in listEmps)
|
||||
{
|
||||
var resource = _SchedularStorage.CreateResource(employee.EmployeeOid.Value.ToString());
|
||||
var resource = _SchedulerStorage.CreateResource(employee.EmployeeOid.Value.ToString());
|
||||
|
||||
resource.Caption = employee.LastNameFirstName;
|
||||
|
||||
@@ -179,7 +192,7 @@ namespace BeWo.View.Detail.Report
|
||||
|
||||
foreach (var absenceTime in listAbs)
|
||||
{
|
||||
var appointment = _SchedularStorage.CreateAppointment(AppointmentType.Normal);
|
||||
var appointment = _SchedulerStorage.CreateAppointment(AppointmentType.Normal);
|
||||
|
||||
SchedulerHelper.OverrideAWithB(appointment, absenceTime);
|
||||
|
||||
@@ -188,7 +201,7 @@ namespace BeWo.View.Detail.Report
|
||||
}
|
||||
finally
|
||||
{
|
||||
_SchedularStorage.EndUpdate();
|
||||
_SchedulerStorage.EndUpdate();
|
||||
_SchedulerControl.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,10 +763,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Reference in New Issue
Block a user