zeiterfassungs änderungen testphase
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -85,8 +86,13 @@
|
||||
Grid.Column="1" Grid.Row="5" Margin="3,5,3,5" Height="23" EditValue="{Binding Path=AnzTageZeiterfassErfolgt, Converter={StaticResource Int2DecimalConverter}}" />
|
||||
|
||||
<CheckBox Margin="3,5,3,5" Content="Passwortsicherheit aktivieren" IsChecked="{Binding Path=IsPasswordSecurityActiv}" Grid.ColumnSpan="2" Grid.Row="6"></CheckBox>
|
||||
|
||||
<!--#### Eingliederung von endDatum und Nur Monat / jahr in verwaltung ###-->
|
||||
<CheckBox Margin="3,5,3,5" Content="Enddatum in Zeiterfassung aktivieren" IsChecked="{Binding Path=IsEndDateVisible}" Grid.ColumnSpan="2" Grid.Row="7"></CheckBox>
|
||||
|
||||
<!--<CheckBox Margin="3,5,3,5" Content="Enddatum in Zeiterfassung aktivieren" IsChecked="{Binding Path=IsEndDateVisible}" Grid.ColumnSpan="2" Grid.Row="7"></CheckBox>-->
|
||||
<CheckBox Margin="3,5,3,5" Content="Nur Monat/Jahr in Zeiterfassung aktivieren" Grid.ColumnSpan="2" Grid.Row="8"></CheckBox>
|
||||
|
||||
<!--#######################################################################-->
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:val="clr-namespace:BeWo.Validation"
|
||||
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
|
||||
<Grid Width="Auto" Height="Auto">
|
||||
<!--uc:ShadowChrome-->
|
||||
@@ -121,19 +122,40 @@
|
||||
<Label Grid.Column="1" Content="Endzeit" />
|
||||
<dxe:TextEdit MaskType="RegEx" Mask="(0?\d|1\d|2[0-3]):[0-5]\d" ShowError="False" MaskShowPlaceHolders="True" MaskUseAsDisplayFormat="True" InvalidValueBehavior="AllowLeaveEditor" EditValue="{Binding Mode=TwoWay, Path=EndTimeEditString, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" x:Name="endTime" Height="23" Margin="3,0,3,3" />
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" Grid.Row="8">
|
||||
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="8" ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="60" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="60" />
|
||||
<ColumnDefinition Width="67" />
|
||||
<ColumnDefinition Width="83" />
|
||||
<ColumnDefinition Width="120" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Dauer (min)" Grid.Column="1" />
|
||||
<dxe:SpinEdit Increment="5" MinValue="0" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_duration" EditValue="{Binding Mode=TwoWay, Path=Duration, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Height="23" Margin="3,0,3,3" />
|
||||
|
||||
<Label Content="Dauer" Grid.Column="0" x:Name="DauerAnzeige"/>
|
||||
<dxe:SpinEdit Increment="5" MinValue="0" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_duration" EditValue="{Binding Mode=TwoWay, Path=Duration, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Height="23" Margin="0,0,1,3" />
|
||||
|
||||
|
||||
<Grid Column="2" Row="0" HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<!--<ColumnDefinition Width="Auto" /> PrototypeVM. -->
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Label Content="Stunden" Grid.Column="0" Margin="3,0,3,3" HorizontalAlignment="Right" />-->
|
||||
<!--<CheckBox Grid.Column="1" VerticalAlignment="Center" Margin="0,0,3,3" HorizontalAlignment="Right" IsChecked="{Binding Path=PrototypeVM.DurationInStunden, UpdateSourceTrigger=PropertyChanged}" Click="CheckMinStdSwitch_OnClick" x:Name="CheckMinStdSwitch2"/>-->
|
||||
|
||||
<dxe:ComboBoxEdit x:Name="CheckMinStdSwitch" ItemsSource="{x:Static core:EnumTranslations.ZeiterfassungsDauerTranslations}" Grid.Column="1" Margin="3,0,3,3"
|
||||
EditValue="{Binding Path=DurationInStunden, UpdateSourceTrigger=PropertyChanged}" DisplayMember="Value" ValueMember="Key"
|
||||
IsTextEditable="False" Width="94"/>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
<Label Grid.Row="1" Content="Gefahrene Kilometer" Grid.Column="0" Grid.ColumnSpan="2" x:Name="lblDistance" HorizontalAlignment="Right"/>
|
||||
<dxe:SpinEdit Grid.Row="1" Increment="5" MinValue="0" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_distance" EditValue="{Binding Mode=TwoWay, Path=DistanceInMeter, Converter={StaticResource Int2DecimalConverter}}" Grid.Column="2" Height="23" Margin="3,0,3,3" />
|
||||
</Grid>
|
||||
|
||||
@@ -682,22 +682,47 @@
|
||||
Grid.Column="2" x:Name="endTime1"
|
||||
Height="23"
|
||||
Margin="3,0,3,3" />
|
||||
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" Grid.Row="9">
|
||||
<Grid Grid.Column="0" Grid.Row="9" ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="58" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="58" />
|
||||
<ColumnDefinition Width="67" />
|
||||
<ColumnDefinition Width="83" />
|
||||
<ColumnDefinition Width="100" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Dauer (min)" Grid.Column="1"/>
|
||||
<dxe:SpinEdit MinValue="0" Increment="5" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_duration"
|
||||
EditValue="{Binding Path=PrototypeVM.Duration, Mode=TwoWay, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="2"
|
||||
Height="23" Margin="3,0,3,3"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Fortlaufende Änderungen ####################### Änderung : Duration nach DurationSTD -->
|
||||
<Label Content="Dauer" Grid.Column="0" x:Name="MinStdDauerLabel"/>
|
||||
<dxe:SpinEdit MinValue="0" Increment="5" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_duration"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationSTD, Mode=TwoWay, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="1"
|
||||
Height="23" Margin="0,0,1,3"/>
|
||||
|
||||
|
||||
<Grid Column="2" Row="0" HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<!--<ColumnDefinition Width="Auto" />-->
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Label Content="Stunden" Grid.Column="0" Margin="3,0,3,3" HorizontalAlignment="Right" />-->
|
||||
<!--<CheckBox Grid.Column="1" EditValue VerticalAlignment="Center" Margin="0,0,3,3" HorizontalAlignment="Right" IsChecked="{Binding Path=PrototypeVM.DurationInStunden, UpdateSourceTrigger=PropertyChanged}" Click="CheckMinStdSwitch_OnClick" x:Name="CheckMinStdSwitch2"/>-->
|
||||
|
||||
<dxe:ComboBoxEdit x:Name="CheckMinStdSwitch" ItemsSource="{x:Static core:EnumTranslations.ZeiterfassungsDauerTranslations}" Grid.Column="1" Margin="3,0,3,3"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationInStunden, UpdateSourceTrigger=PropertyChanged}" DisplayMember="Value" ValueMember="Key"
|
||||
IsTextEditable="False" Width="94"/>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<Label Grid.Row="1" Content="Gefahrene Kilometer" Grid.Column="0" Grid.ColumnSpan="2" x:Name="lblDistance" HorizontalAlignment="Right"/>
|
||||
<dxe:SpinEdit Grid.Row="1" Increment="5" MinValue="0" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_distance" EditValue="{Binding Mode=TwoWay, Path=PrototypeVM.DistanceInMeter, Converter={StaticResource Int2DecimalConverter}}" Grid.Column="2" Height="23" Margin="3,0,3,3" />
|
||||
</Grid>
|
||||
@@ -939,16 +964,25 @@
|
||||
<dxe:DateSettings DisplayFormat="HH:mm"></dxe:DateSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="RoundedDuration" AllowEditing="False" Header="Minuten" Width="65">
|
||||
|
||||
<!--############## Header von Minuten auf Dauer Gewechselt #################################-->
|
||||
<dxg:GridColumn FieldName="RoundedDuration" AllowEditing="False" Header="Dauer" Width="65">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="0.##"></dxe:TextEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn x:Name="DistanceGridColumn" FieldName="DistanceInMeter" AllowEditing="False" Header="Gefahrene km" Width="80">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="0.##"></dxe:TextEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
|
||||
<!--###############################################################################################-->
|
||||
<dxg:GridColumn FieldName="DurationInStunden" AllowEditing="False" Header="Art (Dauer)" Width="65">
|
||||
|
||||
</dxg:GridColumn>
|
||||
<!--###############################################################################################-->
|
||||
|
||||
<dxg:GridColumn x:Name="DistanceGridColumn" FieldName="DistanceInMeter" AllowEditing="False" Header="Gefahrene km" Width="80">
|
||||
<dxg:GridColumn.EditSettings>
|
||||
<dxe:TextEditSettings DisplayFormat="0.##"></dxe:TextEditSettings>
|
||||
</dxg:GridColumn.EditSettings>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="CategoryString" AllowEditing="False" Header="Leistungskategorie" />
|
||||
<dxg:GridColumn FieldName="ServiceDescriptionString" AllowEditing="False" Header="Leistung" />
|
||||
<dxg:GridColumn FieldName="Notice" AllowEditing="False" Header="Dokumentation1" Width="200" x:Name="head_Doku1"/>
|
||||
|
||||
@@ -99,6 +99,8 @@ namespace BeWo.View.Detail
|
||||
|
||||
ViewModel = pViewModel;
|
||||
|
||||
// CheckMinStdSwitch.SelectedIndex = 0;
|
||||
|
||||
//if (ViewModel.ServiceRecordTimeInterval == ServiceRecordTimeInterval.LastNDays)
|
||||
//{
|
||||
// NDayTextbox.Visibility = Visibility.Visible;
|
||||
@@ -689,6 +691,7 @@ namespace BeWo.View.Detail
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
vm.IsNew = false;
|
||||
vm.DataContract.ServiceRecordVersion = 1;
|
||||
vm.DataContract.ServiceRecordOid = oids[idx++];
|
||||
@@ -709,7 +712,6 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ServiceFacade.DoMultipleOperationsServicesSync(lToDos);
|
||||
ReloadViewModel();
|
||||
}
|
||||
@@ -3872,5 +3874,19 @@ namespace BeWo.View.Detail
|
||||
|
||||
ReloadMedRecordViewModel(ViewModel.BedarfsMedViewModel.NewVM.Customer, ViewModel.BedarfsMedViewModel.NewVM.Employee);
|
||||
}
|
||||
|
||||
private void CheckMinStdSwitch_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//if (CheckMinStdSwitch.IsChecked == true)
|
||||
//{
|
||||
// MinStdDauerLabel.Content = "Dauer (std)";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MinStdDauerLabel.Content = "Dauer (min)";
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,12 @@ namespace BeWo.ViewModel
|
||||
|
||||
public static string PropertyName_DistanceInMeter = "DistanceInMeter";
|
||||
|
||||
public static string PropertyName_DurationInStunden = "DurationInStunden";
|
||||
|
||||
public static string PropertyName_DurationSTD = "DurationSTD";
|
||||
|
||||
public static string PropertyName_EndDate = "EndDate";
|
||||
|
||||
private static readonly DateTime NULL_TIME = new DateTime(2000, 1, 1, 0, 0, 1);
|
||||
|
||||
private Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>> _Category2Services;
|
||||
@@ -108,10 +114,14 @@ namespace BeWo.ViewModel
|
||||
|
||||
private DateTime? _Date;
|
||||
|
||||
private DateTime? _EndDate;
|
||||
|
||||
private bool _DeleteAllowed = true;
|
||||
|
||||
private int? _Duration;
|
||||
|
||||
private int? _DurationSTD;
|
||||
|
||||
private bool _EditAllowed = true;
|
||||
|
||||
private CompactEmployeeDC _Employee;
|
||||
@@ -162,6 +172,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
private int? _DistanceInMeter;
|
||||
|
||||
private ZeiterfassungsDauer? _DurationInStunden;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors and Destructors
|
||||
@@ -367,6 +380,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
if (AreDifferent(_Date, value))
|
||||
{
|
||||
var oldDate = _Date;
|
||||
_Date = value;
|
||||
TimeCheck();
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
@@ -377,6 +391,48 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
FirePropertyChanged(PropertyName_Date);
|
||||
|
||||
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (oldDate != _Date)
|
||||
{
|
||||
// decimal dura = DurationSTD.Value/1440;
|
||||
|
||||
// var x = oldDate.Value.Day - _Date.Value.Day;
|
||||
var x = _Date.Value.Date - oldDate.Value.Date;//_EditableEndDate.Value.Day;
|
||||
|
||||
int daydiff = (int)x.Days * 1440;
|
||||
|
||||
|
||||
|
||||
if (DurationSTD.HasValue)
|
||||
{
|
||||
|
||||
if (EditableEndDate.Value.Date <= _Date.Value.Date)
|
||||
{
|
||||
DurationSTD = 0;
|
||||
}else{
|
||||
DurationSTD = DurationSTD.Value - daydiff; // berechnung ist fehlerhaft
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EditableEndDate.Value.Date <= oldDate.Value)
|
||||
{
|
||||
DurationSTD = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DurationSTD = 0 - daydiff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,6 +474,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_EndDate == null){
|
||||
var dt = DateAndTime;
|
||||
if (dt.HasValue)
|
||||
{
|
||||
@@ -437,6 +494,23 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
return dt;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _EndDate;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
if (AreDifferent(_EndDate, value))
|
||||
{
|
||||
_EndDate = value;
|
||||
|
||||
|
||||
FirePropertyChanged(PropertyName_EndDate);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,18 +519,42 @@ namespace BeWo.ViewModel
|
||||
get { return String.Format("{0}", DataContract.ServiceRecordOid); }
|
||||
}
|
||||
|
||||
[Validation(ValidationRule = ValidationRules.GreaterThanOrEqualZero)]
|
||||
public int? Duration
|
||||
[Validation(ValidationRule = ValidationRules.GreaterThanOrEqualZero)]
|
||||
public int? Duration
|
||||
{
|
||||
get { return _Duration; }
|
||||
get
|
||||
{
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
return _Duration / 60;
|
||||
}
|
||||
|
||||
return _Duration;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value >= 0 && AreDifferent(_Duration, value))
|
||||
{
|
||||
Console.WriteLine("Change Duration " + value.Value);
|
||||
var newValue = value;
|
||||
|
||||
_Duration = value;
|
||||
//#################### So Ein Scheisss #################################
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden )
|
||||
{
|
||||
newValue *= 60;
|
||||
|
||||
}
|
||||
|
||||
if(_DurationInStunden == ZeiterfassungsDauer.Minuten )
|
||||
{
|
||||
newValue /= 60;
|
||||
|
||||
}
|
||||
//######################################################################
|
||||
|
||||
if (newValue >= 0 && AreDifferent(_Duration, newValue))
|
||||
{
|
||||
Console.WriteLine("Change Duration " + newValue.Value);
|
||||
|
||||
_Duration = newValue;
|
||||
|
||||
if (StartTime != null )
|
||||
{
|
||||
@@ -471,7 +569,7 @@ namespace BeWo.ViewModel
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
EndTime = StartTime.Value.AddMinutes(value.Value);
|
||||
EndTime = StartTime.Value.AddMinutes(newValue.Value);
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -488,18 +586,21 @@ namespace BeWo.ViewModel
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
TimeCheck();
|
||||
FirePropertyChanged(PropertyName_Duration);
|
||||
FirePropertyChanged(PropertyName_RoundedDuration);
|
||||
}
|
||||
|
||||
if (value < 0)
|
||||
}
|
||||
|
||||
if (newValue < 0)
|
||||
{
|
||||
Console.WriteLine("Kleiner 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string DurationAndRoundedDuration
|
||||
{
|
||||
get
|
||||
@@ -704,6 +805,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
set
|
||||
{
|
||||
DateTime neuerwert;
|
||||
|
||||
if (String.IsNullOrEmpty(value))
|
||||
EndTime = null;
|
||||
else
|
||||
@@ -715,11 +818,14 @@ namespace BeWo.ViewModel
|
||||
String dtStr = String.Format("{0:dd.MM.yyyy} {1}", endTime, value);
|
||||
DateTime dt;
|
||||
|
||||
|
||||
DateTime.TryParse(dtStr, out neuerwert);
|
||||
|
||||
if (DateTime.TryParse(dtStr, out dt))
|
||||
EndTime = dt;
|
||||
else
|
||||
EndTime = null;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -732,12 +838,73 @@ namespace BeWo.ViewModel
|
||||
String dtStr = String.Format("{0:dd.MM.yyyy} {1}", endTime, value);
|
||||
DateTime dt;
|
||||
|
||||
DateTime.TryParse(dtStr, out neuerwert);
|
||||
|
||||
if (DateTime.TryParse(dtStr, out dt))
|
||||
EndTime = dt;
|
||||
else
|
||||
EndTime = null;
|
||||
}
|
||||
|
||||
|
||||
var start = StartTime.Value;
|
||||
|
||||
//var diff = EndTime.Value.Subtract(start);
|
||||
var diff = neuerwert.Subtract(start);
|
||||
|
||||
|
||||
//Diese Stelle ist wichtig
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_Date.Value.Date == _EditableEndDate.Value.Date)
|
||||
{
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
if (diff.Hours > 0) // hier noch etwas genauer abfragen/ was ist wenn stunden ausgewählt und nur 30 min
|
||||
{
|
||||
DurationSTD = (int)diff.TotalHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
StartTime = neuerwert;
|
||||
DurationSTD = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (diff.Minutes > 0 || diff.Hours > 0)
|
||||
{
|
||||
DurationSTD = (int) diff.TotalMinutes;
|
||||
}
|
||||
else
|
||||
{
|
||||
StartTime = neuerwert;
|
||||
DurationSTD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
var x = (decimal) diff.TotalMinutes/60;
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
x = x * -1;
|
||||
}
|
||||
DurationSTD = (int)x;
|
||||
}
|
||||
else
|
||||
{
|
||||
DurationSTD = (int)diff.TotalMinutes;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -756,13 +923,180 @@ namespace BeWo.ViewModel
|
||||
set
|
||||
{
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
{
|
||||
|
||||
var olddate = _EditableEndDate;
|
||||
// if (_EditableEndDate != value){
|
||||
_EditableEndDate = value;
|
||||
|
||||
if (value < Date)
|
||||
{
|
||||
Date = value;
|
||||
}
|
||||
FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
|
||||
//Scheise muss gefixt werden nervt nähmlich schon
|
||||
|
||||
if (_EditableEndDate.Value.Date < _Date.Value.Date)
|
||||
{
|
||||
EditableEndDate = _Date;
|
||||
}
|
||||
|
||||
|
||||
if (StartTime != null && DurationSTD != 0)
|
||||
{
|
||||
//Muss unbeding bearbeitet werden
|
||||
var start = StartTime.Value;
|
||||
|
||||
|
||||
var diff = _EditableEndDate.Value.Subtract(start);
|
||||
|
||||
//Mann wie soll ich das den machen
|
||||
//DurationSTD = (int)diff.TotalMinutes;
|
||||
if (diff.TotalHours != 0 && diff.TotalDays > 0) // die abfrage könnte fail sein
|
||||
{
|
||||
//hier liegt immer noch das problem.
|
||||
//für die differenz startstunden mit endstunden vergleichen und zu diff total hinzuzählen
|
||||
|
||||
var diffhour = EndTime.Value.Hour - start.Hour;
|
||||
|
||||
|
||||
diffhour = diffhour*60;
|
||||
|
||||
if (olddate != _EditableEndDate && olddate > _EditableEndDate)
|
||||
{
|
||||
// decimal dura = DurationSTD.Value/1440;
|
||||
|
||||
// var x = olddate.Value.Day - _EditableEndDate.Value.Day;
|
||||
|
||||
//int daydiff = (int) x*1440;
|
||||
|
||||
|
||||
|
||||
//var ahh = _EndTime.Value.Subtract(start);
|
||||
|
||||
var ahh = _EndTime.Value.Subtract(_EditableEndDate.Value);
|
||||
// var x = ahh.Days -
|
||||
|
||||
int s = 0;
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
// s = (int)ahh.Hours;
|
||||
s = ahh.Days*24;
|
||||
}
|
||||
else
|
||||
{
|
||||
// s = (int)ahh.Minutes;
|
||||
s = ahh.Days*1440;
|
||||
}
|
||||
|
||||
|
||||
//if (s < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
//{
|
||||
// s = s * -1;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
DurationSTD = DurationSTD - s;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// DurationSTD = DurationSTD.Value - daydiff;
|
||||
|
||||
}
|
||||
else if (olddate != _EditableEndDate && olddate < _EditableEndDate)
|
||||
{
|
||||
var x = olddate.Value.Day - _EditableEndDate.Value.Day;
|
||||
|
||||
int daydiff = (int)x * 1440;
|
||||
|
||||
if (daydiff < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
{
|
||||
daydiff = daydiff * -1;
|
||||
}
|
||||
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
daydiff = daydiff/60;
|
||||
|
||||
DurationSTD = DurationSTD.Value + daydiff;
|
||||
}
|
||||
else
|
||||
{
|
||||
DurationSTD = DurationSTD.Value + daydiff;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (olddate.Value.Date < _Date.Value.Date)
|
||||
{
|
||||
DurationSTD = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// dieser bereich muss kurz bearbeitet werden.
|
||||
// var ahh = _EndTime.Value.Subtract(start);
|
||||
|
||||
int s = 0;
|
||||
|
||||
var ahh = _EndTime.Value.Subtract(_EditableEndDate.Value);
|
||||
|
||||
if(_DurationInStunden == ZeiterfassungsDauer.Stunden){
|
||||
// s = (int)ahh.Hours;
|
||||
s = s + (ahh.Days * 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
s = (ahh.Days * 1440);
|
||||
}
|
||||
|
||||
|
||||
//if (s < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
//{
|
||||
// s = s*-1;
|
||||
//}
|
||||
|
||||
|
||||
DurationSTD = DurationSTD - s;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
StartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0);
|
||||
|
||||
_EditableEndDate.Value.AddHours(StartTime.Value.Hour);
|
||||
|
||||
|
||||
var stx = _EditableEndDate.Value.Day - StartTime.Value.Day;
|
||||
|
||||
int daydiff = stx*1440;
|
||||
|
||||
|
||||
|
||||
if (_EditableEndDate.Value.Date < _Date.Value.Date)
|
||||
{
|
||||
DurationSTD = 0;
|
||||
}
|
||||
|
||||
//DurationSTD = daydiff;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -803,16 +1137,28 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_StartTime.Value.Second != 0)
|
||||
if (_StartTime.Value.Date == null)
|
||||
{
|
||||
StartTime = new DateTime(StartTime.Value.Year, StartTime.Value.Month, StartTime.Value.Day, StartTime.Value.Hour, 0, 0);
|
||||
}
|
||||
|
||||
var start = new DateTime(StartTime.Value.Year, StartTime.Value.Month, StartTime.Value.Day, StartTime.Value.Hour, StartTime.Value.Minute, 0);
|
||||
//var start = new DateTime(StartTime.Value.Year, StartTime.Value.Month, StartTime.Value.Day, StartTime.Value.Hour, StartTime.Value.Minute, 0);
|
||||
|
||||
var diff = _EndTime.Value.Subtract(start);
|
||||
var diff = _EndTime.Value.Subtract(_StartTime.Value);
|
||||
|
||||
Duration = (int)diff.TotalMinutes;
|
||||
|
||||
|
||||
|
||||
if(_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
var x = (decimal) diff.TotalMinutes / 60;
|
||||
DurationSTD = (int)x;
|
||||
}
|
||||
else
|
||||
{
|
||||
DurationSTD = (int)diff.TotalHours;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -826,9 +1172,25 @@ namespace BeWo.ViewModel
|
||||
var diff = _EndTime.Value.Subtract(start);
|
||||
|
||||
Duration = (int)diff.TotalMinutes;
|
||||
|
||||
|
||||
//hier abfragen welche zeiterfassung art es ist um die auer ensprechend anzuzeigen
|
||||
//if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
//{
|
||||
// DurationSTD = (int)diff.TotalMinutes;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// DurationSTD = (int)diff.TotalMinutes % 60;
|
||||
//}
|
||||
|
||||
DurationSTD = (int)diff.TotalMinutes;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//TimeCheck();
|
||||
// TimeCheckForDurationSTD(false, null);
|
||||
FirePropertyChanged(PropertyName_EndTime);
|
||||
}
|
||||
}
|
||||
@@ -1245,6 +1607,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
set
|
||||
{
|
||||
var oldStartime = _StartTime;
|
||||
DateTime? newStartTime = value ?? NULL_TIME;
|
||||
|
||||
Console.WriteLine("Change StartTime " + newStartTime.Value.ToShortTimeString());
|
||||
@@ -1270,6 +1633,24 @@ namespace BeWo.ViewModel
|
||||
|
||||
diff = end.Subtract(_StartTime.Value);
|
||||
Duration = (int) diff.TotalMinutes;
|
||||
|
||||
|
||||
//hier abfragen welche zeiterfassung art es ist um die auer ensprechend anzuzeigen
|
||||
//if(_DurationInStunden == ZeiterfassungsDauer.Minuten){
|
||||
// DurationSTD = (int) diff.TotalMinutes;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// DurationSTD = (int)diff.TotalMinutes % 60;
|
||||
//}
|
||||
|
||||
|
||||
decimal x = DurationSTD.Value / 1440;
|
||||
|
||||
var y = (int) 1440 * x;
|
||||
|
||||
DurationSTD = (int)diff.TotalMinutes + (int)y;
|
||||
|
||||
}
|
||||
else if (Duration != null)
|
||||
{
|
||||
@@ -1277,7 +1658,8 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
TimeCheck();
|
||||
// TimeCheck();
|
||||
// TimeCheckForDurationSTD(false,null);
|
||||
FirePropertyChanged(PropertyName_StartTime);
|
||||
}
|
||||
}
|
||||
@@ -1330,8 +1712,76 @@ namespace BeWo.ViewModel
|
||||
get { return ServiceRecordType == ServiceRecordTypeId.DefaultActivity; }
|
||||
|
||||
set { ServiceRecordType = value ? ServiceRecordTypeId.DefaultActivity : ServiceRecordTypeId.Content; }
|
||||
}
|
||||
|
||||
public ZeiterfassungsDauer? DurationInStunden
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_DurationInStunden == null)
|
||||
{
|
||||
_DurationInStunden = ZeiterfassungsDauer.Minuten;
|
||||
|
||||
return _DurationInStunden;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _DurationInStunden;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
|
||||
if (value == ZeiterfassungsDauer.Minuten && _DurationInStunden == ZeiterfassungsDauer.Stunden && _DurationSTD != null)
|
||||
{
|
||||
DurationSTD = _DurationSTD * 60;
|
||||
|
||||
}
|
||||
else if (value == ZeiterfassungsDauer.Stunden && _DurationInStunden == ZeiterfassungsDauer.Minuten && _DurationSTD != null && _DurationSTD >= 60)
|
||||
{
|
||||
DurationSTD = _DurationSTD / 60;
|
||||
}
|
||||
|
||||
if (AreDifferent(_DurationInStunden, value))
|
||||
{
|
||||
_DurationInStunden = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.DurationInStunden, value), PropertyName_DurationInStunden);
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationInStunden);
|
||||
FirePropertyChanged(PropertyName_DurationSTD);
|
||||
|
||||
TimeCheckForDurationSTD(_DurationInStunden);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Validation(ValidationRule = ValidationRules.GreaterThanOrEqualZero)]
|
||||
public int? DurationSTD
|
||||
{
|
||||
get
|
||||
{
|
||||
return _DurationSTD;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (AreDifferent(_DurationSTD, value))
|
||||
{
|
||||
_DurationSTD = value;
|
||||
|
||||
StoreDirtyInformation(AreDifferent(DataContract.RoundedDuration, value), PropertyName_DurationSTD);
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationSTD);
|
||||
//FirePropertyChanged(PropertyName_RoundedDuration);
|
||||
//Timecheck vollführen
|
||||
TimeCheckForDurationSTD(_DurationInStunden);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
@@ -1445,6 +1895,9 @@ namespace BeWo.ViewModel
|
||||
copy.GroupOid = GroupOid;
|
||||
copy.GroupRoundedDuration = GroupRoundedDuration;
|
||||
|
||||
//??
|
||||
copy.DurationInStunden = DurationInStunden;
|
||||
|
||||
copy.SelectedGoals.Clear();
|
||||
foreach (var item in SelectedGoals)
|
||||
{
|
||||
@@ -1467,7 +1920,7 @@ namespace BeWo.ViewModel
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
|
||||
protected override void InitByDataContract(ServiceRecordDC pDataContract)
|
||||
{
|
||||
if (pDataContract.ServiceDescription != null)
|
||||
@@ -1528,6 +1981,8 @@ namespace BeWo.ViewModel
|
||||
_ServiceRecordType = pDataContract.ServiceRecordType;
|
||||
_DistanceInMeter = pDataContract.DistanceInMeter;
|
||||
|
||||
_DurationInStunden = pDataContract.DurationInStunden;
|
||||
|
||||
if (pDataContract.Goals != null)
|
||||
{
|
||||
_SelectedGoals = new ObservableSortCollection<ValueListEntryDC>(pDataContract.Goals, Comparer.ValueListEntryDCComparer);
|
||||
@@ -1567,27 +2022,28 @@ namespace BeWo.ViewModel
|
||||
|
||||
pDataContract.Start = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second);
|
||||
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_EndTime == null || _EndTime.Value.Date < pDataContract.Start.Value.Date)
|
||||
{
|
||||
_EndTime = pDataContract.Start;
|
||||
}
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_EndTime == null || _EndTime.Value.Date < pDataContract.Start.Value.Date)
|
||||
{
|
||||
_EndTime = pDataContract.Start;
|
||||
}
|
||||
|
||||
if (_EndTime == null || pDataContract.Start.Value.Date == _EndTime.Value.Date)
|
||||
{
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
pDataContract.End = new DateTime(_EndTime.Value.Year, _EndTime.Value.Month, _EndTime.Value.Day, _EndTime.Value.Hour, _EndTime.Value.Minute, _EndTime.Value.Second);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
}
|
||||
if (_EndTime == null || pDataContract.Start.Value.Date == _EndTime.Value.Date)
|
||||
{
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
pDataContract.End = new DateTime(_EndTime.Value.Year, _EndTime.Value.Month, _EndTime.Value.Day, _EndTime.Value.Hour, _EndTime.Value.Minute, _EndTime.Value.Second);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
}
|
||||
|
||||
|
||||
pDataContract.Notice = _Notice;
|
||||
pDataContract.Notice2 = _Notice2;
|
||||
pDataContract.Notice3 = _Notice3;
|
||||
@@ -1596,6 +2052,8 @@ namespace BeWo.ViewModel
|
||||
pDataContract.ServiceRecordType = _ServiceRecordType;
|
||||
pDataContract.DistanceInMeter = _DistanceInMeter;
|
||||
|
||||
pDataContract.DurationInStunden = _DurationInStunden;
|
||||
|
||||
pDataContract.Employee = _Employee;
|
||||
pDataContract.Customer = _Customer;
|
||||
pDataContract.SupportConcept = _SupportConcept;
|
||||
@@ -1653,6 +2111,141 @@ namespace BeWo.ViewModel
|
||||
AreDifferent(DataContract.Start,_Date.Value + _StartTime.Value.TimeOfDay), "TIME");
|
||||
}
|
||||
|
||||
private void TimeCheckForDurationSTD(ZeiterfassungsDauer? art)
|
||||
{
|
||||
var duration = 0;
|
||||
if (_DurationSTD.HasValue)
|
||||
{
|
||||
duration = _DurationSTD.Value;
|
||||
}
|
||||
|
||||
if (_EditableEndDate.Value.Date < _Date.Value.Date)
|
||||
{
|
||||
duration = 0;
|
||||
}
|
||||
|
||||
StoreDirtyInformation(
|
||||
AreDifferent(DataContract.End, (_Date.Value + _StartTime.Value.TimeOfDay).AddMinutes(duration)) ||
|
||||
AreDifferent(DataContract.Start, _Date.Value + _StartTime.Value.TimeOfDay), "TIME");
|
||||
|
||||
|
||||
if (art != null)
|
||||
{
|
||||
if (art == ZeiterfassungsDauer.Stunden)
|
||||
duration = duration * 60;
|
||||
}
|
||||
|
||||
|
||||
if(_StartTime.HasValue){
|
||||
if (_StartTime.Value.Year == 2000)
|
||||
{
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, DateTime.Now.Hour, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (_StartTime != null)
|
||||
{
|
||||
_EndTime = _StartTime.Value.AddMinutes(duration);
|
||||
}
|
||||
|
||||
if (_StartTime == null && _EndTime == null)
|
||||
{
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, DateTime.Now.Hour, 0, 0); // DateTime.now Year / Month / day
|
||||
_EndTime = _StartTime.Value.AddMinutes(duration);
|
||||
}
|
||||
|
||||
if (_StartTime == null && _EndTime != null)
|
||||
{
|
||||
duration = duration * -1;
|
||||
|
||||
_StartTime = _EndTime.Value.AddMinutes(duration);
|
||||
}
|
||||
|
||||
//Hier TimeCheck für das enddatum falls aktiv
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
int eintag = 0; // hier der tagessatz
|
||||
var adddays = 0;
|
||||
|
||||
if (art == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
eintag = 1440;
|
||||
|
||||
}else if (art == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
eintag = 24;
|
||||
duration = duration/60;
|
||||
}
|
||||
|
||||
|
||||
if (duration == 0 || (_EndTime.Value.Date <= _EditableEndDate.Value.Date && duration < eintag)) // EditableEnddate hat die 11 dabei ist die date_time 10
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}else
|
||||
if (duration >= eintag)
|
||||
{
|
||||
|
||||
decimal dura = duration / eintag;
|
||||
|
||||
var x = (double) dura;
|
||||
|
||||
var zwischen = _EndTime.Value.Subtract(EditableEndDate.Value);
|
||||
|
||||
double eee = 0;
|
||||
|
||||
if (art == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
eee = zwischen.TotalMinutes;
|
||||
}
|
||||
else if(art == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
eee = zwischen.TotalMinutes;
|
||||
}
|
||||
|
||||
if(_EndTime.Value.Hour > 0 && _EndTime.Value.Date != EditableEndDate.Value.Date && x <= eee )
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(x+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(x);
|
||||
}
|
||||
}
|
||||
else if (EditableEndDate.Value.Date >= _Date.Value.Date && duration < 1440 && art != ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
if (_EndTime.Value.Date != _EditableEndDate.Value.Date && _EndTime.Value.Date < _EditableEndDate.Value.Date) //man warum 10 != 9 deswegen kommt der rein // die abfrage muss verbessert werden
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(1);
|
||||
|
||||
}else{
|
||||
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}
|
||||
}
|
||||
else if (EditableEndDate.Value.Date >= _Date.Value.Date && duration < 24 && art != ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
|
||||
if (_EndTime.Value.Date != _EditableEndDate.Value.Date && _EndTime.Value.Date < _EditableEndDate.Value.Date )
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(1);
|
||||
|
||||
}else{
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FirePropertyChanged(PropertyName_StartTime);
|
||||
FirePropertyChanged(PropertyName_EndTime);
|
||||
FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
// FirePropertyChanged(PropertyName_EndDate);
|
||||
// FirePropertyChanged(PropertyName_DurationSTD);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,8 @@ namespace BeWo.Data.Entities
|
||||
|
||||
public static string PropertyName_WohnheimbuchungsOid = "WohnheimbuchungsOid";
|
||||
|
||||
public static string PropertyName_DurationInStunden = "DurationInStunden";
|
||||
|
||||
private long? _WohnheimbuchungsOid;
|
||||
|
||||
private bool _isCreatedInMobileClient;
|
||||
@@ -94,6 +96,8 @@ namespace BeWo.Data.Entities
|
||||
|
||||
public virtual int? Relevance { get; set; }
|
||||
|
||||
private ZeiterfassungsDauer? _DurationInStunden;
|
||||
|
||||
|
||||
public virtual bool IsCreatedInMobileClient
|
||||
{
|
||||
@@ -532,5 +536,22 @@ namespace BeWo.Data.Entities
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual ZeiterfassungsDauer? DurationInStunden
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DurationInStunden;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._DurationInStunden, value))
|
||||
{
|
||||
this._DurationInStunden = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
<property column="Notice3" type="String" name="Notice3" length="1024" />
|
||||
<property column="Notice4" type="String" name="Notice4" length="1024" />
|
||||
<property column="Notice5" type="String" name="Notice5" length="1024" />
|
||||
<property column="DurationInStunden" type="BS.Shared.ZeiterfassungsDauer, BS.Shared" name="DurationInStunden" />
|
||||
|
||||
<many-to-one name="Group" column="GroupOid" class="BeWo.Data.Entities.ServiceRecordGroup,BeWo.Data" cascade="none" />
|
||||
<many-to-one name="Employee" column="EmployeeOid" class="BeWo.Data.Entities.Employee,BeWo.Data" cascade="none" />
|
||||
|
||||
@@ -27,6 +27,18 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.SignatureOid = pEntity.SignatureOid;
|
||||
pDataContract.ServiceRecordType = pEntity.ServiceRecordType ?? ServiceRecordTypeId.DefaultActivity;
|
||||
|
||||
|
||||
if (pEntity.DurationInStunden != null)
|
||||
{
|
||||
pDataContract.DurationInStunden = pEntity.DurationInStunden;
|
||||
}
|
||||
else
|
||||
{
|
||||
pDataContract.DurationInStunden = ZeiterfassungsDauer.Minuten;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (pEntity.ServiceDescription != null)
|
||||
{
|
||||
pDataContract.ServiceDescription = MapperFactory.ServiceDescriptionDC_ServiceDescription.MapToNewDC(pEntity.ServiceDescription);
|
||||
@@ -102,6 +114,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.GroupRoundedDuration = pDataContract.GroupRoundedDuration;
|
||||
pEntity.ServiceRecordType = pDataContract.ServiceRecordType;
|
||||
|
||||
pEntity.DurationInStunden = pDataContract.DurationInStunden;
|
||||
|
||||
pEntity.IP = pDataContract.IP;
|
||||
|
||||
if (pEntity.ServiceDescription == null || pEntity.ServiceDescription.Oid != pDataContract.ServiceDescription.ServiceDescriptionOid)
|
||||
|
||||
@@ -887,4 +887,10 @@ namespace BS.Shared
|
||||
Mittelmass,
|
||||
Stark
|
||||
}
|
||||
|
||||
public enum ZeiterfassungsDauer
|
||||
{
|
||||
Minuten,
|
||||
Stunden
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,8 @@ namespace BS.Shared.Core
|
||||
|
||||
public static Dictionary<Enum, String> AllTranslations;
|
||||
|
||||
public static Dictionary<object, String>ZeiterfassungsDauerTranslations;
|
||||
|
||||
static EnumTranslations()
|
||||
{
|
||||
#region UserRightType2Translations
|
||||
@@ -611,8 +613,23 @@ namespace BS.Shared.Core
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region ServiceRecordTimeIntervalTranslations
|
||||
ServiceRecordTimeIntervalTranslations = new Dictionary<object, String>
|
||||
#region ZeiterfassungsDauerTranslations
|
||||
|
||||
ZeiterfassungsDauerTranslations = new Dictionary<object, String>
|
||||
{
|
||||
{
|
||||
ZeiterfassungsDauer.Minuten, "Minuten"
|
||||
},
|
||||
{
|
||||
ZeiterfassungsDauer.Stunden, "Stunden"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region ServiceRecordTimeIntervalTranslations
|
||||
ServiceRecordTimeIntervalTranslations = new Dictionary<object, String>
|
||||
{
|
||||
{
|
||||
ServiceRecordTimeInterval.LastWeek, "Letzten 7 Tage"
|
||||
|
||||
@@ -100,5 +100,10 @@ namespace BS.Shared.DataContracts
|
||||
public long? WohnheimbuchungsOid { get; set; }
|
||||
|
||||
public bool AlreadyAccounted { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public ZeiterfassungsDauer? DurationInStunden { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user