Skip to content

Commit e2fb465

Browse files
committed
wip
1 parent 13a728e commit e2fb465

5 files changed

Lines changed: 7 additions & 10 deletions

File tree

ShiftSharp/Named.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public abstract class Named
3838
// description
3939
private string description;
4040

41-
// database primary key
42-
private int primaryKey;
43-
4441
protected Named()
4542
{
4643

ShiftSharp/NonWorkingPeriod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void SetStartDateTime(LocalDateTime startDateTime)
8181
/// <returns>Period end</returns>
8282
public LocalDateTime GetEndDateTime()
8383
{
84-
return startDateTime.PlusSeconds(duration.Seconds);
84+
return startDateTime.PlusSeconds((long)duration.TotalSeconds);
8585
}
8686

8787
/// <summary>
@@ -99,7 +99,7 @@ public Duration GetDuration()
9999
/// <param name="duration">Duration</param>
100100
public void SetDuration(Duration duration)
101101
{
102-
if (duration == null || duration.Seconds == 0)
102+
if (duration == null || duration.TotalSeconds == 0)
103103
{
104104
throw new Exception(WorkSchedule.GetMessage("duration.not.defined"));
105105
}

ShiftSharp/ShiftInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Team GetTeam()
9797
*/
9898
public int CompareTo(ShiftInstance other)
9999
{
100-
throw new NotImplementedException();
100+
return GetStartTime().CompareTo(other.GetStartTime());
101101
}
102102

103103
/**

ShiftSharp/ShiftSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<None Include="packages.config" />
6565
</ItemGroup>
6666
<ItemGroup>
67-
<Folder Include="NewFolder1\" />
67+
<Folder Include="Resources\" />
6868
</ItemGroup>
6969
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7070
</Project>

ShiftSharp/TimePeriod.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ public Duration GetDuration()
6666
/// <param name="duration">Duration</param>
6767
public void SetDuration(Duration duration)
6868
{
69-
if (duration == null || duration.Seconds == 0)
69+
if (duration == null || duration.TotalSeconds == 0)
7070
{
7171
throw new Exception(WorkSchedule.GetMessage("duration.not.defined"));
7272
}
7373

74-
if (duration.Seconds > SECONDS_PER_DAY)
74+
if (duration.TotalSeconds > SECONDS_PER_DAY)
7575
{
7676
throw new Exception(WorkSchedule.GetMessage("duration.not.allowed"));
7777
}
@@ -106,7 +106,7 @@ public void SetStart(LocalTime startTime)
106106
/// <returns>Period end time</returns>
107107
public LocalTime GetEnd()
108108
{
109-
return startTime.PlusSeconds(duration.Seconds);
109+
return startTime.PlusSeconds((long)duration.TotalSeconds);
110110
}
111111

112112
// breaks are considered to be in the shift's working period

0 commit comments

Comments
 (0)