Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

This commit is contained in:
Waldi
2017-04-20 13:00:54 +02:00
21 changed files with 257 additions and 224 deletions

View File

@@ -1,15 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>

View File

@@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
@@ -82,34 +74,25 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/multidex-instrumentation/1.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/multidex/1.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/multi-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

View File

@@ -964,10 +964,10 @@
<ToggleButton Grid.Column="1" Style="{StaticResource VerticalExpanderLookAlikeToggleBotton}" Width="23" Height="23" Margin="3" Click="LeftExpanderClick" x:Name="LeftExpanderButton" />
<dxsch:SchedulerControl Grid.Column="2" x:Name="Scheduler" dx:ThemeManager.ThemeName="Office2010Black"
GroupType="None" VerticalAlignment="Stretch"
EditAppointmentFormShowing="scheduler_EditAppointmentFormShowing"
EditAppointmentFormShowing="Scheduler_EditAppointmentFormShowing"
EditRecurrentAppointmentFormShowing="SchedulerControl_EditRecurrentAppointmentFormShowing"
PopupMenuShowing="scheduler_PopupMenuShowing" InitNewAppointment="scheduler_InitNewAppointment"
AppointmentViewInfoCustomizing="scheduler_AppointmentViewInfoCustomizing"
PopupMenuShowing="Scheduler_PopupMenuShowing" InitNewAppointment="Scheduler_InitNewAppointment"
AppointmentViewInfoCustomizing="Scheduler_AppointmentViewInfoCustomizing"
AllowAppointmentDrag="AllowAppointmentAenderung" AllowAppointmentEdit="AllowAppointmentAenderung"
AllowAppointmentResize="AllowAppointmentAenderung" AllowAppointmentCreate="AllowAppointmentCreateEvent"
AllowAppointmentDragBetweenResources="AllowAppointmentAenderung"

View File

