2024-11-13 20:44:01 +01:00
|
|
|
|
using FirmTracker_Server.Entities;
|
|
|
|
|
|
|
|
|
|
namespace FirmTracker_Server.nHibernate
|
|
|
|
|
{
|
|
|
|
|
public class Workday
|
|
|
|
|
{
|
|
|
|
|
public virtual int Id { get; set; }
|
|
|
|
|
public virtual DateTime StartTime { get; set; }
|
|
|
|
|
public virtual DateTime? EndTime { get; set; } // Nullable EndTime, if not finished
|
2024-11-26 22:12:02 +01:00
|
|
|
|
public virtual TimeSpan WorkedHours
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
// Calculate the worked hours, using 5 PM as the fallback for the EndTime
|
|
|
|
|
return (EndTime ?? DateTime.Today.AddHours(24)) - StartTime;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public virtual User User { get; set; }
|
2024-12-04 23:35:36 +01:00
|
|
|
|
public virtual string Absence { get; set; }
|
2024-11-13 20:44:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|