Files
BeWoPlaner/BeWoPlanerMobil/Util/SchedulerUtils/EmployeeAvailabilityObject.cs

25 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
namespace BeWoPlanerMobil.Util.SchedulerUtils
{
public class EmployeeAvailabilityObject
{
public DateTime IntervalStart { get; set; }
public DateTime IntervalEnd { get; set; }
public Dictionary<CompactEmployeeDC, decimal> Employee2Overtime { get; set; }
public string IntervalStartStr => IntervalStart.IsTimeZero() ? $"{IntervalStart:dd.MM.yy}" : $"{IntervalStart:dd.MM.yy HH:mm}";
public string IntervalEndStr => IntervalEnd.IsTimeZero() ? $"{IntervalEnd:dd.MM.yy}" : $"{IntervalEnd:dd.MM.yy HH:mm}";
public EmployeeAvailabilityObject(DateTime intervalStart, DateTime intervalEnd, Dictionary<CompactEmployeeDC, decimal> employee2Overtime)
{
IntervalStart = intervalStart;
IntervalEnd = intervalEnd;
Employee2Overtime = employee2Overtime.OrderBy(kvp => kvp.Key.DetailDescription).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
}
}
}