@@ -311,7 +311,7 @@ namespace BeWo.Scheduler.View
private string requests;
public string Requests
{
get { return requests ?? (requests = string.Format("{0} Benaschrichtigungen", "keine")); }
get { return requests ?? (requests = "keine Benachrichtigungen"); }
set
{
requests = value;
@@ -404,7 +404,7 @@ namespace BeWo.Scheduler.View
{
Cache.GetInstance().GetAllActiveCustomersCompact(liste => this.Dispatch(() =>
{
var erg = ((!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen)) ? liste.Where(c => c.IsRelatedToEmployee).ToList() : liste).Where(c => c.IsArchived == false).ToList();
var erg = (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) ? liste.Where(c => c.IsRelatedToEmployee).ToList() : liste).Where(c => c.IsArchived == false).ToList();
AllCustomers = erg;
CustomerList = AllCustomers;
@@ -829,10 +829,41 @@ namespace BeWo.Scheduler.View
private void UpdateRequestString()
{
ServiceFacade.DoResourceServiceSync(r => Liste = r.GetAllOpenAppointmentsForEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value));
var summe = Liste.Count;
Enabled = Liste.Count > 0;
Requests = string.Format("{0} Benachrichtigung{1}", summe == 0 ? "keine" : summe.ToString(), summe == 1 ? "" : "en");
var count = 0;
var oidList = new List<long>();
foreach (var termin in Liste)
{
if (termin.Originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)
{
foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid != BeWoApp.LoggedOnEmployee.EmployeeOid.Value))
{
if (status.IsPChanged && status.ParticipationAnswer != ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value))
{
oidList.Add(status.Employee2SchedulerAppointmentOid.Value);
count++;
}
}
}
else
{
if (termin.EmployeeList.Any(a => a.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value))
{
foreach (var status in termin.EmployeeList.Where(w => w.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value))
{
if (!status.IsPChanged && status.ParticipationAnswer == ParticipationAnswer.Offen && status.ParticipationAnswer != ParticipationAnswer.Verstrichen && !oidList.Contains(status.Employee2SchedulerAppointmentOid.Value))
{
oidList.Add(status.Employee2SchedulerAppointmentOid.Value);
count++;
}
}
}
}
}
Enabled = count > 0;
Requests = $"{(count == 0 ? "keine" : count.ToString())} Benachrichtigung{(count == 1 ? "" : "en")}";
}
private List<SchedulerAppointmentDC> Liste = new List<SchedulerAppointmentDC>();
@@ -938,9 +969,9 @@ namespace BeWo.Scheduler.View
//Synchronize();
}
private void scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e)
private void Scheduler_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e)
{
var control = (DevExpress.Xpf.Scheduler.SchedulerControl) sender;
var control = (SchedulerControl) sender;
if (istNeu)
{
@@ -967,7 +998,7 @@ namespace BeWo.Scheduler.View
private void SchedulerControl_EditRecurrentAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e) { }
private void scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e)
private void Scheduler_PopupMenuShowing(object sender, SchedulerMenuEventArgs e)
{
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen) ||
!BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll))
@@ -993,13 +1024,13 @@ namespace BeWo.Scheduler.View
}
private bool istNeu;
private void scheduler_InitNewAppointment(object sender, AppointmentEventArgs e)
private void Scheduler_InitNewAppointment(object sender, AppointmentEventArgs e)
{
istNeu = true;
ViewModel.InitNewAppointment(e.Appointment);
}
private void scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
private void Scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
{
e.ViewInfo.CustomViewInfo = e.ViewInfo.Appointment.CustomFields;
}
@@ -1008,14 +1039,12 @@ namespace BeWo.Scheduler.View
{
var darfTerminDetailsSehen = true;
var appointment = e.Appointment;
var ersteller = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var ersteller = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var mitarbeiterliste = (List<Employee2SchedulerAppointmentDC>)appointment.CustomFields["EmployeeList"];
var hatNurAndereMitarbeiter = mitarbeiterliste.Count > 0 && !(mitarbeiterliste.Count == 1 && mitarbeiterliste.ElementAt(0).Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
var hatKlienten = ((List<CompactCustomerDC>) appointment.CustomFields["CustomerList"]).Count > 0;
bool istErsteller = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
//var hatRessourcen = ((List<ResourceDC>) apt.CustomFields["ResourceList"]).Count > 0;
var istErsteller = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
if (hatNurAndereMitarbeiter || !istErsteller)
{
@@ -1139,7 +1168,9 @@ namespace BeWo.Scheduler.View
var zuBestaetigen = vm.Appointments.Where(app =>
{
if (!app.CustomFields.ContainsKey("EmployeeList"))
var originator = (CompactEmployeeDC) app.CustomFields["Originator"];
if (!app.CustomFields.ContainsKey("EmployeeList") || originator.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value)
{
return false;
}
@@ -1159,7 +1190,7 @@ namespace BeWo.Scheduler.View
var empList = (List<Employee2SchedulerAppointmentDC>) app.CustomFields["EmployeeList"];
var or = (CompactEmployeeDC) app.CustomFields["Originator"];
return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
return or.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && empList.Any(a => a.IsPChanged && a.ParticipationAnswer != ParticipationAnswer.Offen && a.ParticipationAnswer != ParticipationAnswer.Verstrichen && !a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
}).ToList();
if (!zuBestaetigen.Any() && !updates.Any())
@@ -1167,13 +1198,13 @@ namespace BeWo.Scheduler.View
return;
}
var x = new RequestAnswerView(zuBestaetigen, updates);
var requestAnswerView = new RequestAnswerView(zuBestaetigen, updates);
x.Closed += RequestAnswerViewClosedEvent;
x.ParticipationChanged += UpdateRequestStringEvent;
x.ParticipationChanged += UpdateBeiParticipationChanged;
x.Show();
requestAnswerView.Closed += RequestAnswerViewClosedEvent;
requestAnswerView.ParticipationChanged += UpdateRequestStringEvent;
requestAnswerView.ParticipationChanged += UpdateBeiParticipationChanged;
requestAnswerView.Show();
}
private void RequestAnswerViewClosedEvent(object sender, EventArgs e)
@@ -1429,10 +1460,15 @@ namespace BeWo.Scheduler.View
var items = SelectedItems;
var testtesttest = ViewModel.ActiveAppointmentViewModel;
OnPropertyChanged("AllResources");
OnPropertyChanged("SelectedEmployees");
OnPropertyChanged("SelectedItems");
}
OnPropertyChanged("ViewModel");
Scheduler.ActiveView.LayoutChanged();
}
//private void ExportAsiCal(object sender, RoutedEventArgs e)
//{

View File

