50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using BeWo.Service.Plugins;
|
|
using BS.Shared.DataContracts;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace KollegiumEv.Service
|
|
{
|
|
public class CustomVacationService: VacationService
|
|
{
|
|
public override decimal UrlaubstageRunden(decimal urlaubstage)
|
|
{
|
|
if (urlaubstage - (int)urlaubstage <= 0.1m)
|
|
{
|
|
urlaubstage = Math.Round(urlaubstage, MidpointRounding.AwayFromZero);
|
|
}
|
|
else if (urlaubstage - (int)urlaubstage <= 0.5m)
|
|
{
|
|
decimal digits = urlaubstage - (int)urlaubstage;
|
|
|
|
// aufrunden auf halbe Tage rausgenommen
|
|
urlaubstage = urlaubstage - digits;
|
|
}
|
|
else if (urlaubstage - (int)urlaubstage <= 1.0m)
|
|
{
|
|
urlaubstage = Math.Ceiling(urlaubstage);
|
|
}
|
|
|
|
return urlaubstage;
|
|
}
|
|
|
|
public override DateTime GetFirstEnd(DateTime? end, DateTime expiration)
|
|
{
|
|
return end.Value;
|
|
}
|
|
|
|
public override List<FeiertagDC> GetFeiertage(int year, string bundesland)
|
|
{
|
|
var list = base.GetFeiertage(year, bundesland);
|
|
|
|
if (year >= 2025)
|
|
list.Add(new FeiertagDC() { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
|
|
|
|
return list;
|
|
}
|
|
}
|
|
}
|