11namespace DigitalLearningSolutions . Web . Controllers . LearningSolutions
22{
33 using DigitalLearningSolutions . Data . Constants ;
4- using DigitalLearningSolutions . Data . DataServices ;
54 using DigitalLearningSolutions . Data . Models . Supervisor ;
65 using DigitalLearningSolutions . Data . Utilities ;
76 using DigitalLearningSolutions . Web . Attributes ;
@@ -20,27 +19,24 @@ namespace DigitalLearningSolutions.Web.Controllers.LearningSolutions
2019
2120 public class LearningSolutionsController : Controller
2221 {
23- private readonly ICentresDataService centresDataService ;
2422 private readonly ICentresService centresService ;
25- private readonly IConfigDataService configDataService ;
23+ private readonly IConfigService configService ;
2624 private readonly ILogger < LearningSolutionsController > logger ;
2725
2826 public LearningSolutionsController (
29- IConfigDataService configDataService ,
27+ IConfigService configService ,
3028 ILogger < LearningSolutionsController > logger ,
31- ICentresDataService centresDataService ,
3229 ICentresService centresService
3330 )
3431 {
35- this . configDataService = configDataService ;
32+ this . configService = configService ;
3633 this . logger = logger ;
37- this . centresDataService = centresDataService ;
3834 this . centresService = centresService ;
3935 }
4036
4137 public IActionResult AccessibilityHelp ( )
4238 {
43- var accessibilityText = configDataService . GetConfigValue ( ConfigConstants . AccessibilityHelpText ) ;
39+ var accessibilityText = configService . GetConfigValue ( ConfigConstants . AccessibilityHelpText ) ;
4440 if ( accessibilityText == null )
4541 {
4642 logger . LogError ( "Accessibility text from Config table is null" ) ;
@@ -50,7 +46,7 @@ public IActionResult AccessibilityHelp()
5046 DateTime lastUpdatedDate = DateTime . Now ;
5147 DateTime nextReviewDate = DateTime . Now ;
5248
53- lastUpdatedDate = configDataService . GetConfigLastUpdated ( ConfigConstants . AccessibilityHelpText ) ;
49+ lastUpdatedDate = configService . GetConfigLastUpdated ( ConfigConstants . AccessibilityHelpText ) ;
5450 nextReviewDate = lastUpdatedDate . AddYears ( 3 ) ;
5551
5652 var model = new AccessibilityHelpViewModel ( accessibilityText , lastUpdatedDate , nextReviewDate ) ;
@@ -59,7 +55,7 @@ public IActionResult AccessibilityHelp()
5955
6056 public IActionResult Terms ( )
6157 {
62- var termsText = configDataService . GetConfigValue ( ConfigConstants . TermsText ) ;
58+ var termsText = configService . GetConfigValue ( ConfigConstants . TermsText ) ;
6359 if ( termsText == null )
6460 {
6561 logger . LogError ( "Terms text from Config table is null" ) ;
@@ -68,15 +64,15 @@ public IActionResult Terms()
6864 DateTime lastUpdatedDate = DateTime . Now ;
6965 DateTime nextReviewDate = DateTime . Now ;
7066
71- lastUpdatedDate = configDataService . GetConfigLastUpdated ( ConfigConstants . TermsText ) ;
67+ lastUpdatedDate = configService . GetConfigLastUpdated ( ConfigConstants . TermsText ) ;
7268 nextReviewDate = lastUpdatedDate . AddYears ( 3 ) ;
7369 var model = new TermsViewModel ( termsText , lastUpdatedDate , nextReviewDate ) ;
7470 return View ( model ) ;
7571 }
7672
7773 public IActionResult Contact ( )
7874 {
79- var contactText = configDataService . GetConfigValue ( ConfigConstants . ContactText ) ;
75+ var contactText = configService . GetConfigValue ( ConfigConstants . ContactText ) ;
8076 if ( contactText == null )
8177 {
8278 logger . LogError ( "Contact text from Config table is null" ) ;
@@ -155,14 +151,14 @@ private ErrorViewModel GetErrorModel()
155151 var centreId = User . GetCentreId ( ) ;
156152 if ( centreId != null )
157153 {
158- bannerText = centresDataService . GetBannerText ( ( int ) centreId ) ;
154+ bannerText = centresService . GetBannerText ( ( int ) centreId ) ;
159155 }
160156 return bannerText ;
161157 }
162158
163159 public IActionResult AcceptableUsePolicy ( )
164160 {
165- var acceptableUsePolicyText = configDataService . GetConfigValue ( ConfigConstants . AcceptableUsePolicyText ) ;
161+ var acceptableUsePolicyText = configService . GetConfigValue ( ConfigConstants . AcceptableUsePolicyText ) ;
166162
167163 if ( acceptableUsePolicyText == null )
168164 {
@@ -172,14 +168,14 @@ public IActionResult AcceptableUsePolicy()
172168 DateTime lastUpdatedDate = DateTime . Now ;
173169 DateTime nextReviewDate = DateTime . Now ;
174170
175- lastUpdatedDate = configDataService . GetConfigLastUpdated ( ConfigConstants . AcceptableUsePolicyText ) ;
171+ lastUpdatedDate = configService . GetConfigLastUpdated ( ConfigConstants . AcceptableUsePolicyText ) ;
176172 nextReviewDate = lastUpdatedDate . AddYears ( 3 ) ;
177173 var model = new AcceptableUsePolicyViewModel ( acceptableUsePolicyText , lastUpdatedDate , nextReviewDate ) ;
178174 return View ( model ) ;
179175 }
180176 public IActionResult PrivacyNotice ( )
181177 {
182- var PrivacyPolicyText = configDataService . GetConfigValue ( ConfigConstants . PrivacyPolicyText ) ;
178+ var PrivacyPolicyText = configService . GetConfigValue ( ConfigConstants . PrivacyPolicyText ) ;
183179 if ( PrivacyPolicyText == null )
184180 {
185181 logger . LogError ( "PrivacyPolicy text from Config table is null" ) ;
@@ -189,7 +185,7 @@ public IActionResult PrivacyNotice()
189185 DateTime lastUpdatedDate = DateTime . Now ;
190186 DateTime nextReviewDate = DateTime . Now ;
191187
192- lastUpdatedDate = configDataService . GetConfigLastUpdated ( ConfigConstants . PrivacyPolicyText ) ;
188+ lastUpdatedDate = configService . GetConfigLastUpdated ( ConfigConstants . PrivacyPolicyText ) ;
193189 nextReviewDate = lastUpdatedDate . AddYears ( 3 ) ;
194190
195191 var model = new PrivacyNoticeViewModel ( PrivacyPolicyText , lastUpdatedDate , nextReviewDate ) ;
0 commit comments