@@ -34,7 +34,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ListView x:Name="OTListView" Grid.Column="0" MinWidth="120" SelectionMode="Single" Margin="3" ItemsSource="{Binding Path=OffeneTermine, UpdateSourceTrigger=PropertyChanged}" MaxWidth="300" SelectionChanged="Selector_OnSelected" Background="{StaticResource NavigationContentBrush}" SelectedIndex="0">
<ListView x:Name="OTListView" Grid.Column="0" MinWidth="120" SelectionMode="Single" Margin="3" ItemsSource="{Binding Path=OffeneTermine, UpdateSourceTrigger=PropertyChanged}" MaxWidth="300" SelectionChanged="Selector_OnSelected" Background="{StaticResource NavigationContentBrush}" SelectedIndex="0">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />
@@ -55,7 +55,7 @@
</Border>
<Border x:Name="ItemContent" CornerRadius="5" MinHeight="20">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True">
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={StaticResource LvItemConverter}, ConverterParameter=LabelId}" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<TextBlock VerticalAlignment="Center" Text="{Binding Converter={StaticResource LvItemConverter}, ConverterParameter=LabelId}" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
</Grid>
</Border>
</Grid>
@@ -114,38 +114,40 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Betreff" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="0" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Subject}" IsReadOnly="True" />
<TextBlock Grid.ColumnSpan="4" HorizontalAlignment="Center" Visibility="{Binding Path=SelektierterTermin, Converter={StaticResource Int2VisibilityConverter}, ConverterParameter=TerminVerstrichen}" Foreground="#9a0000">Dieser Termin liegt in der Vergangenheit</TextBlock>
<Label Grid.Column="0" Grid.Row="1" Content="Betreff" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Subject}" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="1" Content="Ort" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Location}" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="2" Content="Ort" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="2" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Location}" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="2" Content="Organisator" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="2" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin, Converter={StaticResource OriginatorExtraxtor}}" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="3" Content="Organisator" Margin="3" />
<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="3" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin, Converter={StaticResource OriginatorExtraxtor}}" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Start" Margin="3"/>
<dxe:DateEdit Grid.Column="1" Grid.Row="3" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" IsEnabled="False" EditValue="{Binding SelektierterTermin.Start}" IsReadOnly="True" />
<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="3" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.StartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>
<dxe:CheckEdit IsEnabled="False" Grid.Column="3" Grid.Row="3" Content="Ganztägig" EditValue ="{Binding SelektierterTermin.AllDay}" HorizontalAlignment="Right" Margin="3" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Content="Start" Margin="3"/>
<dxe:DateEdit Grid.Column="1" Grid.Row="4" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" IsEnabled="False" EditValue="{Binding SelektierterTermin.Start}" IsReadOnly="True" />
<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="4" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.StartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>
<dxe:CheckEdit IsEnabled="False" Grid.Column="3" Grid.Row="4" Content="Ganztägig" EditValue ="{Binding SelektierterTermin.AllDay}" HorizontalAlignment="Right" Margin="3" IsReadOnly="True" />
<Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Content="Ende" Margin="3"/>
<dxe:DateEdit IsEnabled="False" Grid.Column="1" Grid.Row="4" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding SelektierterTermin.End}" IsReadOnly="True" />
<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="4" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.EndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>
<Label Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" Content="Ende" Margin="3"/>
<dxe:DateEdit IsEnabled="False" Grid.Column="1" Grid.Row="5" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding SelektierterTermin.End}" IsReadOnly="True" />
<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="5" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.EndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>
<Label Grid.Column="0" Grid.Row="5" Margin="3" Content="Notiz"/>
<TextBox Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
<Label Grid.Column="0" Grid.Row="6" Margin="3" Content="Notiz"/>
<TextBox Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Disabled" Margin="3" TextWrapping="Wrap"
Text="{Binding Path=SelektierterTermin.Description}" IsReadOnly="True" />
<StackPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding Path=SelektierterTermin.LabelId, Converter={StaticResource Int2VisibilityConverter}, ConverterParameter=ZusagenStack}">
<StackPanel x:Name="ZusagenStack" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding Path=SelektierterTermin, Converter={StaticResource Int2VisibilityConverter}, ConverterParameter=ZusagenStack}">
<Button Margin="3" Content="Zusagen" Click="Zusagen_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
<Button Margin="3" Content="Mit Vorbehalt" Click="MitVorbehalt_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
<Button Margin="3" Content="Absagen" Click="Absagen_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
</StackPanel>
<Button Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Margin="3" Content="OK" Click="OK_OnClick" Visibility="{Binding Path=SelektierterTermin.LabelId, Converter={StaticResource Int2VisibilityConverter}}" />
<Button x:Name="OkButton" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Margin="3" Content="OK" Click="OK_OnClick" Visibility="{Binding Path=SelektierterTermin, Converter={StaticResource Int2VisibilityConverter}}" />
</Grid>
</Grid>
<Button Grid.Row="1" x:Name="CloseBtn" Content="Schließen" HorizontalAlignment="Right" Margin="3" Click="CloseButton_Click" />

View File

