22{
33 using System ;
44 using System . Linq ;
5- using DigitalLearningSolutions . Data . DataServices ;
6- using DigitalLearningSolutions . Data . DataServices . UserDataService ;
75 using DigitalLearningSolutions . Data . Enums ;
86 using DigitalLearningSolutions . Data . Helpers ;
97 using DigitalLearningSolutions . Data . Models . SearchSortFilterPaginate ;
@@ -29,29 +27,29 @@ public class AllDelegatesController : Controller
2927 {
3028 private string DelegateFilterCookieName = "DelegateFilter" ;
3129 private readonly IDelegateDownloadFileService delegateDownloadFileService ;
32- private readonly IJobGroupsDataService jobGroupsDataService ;
30+ private readonly IJobGroupsService jobGroupsService ;
3331 private readonly PromptsService promptsService ;
3432 private readonly IPaginateService paginateService ;
35- private readonly IUserDataService userDataService ;
33+ private readonly IUserService userService ;
3634 private readonly IGroupsService groupsService ;
3735 private readonly IConfiguration configuration ;
3836 private readonly IWebHostEnvironment env ;
3937
4038 public AllDelegatesController (
4139 IDelegateDownloadFileService delegateDownloadFileService ,
42- IUserDataService userDataService ,
40+ IUserService userDataService ,
4341 PromptsService promptsService ,
44- IJobGroupsDataService jobGroupsDataService ,
42+ IJobGroupsService jobGroupsDataService ,
4543 IPaginateService paginateService ,
4644 IGroupsService groupsService ,
4745 IConfiguration configuration ,
4846 IWebHostEnvironment env
4947 )
5048 {
5149 this . delegateDownloadFileService = delegateDownloadFileService ;
52- this . userDataService = userDataService ;
50+ this . userService = userDataService ;
5351 this . promptsService = promptsService ;
54- this . jobGroupsDataService = jobGroupsDataService ;
52+ this . jobGroupsService = jobGroupsDataService ;
5553 this . paginateService = paginateService ;
5654 this . groupsService = groupsService ;
5755 this . configuration = configuration ;
@@ -72,7 +70,7 @@ public IActionResult Index(
7270 )
7371 {
7472 searchString = searchString == null ? string . Empty : searchString . Trim ( ) ;
75- var loggedInSuperAdmin = userDataService . GetAdminById ( User . GetAdminId ( ) ! . Value ) ;
73+ var loggedInSuperAdmin = userService . GetAdminById ( User . GetAdminId ( ) ! . Value ) ;
7674 if ( loggedInSuperAdmin . AdminAccount . Active == false )
7775 {
7876 return NotFound ( ) ;
@@ -94,7 +92,7 @@ public IActionResult Index(
9492 int offSet = ( ( page - 1 ) * itemsPerPage ) ?? 0 ;
9593
9694 var centreId = User . GetCentreIdKnownNotNull ( ) ;
97- var jobGroups = jobGroupsDataService . GetJobGroupsAlphabetical ( ) ;
95+ var jobGroups = jobGroupsService . GetJobGroupsAlphabetical ( ) ;
9896 var customPrompts = promptsService . GetCentreRegistrationPrompts ( centreId ) . ToList ( ) ;
9997 var groups = groupsService . GetActiveGroups ( centreId ) ;
10098
@@ -197,14 +195,14 @@ public IActionResult Index(
197195 }
198196 }
199197
200- ( var delegates , var resultCount ) = this . userDataService . GetDelegateUserCards ( searchString ?? string . Empty , offSet , itemsPerPage ?? 0 , sortBy , sortDirection , centreId ,
198+ ( var delegates , var resultCount ) = this . userService . GetDelegateUserCards ( searchString ?? string . Empty , offSet , itemsPerPage ?? 0 , sortBy , sortDirection , centreId ,
201199 isActive , isPasswordSet , isAdmin , isUnclaimed , isEmailVerified , registrationType , jobGroupId , groupId ,
202200 answer1 , answer2 , answer3 , answer4 , answer5 , answer6 ) ;
203201
204202 if ( delegates . Count ( ) == 0 && resultCount > 0 )
205203 {
206204 page = 1 ; offSet = 0 ;
207- ( delegates , resultCount ) = this . userDataService . GetDelegateUserCards ( searchString ?? string . Empty , offSet , itemsPerPage ?? 0 , sortBy , sortDirection , centreId ,
205+ ( delegates , resultCount ) = this . userService . GetDelegateUserCards ( searchString ?? string . Empty , offSet , itemsPerPage ?? 0 , sortBy , sortDirection , centreId ,
208206 isActive , isPasswordSet , isAdmin , isUnclaimed , isEmailVerified , registrationType , jobGroupId , groupId ,
209207 answer1 , answer2 , answer3 , answer4 , answer5 , answer6 ) ;
210208 }
0 commit comments