Skip to content

Commit

Permalink
GH-312 Contingent views except for vacant places are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-yagodin committed May 15, 2019
1 parent 366f6f6 commit 51a12b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R7.University.EduProgramProfiles/Queries/ContingentQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Author:
// Roman M. Yagodin <[email protected]>
//
// Copyright (c) 2017-2018 Roman M. Yagodin
// Copyright (c) 2017-2019 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -45,10 +45,10 @@ public IEnumerable<EduProgramProfileFormYearInfo> ListByDivisionAndEduLevels (IE
.Include2 (eppfy => eppfy.EduForm)
.Include2 (eppfy => eppfy.Contingent)
.Include2 (eppfy => eppfy.Year)
.Where (eppfy => eppfy.Year != null)
.WhereEduLevelsOrAll (eduLevelIds)
.WhereDivisionOrAll (divisionId, divisionLevel)
.DefaultOrder ()
.ThenByDescending (ev => ev.Year != null ? ev.Year.Year : int.MaxValue)
.ToList ();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Author:
// Roman M. Yagodin <[email protected]>
//
// Copyright (c) 2017-2018 Roman M. Yagodin
// Copyright (c) 2017-2019 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -51,7 +51,7 @@ public static IQueryable<EduProgramProfileFormYearInfo> WhereDivisionOrAll (this
return eduProgramProfileFormYears;
}

public static IQueryable<EduProgramProfileFormYearInfo> DefaultOrder (this IQueryable<EduProgramProfileFormYearInfo> source)
public static IOrderedQueryable<EduProgramProfileFormYearInfo> DefaultOrder (this IQueryable<EduProgramProfileFormYearInfo> source)
{
return source.OrderBy (ev => ev.EduProgramProfile.EduProgram.EduLevel.SortIndex)
.ThenBy (ev => ev.EduProgramProfile.EduProgram.Code)
Expand All @@ -61,8 +61,7 @@ public static IQueryable<EduProgramProfileFormYearInfo> DefaultOrder (this IQuer
// SQL-compatible PadLeft (10, '0') equivalent
+ ("0000000000" + ev.EduProgramProfile.EduLevel.SortIndex.ToString ())
.Substring (ev.EduProgramProfile.EduLevel.SortIndex.ToString ().Length))
.ThenBy (ev => ev.EduForm.SortIndex)
.ThenByDescending (ev => ev.Year.Year);
.ThenBy (ev => ev.EduForm.SortIndex);
}
}
}
3 changes: 2 additions & 1 deletion R7.University.EduProgramProfiles/Queries/EduVolumeQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Author:
// Roman M. Yagodin <[email protected]>
//
// Copyright (c) 2017-2018 Roman M. Yagodin
// Copyright (c) 2017-2019 Roman M. Yagodin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -50,6 +50,7 @@ public IEnumerable<EduProgramProfileFormYearInfo> ListByDivisionAndEduLevels (IE
.WhereEduLevelsOrAll (eduLevelIds)
.WhereDivisionOrAll (divisionId, divisionLevel)
.DefaultOrder ()
.ThenByDescending (eppfy => eppfy.Year.Year)
.ToList ();
}
}
Expand Down

0 comments on commit 51a12b6

Please sign in to comment.