@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using BeWo.Annotations;
using BeWo.Scheduler.ViewModel;
using BeWo.ServiceProxy;
@@ -27,7 +27,8 @@ namespace BeWo.Scheduler.View
add { AddHandler(ParticipationChangedEvent, value); }
remove { RemoveHandler(ParticipationChangedEvent, value); }
}
void RaiseParticipationChangedEventEvent()
private void RaiseParticipationChangedEventEvent()
{
var newEventArgs = new RoutedEventArgs(ParticipationChangedEvent);
RaiseEvent(newEventArgs);
@@ -38,12 +39,8 @@ namespace BeWo.Scheduler.View
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public ObservableCollection<IBeWoAppointment> OffeneTermine { get; set; }
@@ -58,38 +55,51 @@ namespace BeWo.Scheduler.View
}
}
public RequestAnswerView(IEnumerable<IBeWoAppointment> appointments, IEnumerable<IBeWoAppointment> statusUpdates)
public RequestAnswerView(IEnumerable<IBeWoAppointment> appointments, List<IBeWoAppointment> statusUpdates)
{
var x = new List<IBeWoAppointment>();
foreach (SchedulerAppointmentVM item in statusUpdates)
{
var emplist = (List<Employee2SchedulerAppointmentDC>) item.CustomFields["EmployeeList"];
x.AddRange(emplist.Where(emp => emp.IsPChanged && emp.ParticipationAnswer != ParticipationAnswer.Offen && !emp.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)).Select(emp => new SchedulerAppointmentVM(new SchedulerAppointmentDC
{
SchedulerAppointmentOid = item.CommitToDataContract().SchedulerAppointmentOid,
NewSchedulerAppointmentVersion = item.CommitToDataContract().NewSchedulerAppointmentVersion,
IsPrivate = item.IsPrivate,
RecurrenceInfo = item.RecurrenceInfo,
Type = item.EventType,
CustomerList = (List<CompactCustomerDC>) item.CustomFields["CustomerList"],
ResourceList = (List<ResourceDC>) item.CustomFields["ResourceList"],
AllDay = item.AllDay,
EmployeeList = emplist,
Description = item.Description,
EndDate = item.End,
StartDate = item.Start,
Location = item.Location,
Subject = item.Subject,
Status = 1,
Originator = (CompactEmployeeDC) item.CustomFields["Originator"]
}) {CustomFields = item.CustomFields, LabelId = Convert.ToInt32(emp.Employee2SchedulerAppointmentOid)}));
}
var statusUpdatesAsAppointments = new List<IBeWoAppointment>();
foreach(SchedulerAppointmentVM item in statusUpdates)
{
foreach(var relation in item.EmployeeList.Where(emp => emp.IsPChanged && emp.ParticipationAnswer != ParticipationAnswer.Offen && emp.ParticipationAnswer != ParticipationAnswer.Verstrichen && !emp.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)))
{
if(statusUpdatesAsAppointments.All(a => a.LabelId != relation.Employee2SchedulerAppointmentOid))
{
statusUpdatesAsAppointments.Add(BuildNewVMFromOldVM(item, relation.Employee2SchedulerAppointmentOid.Value));
}
}
}
OffeneTermine = appointments.ToObservableCollection();
OffeneTermine.AddRange(new List<IBeWoAppointment>(x));
OffeneTermine.AddRange(new List<IBeWoAppointment>(statusUpdatesAsAppointments));
DataContext = this;
InitializeComponent();
}
}
private static SchedulerAppointmentVM BuildNewVMFromOldVM(SchedulerAppointmentVM item, long emp2appOid)
{
return new SchedulerAppointmentVM(new SchedulerAppointmentDC
{
SchedulerAppointmentOid = item.CommitToDataContract().SchedulerAppointmentOid,
NewSchedulerAppointmentVersion = item.CommitToDataContract().NewSchedulerAppointmentVersion,
IsPrivate = item.IsPrivate,
RecurrenceInfo = item.RecurrenceInfo,
Type = item.EventType,
CustomerList = (List<CompactCustomerDC>)item.CustomFields["CustomerList"],
ResourceList = (List<ResourceDC>)item.CustomFields["ResourceList"],
AllDay = item.AllDay,
EmployeeList = item.EmployeeList,
Description = item.Description,
EndDate = item.End,
StartDate = item.Start,
Location = item.Location,
Subject = item.Subject,
Status = 1,
Originator = (CompactEmployeeDC)item.CustomFields["Originator"]
})
{ CustomFields = item.CustomFields, LabelId = Convert.ToInt32(emp2appOid)};
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
@@ -100,9 +110,9 @@ namespace BeWo.Scheduler.View
{
var lv = (ListView) sender;
SelektierterTermin = (IBeWoAppointment) lv.SelectedItem;
}
}
private void Zusagen_OnClick(object sender, RoutedEventArgs e)
private void Zusagen_OnClick(object sender, RoutedEventArgs e)
{
var meinTermin = SelektierterTermin as SchedulerAppointmentVM;
UpdateTeilnahme(ParticipationAnswer.Zusage, meinTermin);
@@ -135,31 +145,49 @@ namespace BeWo.Scheduler.View
private void UpdateView(List<SchedulerAppointmentDC> aktualisierteTermine)
{
var zuEntfernen = new List<SchedulerAppointmentVM>();
foreach (var dc in aktualisierteTermine)
{
foreach (var ivm in OffeneTermine)
{
var vm = ivm as SchedulerAppointmentVM;
if (vm == null || !vm.DataContract.Equals(dc)) continue;
if (vm == null || !vm.DataContract.Equals(dc))
{
continue;
}
var found = vm;
found.DataContract = dc;
UpdateViewModel(dc, ((SchedulerAppointmentVM) ivm));
UpdateViewModel(dc, (SchedulerAppointmentVM) ivm);
vm.UpdateCustomFields();
if (vm.LabelId == 0)
{
this.Dispatch(() =>
{
OffeneTermine = OffeneTermine.Where(w => !w.Equals(vm)).ToObservableCollection();
OnPropertyChanged("OffeneTermine");
if (found.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && a.ParticipationAnswer != ParticipationAnswer.Offen && a.IsPChanged) || found.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && found.EmployeeList.Any(a => a.IsPC_CheckedTs != null))
zuEntfernen.Add(found);
RaiseParticipationChangedEventEvent();
});
}
else
{
var test = (SchedulerAppointmentVM) OffeneTermine.FirstOrDefault(f => dc.EmployeeList.Any(a => a.Employee2SchedulerAppointmentOid.Value == f.LabelId));
this.Dispatch(() =>
{
OffeneTermine = OffeneTermine.Where(w => !w.Equals(test)).ToObservableCollection();
OnPropertyChanged("OffeneTermine");
RaiseParticipationChangedEventEvent();
});
}
}
}
this.Dispatch(() =>
{
OffeneTermine = OffeneTermine.Except(zuEntfernen).ToObservableCollection();
OnPropertyChanged("OffeneTermine");
RaiseParticipationChangedEventEvent();
if (OffeneTermine.Count == 0 && OTListView.Items.Count == 0)
{
@@ -175,7 +203,21 @@ namespace BeWo.Scheduler.View
private void OK_OnClick(object sender, RoutedEventArgs e)
{
SelektierterTermin = OTListView.SelectedItem as IBeWoAppointment;
if (SelektierterTermin == null || SelektierterTermin.LabelId <= 0) return;
if (selektierterTermin != null && selektierterTermin.Start < DateTime.Now && selektierterTermin.End < DateTime.Now)
{
((List<Employee2SchedulerAppointmentDC>) SelektierterTermin.CustomFields["EmployeeList"]).Find(f => f.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value).IsPC_CheckedTs = DateTime.Now;
((List<Employee2SchedulerAppointmentDC>) SelektierterTermin.CustomFields["EmployeeList"]).Find(f => f.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value).ParticipationAnswer = ParticipationAnswer.Verstrichen;
((List<Employee2SchedulerAppointmentDC>) SelektierterTermin.CustomFields["EmployeeList"]).Find(f => f.Employee.EmployeeOid == BeWoApp.LoggedOnEmployee.EmployeeOid.Value).IsPChanged = false;
ServiceFacade.DoResourceServiceAsync(s => s.UpdateSchedulerAppointments(new List<SchedulerAppointmentDC> { ((SchedulerAppointmentVM)SelektierterTermin).DataContract }), UpdateView);
return;
}
if (SelektierterTermin == null || SelektierterTermin.LabelId <= 0)
{
return;
}
((List<Employee2SchedulerAppointmentDC>) SelektierterTermin.CustomFields["EmployeeList"]).Find(f => f.Employee2SchedulerAppointmentOid == SelektierterTermin.LabelId).IsPC_CheckedTs = DateTime.Now;
((List<Employee2SchedulerAppointmentDC>) SelektierterTermin.CustomFields["EmployeeList"]).Find(f => f.Employee2SchedulerAppointmentOid == SelektierterTermin.LabelId).IsPChanged = false;
@@ -197,11 +239,12 @@ namespace BeWo.Scheduler.View
if (app.LabelId <= 0)
{
return string.Format("{0}: {1}", app.Start.ToShortDateString(), app.Subject);
return $"{app.Start.ToShortDateString()}: {app.Subject}";
}
var s = string.Empty;
var l = ((List<Employee2SchedulerAppointmentDC>) app.CustomFields["EmployeeList"]).Find(f => f.Employee2SchedulerAppointmentOid == app.LabelId);
switch (l.ParticipationAnswer)
{
case ParticipationAnswer.Zusage:
@@ -215,7 +258,7 @@ namespace BeWo.Scheduler.View
break;
}
return string.Format("{0}: {1} {2} hat {3}", app.Start.ToShortDateString(), l.Employee.FirstName, l.Employee.LastName, s);
return $"{app.Start.ToShortDateString()}: {l.Employee.FirstName} {l.Employee.LastName} hat {s}";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
@@ -249,12 +292,27 @@ namespace BeWo.Scheduler.View
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return Visibility.Collapsed;
}
var appointment = (SchedulerAppointmentVM) value;
if (parameter != null && parameter.Equals("ZusagenStack"))
{
return System.Convert.ToInt32(value) > 0 ? Visibility.Collapsed : Visibility.Visible;
var shouldBeVisible = appointment.LabelId <= 0 && !(appointment.Start < DateTime.Now && appointment.End < DateTime.Now);
return shouldBeVisible ? Visibility.Visible : Visibility.Collapsed;
}
return System.Convert.ToInt32(value) > 0 ? Visibility.Visible : Visibility.Collapsed;
if (parameter != null && parameter.Equals("TerminVerstrichen"))
{
return appointment.Start < DateTime.Now && appointment.End < DateTime.Now ? Visibility.Visible : Visibility.Collapsed;
}
return appointment.LabelId > 0 || appointment.Start < DateTime.Now && appointment.End < DateTime.Now ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View File

@@ -46,7 +46,7 @@
</Grid.ColumnDefinitions>
<Border Grid.Column="0" CornerRadius="2" Width="5" Height="15" Background="{Binding Converter={StaticResource ParticipationBrushConverter}}" BorderThickness="1" BorderBrush="{Binding Converter={StaticResource ParticipationBrushConverter}, ConverterParameter=Border}" />
<TextBlock VerticalAlignment="Center" Grid.Column="1" Text="{Binding Converter={StaticResource TextFromIDataContractConverter}}" Margin="3,0,0,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<Button x:Name="btnRemoveElement" Grid.Column="2" Grid.RowSpan="2" Width="15" Height="15" ToolTip="Element aus der Liste entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyleSmall}" Click="btnRemoveElement_Click" Margin="3,0,0,0" />
<Button x:Name="btnRemoveElement" Grid.Column="2" Grid.RowSpan="2" Width="15" Height="15" ToolTip="Element aus der Liste entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyleSmall}" Click="BtnRemoveElement_Click" Margin="3,0,0,0" />
</Grid>
</Border>
</Grid>
@@ -118,7 +118,7 @@
<Border Grid.Column="0" CornerRadius="2" Width="5" Height="15" Background="{Binding Converter={StaticResource ParticipationBrushConverter}}" BorderThickness="1" BorderBrush="{Binding Converter={StaticResource ParticipationBrushConverter}, ConverterParameter=Border}" />
<Rectangle Grid.Column="1" Width="10" Height="10" Fill="{Binding Path=Color, Converter={StaticResource StringBrushConverter}}" Stroke="Black" StrokeThickness="1" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" Grid.Column="2" Text="{Binding Converter={StaticResource TextFromIDataContractConverter}}" Margin="3,0,0,0" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<Button x:Name="btnRemoveElement" Grid.Column="3" Grid.RowSpan="2" Width="15" Height="15" ToolTip="Element aus der Liste entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyleSmall}" Click="btnRemoveElement_Click" Margin="3,0,0,0" />
<Button x:Name="btnRemoveElement" Grid.Column="3" Grid.RowSpan="2" Width="15" Height="15" ToolTip="Element aus der Liste entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyleSmall}" Click="BtnRemoveElement_Click" Margin="3,0,0,0" />
</Grid>
</Border>
</Grid>

View File

@@ -48,8 +48,8 @@ namespace BeWo.Scheduler.View
}
public SchedulerAppointmentListVM ViewModel { get; set; }
static void recurrenceControl_Loaded(object sender, RoutedEventArgs e)
private static void recurrenceControl_Loaded(object sender, RoutedEventArgs e)
{
LocalizeVisualChild(sender as DependencyObject);
}
@@ -178,7 +178,7 @@ namespace BeWo.Scheduler.View
DeleteButton.Visibility = Visibility.Hidden;
}
static void edtRecurrenceType_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
private static void edtRecurrenceType_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
{
var conv = new Converter.Recurrence2GermanConverter();
@@ -204,18 +204,19 @@ namespace BeWo.Scheduler.View
return new NewSchedulerAppointmentFormController(schedulerControl, appointment);
}
void SelectedCustomersCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
private void SelectedCustomersCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
NewSchedulerAppointmentFormController.CustomerList = SelectedCustomers.ToList();
MultiCustomerSearch.AusgewaehlteKlienten = SelectedCustomers.ToList();
}
void SelectedResourcesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
private void SelectedResourcesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
NewSchedulerAppointmentFormController.ResourceList = SelectedResources.ToList();
ResourcesTreeSearchView.AusgewaehlteRessourcen = SelectedResources.ToList();
}
void SelectedEmployeesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
private void SelectedEmployeesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
NewSchedulerAppointmentFormController.EmployeeList = SelectedEmployees.ToList();
MultiEmployeeSearch.AusgewaehlteMitarbeiter = SelectedEmployees.Select(em => em.Employee).ToList();
@@ -339,7 +340,7 @@ namespace BeWo.Scheduler.View
}
private void button_CreatZeiterfassung_Click(object sender, RoutedEventArgs e)
private void Button_CreatZeiterfassung_Click(object sender, RoutedEventArgs e)
{
var employ = SelectedMitarbeiter.Items;
var y = SelectedKlient.Items;
@@ -379,8 +380,7 @@ namespace BeWo.Scheduler.View
}
}
private void btnRemoveElement_Click(object sender, RoutedEventArgs e)
private void BtnRemoveElement_Click(object sender, RoutedEventArgs e)
{
var obj = ((Button) sender).Tag;

View File

@@ -6,7 +6,6 @@ using BS.Shared.Core;
using BeWo.Scheduler.View;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
@@ -30,22 +29,17 @@ namespace BeWo.Scheduler.ViewModel
set
{
if ((mActiveAppointmentViewModel == null && value != null) || (mActiveAppointmentViewModel != null && !mActiveAppointmentViewModel.Equals(value)))
if(value != null)
{
mActiveAppointmentViewModel = value;
if (ViewModelChanged != null)
{
ViewModelChanged(this, new EventArgs<ISchedulerViewModel>(value));
}
}
ViewModelChanged?.Invoke(this, new EventArgs<ISchedulerViewModel>(value));
}
}
}
public void UpdateAppointmentViewModel(DateTime intervalStart, DateTime intervalEnd)
{
BeWoApp.MainControl.StartWaiting();
if (!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue)
{
return;
@@ -81,18 +75,16 @@ namespace BeWo.Scheduler.ViewModel
allCust = allCust.Where(c => BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.Equals(c))).ToList();
}
var prefilteredAppointments = appointments.Where(w => ((w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) ||
var prefilteredAppointments = appointments.Where(w => (w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) ||
BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || w.EmployeeList.IsEmpty()));
var vm = new SchedulerAppointmentListVM(prefilteredAppointments.ToList(), allCust, allEmps, mAllCats2ResInDic);
ActiveAppointmentViewModel = vm;
SchedulerSettings = GetActiveSettings();
SchedulerSettings.StartDate = intervalStart;
BeWoApp.MainControl.EndWaiting();
//BeWoApp.MainControl.AufOffeneTerminePruefen();
}
public AbstractAppointmentEditForm GetEditAppointmentForm(DevExpress.Xpf.Scheduler.SchedulerControl control, Appointment appointment)
@@ -102,10 +94,7 @@ namespace BeWo.Scheduler.ViewModel
internal void InitNewAppointment(Appointment appointment)
{
if (ActiveAppointmentViewModel != null)
{
ActiveAppointmentViewModel.InitNewAppointment(appointment);
}
ActiveAppointmentViewModel?.InitNewAppointment(appointment);
}
public SchedulerSettings SchedulerSettings { get; set; }

