-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-312 Contingent views except for vacant places are empty
- Loading branch information
1 parent
366f6f6
commit 51a12b6
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 (); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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) | ||
|
@@ -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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -50,6 +50,7 @@ public IEnumerable<EduProgramProfileFormYearInfo> ListByDivisionAndEduLevels (IE | |
.WhereEduLevelsOrAll (eduLevelIds) | ||
.WhereDivisionOrAll (divisionId, divisionLevel) | ||
.DefaultOrder () | ||
.ThenByDescending (eppfy => eppfy.Year.Year) | ||
.ToList (); | ||
} | ||
} | ||
|