View File

@@ -15,7 +15,6 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using DevExpress.Data.Linq;
using DevExpress.Xpf.Scheduler;
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Native;
@@ -126,7 +125,7 @@ namespace BeWo.Scheduler.ViewModel
}
item.Description = "Privater Termin";
item.Subject = string.Format("Privat ({0})", item.Originator);
item.Subject = $"Privat ({item.Originator})";
}
}
@@ -462,11 +461,9 @@ namespace BeWo.Scheduler.ViewModel
switch (filterCategory)
{
case "NurEigene":
var istEigenerTermin = (ersteller != null && ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && employeeList != null && employeeList.Count == 0) ||
(employeeList != null && employeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)));
var istEigenerTermin = ersteller != null && ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && employeeList != null && employeeList.Count == 0 ||
employeeList != null && employeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
wirdAngezeigt = istEigenerTermin;
@@ -479,7 +476,7 @@ namespace BeWo.Scheduler.ViewModel
var cfe = (employeeList == null ? new List<CompactEmployeeDC>() : employeeList.Select(s => s.Employee).ToList());
var cfe = employeeList?.Select(s => s.Employee).ToList() ?? new List<CompactEmployeeDC>();
var cfr = resourceList ?? new List<ResourceDC>();
var cfc = customerList ?? new List<CompactCustomerDC>();

View File

@@ -29,13 +29,13 @@ namespace BeWo.Scheduler.ViewModel
public static string PropertyName_Originator = "Originator";
private bool _AllDay;
private String _Description;
private string _Description;
private DateTime _End;
private String _Location;
private String _RecurrenceInfo;
private string _Location;
private string _RecurrenceInfo;
private DateTime _Start;
private int _Status;
private String _Subject;
private string _Subject;
private int _Type;
private Dictionary<string, object> _CustomFields;
private bool _IsPrivate;
@@ -118,7 +118,7 @@ namespace BeWo.Scheduler.ViewModel
}
}
}
public String Subject
public string Subject
{
get { return _Subject; }
set
@@ -131,7 +131,7 @@ namespace BeWo.Scheduler.ViewModel
}
}
}
public String Location
public string Location
{
get { return _Location; }
set
@@ -157,7 +157,7 @@ namespace BeWo.Scheduler.ViewModel
}
}
}
public String RecurrenceInfo
public string RecurrenceInfo
{
get { return _RecurrenceInfo; }
set
@@ -170,7 +170,7 @@ namespace BeWo.Scheduler.ViewModel
}
}
}
public String Description
public string Description
{
get { return _Description; }
set
@@ -363,6 +363,7 @@ namespace BeWo.Scheduler.ViewModel
}
var areEqual =
LabelId == obj.LabelId &&
AllDay == obj.AllDay &&
IsPrivate == obj.IsPrivate &&
IsDirty == obj.IsDirty &&

View File

@@ -26,7 +26,7 @@ namespace BeWo.View.Controls
this.InitializeComponent();
this.UpdateListBox();
GroupSearchView.EditGroupButtonClicked += new EventHandler(GroupSearchView_EditGroupButtonClicked);
GroupSearchView.EditGroupButtonClicked += GroupSearchView_EditGroupButtonClicked;
}
void GroupSearchView_EditGroupButtonClicked(object sender, EventArgs e)
@@ -50,7 +50,7 @@ namespace BeWo.View.Controls
public List<CompactSupportConceptDC> SupportConceptList
{
get { return this.SearchView != null ? SearchView.SupportConcepts : null; }
get { return SearchView?.SupportConcepts; }
set { SearchView.SupportConcepts = value; }
}

View File

@@ -647,7 +647,7 @@
</Border>
<!-- ####################################### Grid Mit Enddatum SharedSizeGroup="Label1" #######################################################-->
<!-- ####################################### Grid mit Enddatum SharedSizeGroup="Label1" #######################################################-->
<Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2" x:Name="GridMitEnddatum" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Label1"/>
@@ -707,7 +707,7 @@
<!-- ###########################################Converter={StaticResource Int2DecimalConverter},#############################################################-->
<!-- ##################################### Grit Ohne Enddatum ###############################################-->
<!-- ##################################### Grid ohne Enddatum ###############################################-->
<Grid Grid.Column="0" Grid.Row="8" ColumnSpan="2" x:Name="GridOhneEnddatum" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Label1"/>
@@ -766,7 +766,7 @@
<!-- ####################################Converter={StaticResource Int2DecimalConverter},##########################################################################################################-->
<!-- ########################## Grid mit nur Jahr / Monat und feste dauer SharedSizeGroup="Label1"#####################################-->
<!-- ########################## Grid mit nur Jahr / Monat und fester Dauer SharedSizeGroup="Label1"#####################################-->
<Grid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" x:Name="GridMitJahrMonat" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -1072,7 +1072,7 @@
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<!-- ############## Header von Minuten auf Dauer Gewechselt #################################-->
<!-- ############## Header von Minuten auf Dauer gewechselt #################################-->
<dxg:GridColumn FieldName="RoundedDurationAnzeige" AllowEditing="False" Header="Dauer" x:Name="RoundedDHeader" Width="65">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="0.##"></dxe:TextEditSettings>

View File

@@ -1069,6 +1069,7 @@ namespace BeWo.Data.Access
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active))
.CreateCriteria(SchedulerAppointment.PropertyName_EmployeeList)
.Add(Restrictions.And(Restrictions.And(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_IsPChanged, true), Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", employeeOid))), Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Offen))))
.Add(Restrictions.Not(Restrictions.Eq(Employee2SchedulerAppointment.PropertyName_ParticipationAnswer, ParticipationAnswer.Verstrichen)))
.Add(Restrictions.IsNull(Employee2SchedulerAppointment.PropertyName_IsPC_CheckedTs));
var result = c.List<SchedulerAppointment>();

View File

@@ -849,20 +849,6 @@ namespace BeWo.Service.ServiceImplementations
var offeneTermine = DAOFactory.SearchDAO.GetAllOpenAppointmentsForEmployee(pEmployeeOid);
offeneTermine.AddRange(DAOFactory.SearchDAO.GetAllParticipationNotificationsForEmployee(pEmployeeOid));
//var offeneTermineInZukunft = new List<SchedulerAppointmentDC>();
//foreach (var termin in offeneTermine)
//{
// if (String.IsNullOrEmpty(termin.RecurrenceInfo))
// {
// if (termin.EndDate.HasValue && termin.EndDate < DateTime.Now.Date)
// {
// offeneTermineInZukunft.Add(termin);
// }
// }
//}
return MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDCs(offeneTermine);
}
catch (Exception e)

View File

@@ -752,10 +752,11 @@ namespace BS.Shared
public enum ParticipationAnswer
{
Offen = 0,
Zusage = 1,
Absage = 2,
Vorbehalt = 3
Offen = 0,
Zusage = 1,
Absage = 2,
Vorbehalt = 3,
Verstrichen = 4
}
public enum UiElementType

View File

@@ -69,17 +69,24 @@ namespace BS.Shared.DataContracts
public override bool Equals(object obj)
{
if (!(obj is SchedulerAppointmentDC)) return false;
if (!(obj is SchedulerAppointmentDC))
{
return false;
}
var y = (SchedulerAppointmentDC) obj;
if (SchedulerAppointmentOid == null && y.SchedulerAppointmentOid == null)
return GetHashCode() == y.GetHashCode();
if (SchedulerAppointmentOid == null && y.SchedulerAppointmentOid == null)
{
return GetHashCode() == y.GetHashCode();
}
if (SchedulerAppointmentOid != null && y.SchedulerAppointmentOid != null)
return SchedulerAppointmentOid == y.SchedulerAppointmentOid;
if (SchedulerAppointmentOid != null && y.SchedulerAppointmentOid != null)
{
return SchedulerAppointmentOid == y.SchedulerAppointmentOid;
}
var value = StartDate == y.StartDate && EndDate == y.EndDate && Type == y.Type && (Description == y.Description) &&
var value = StartDate == y.StartDate && EndDate == y.EndDate && Type == y.Type && Description == y.Description &&
EmployeeList.SequenceEqual(y.EmployeeList) && ResourceList.SequenceEqual(y.ResourceList) && CustomerList.SequenceEqual(y.CustomerList);
return value;