Skip to content

Commit a317639

Browse files
committed
begins to implement post method
1 parent 1569e57 commit a317639

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public interface ICompetencyAssessmentDataService
2929

3030
CompetencyAssessmentTaskStatus GetOrInsertAndReturnAssessmentTaskStatus(int assessmentId, bool frameworkBased);
3131

32-
int[] GetLinkedFrameworkIds (int assessmentId);
32+
int[] GetLinkedFrameworkIds(int assessmentId);
3333

3434
int? GetPrimaryLinkedFrameworkId(int assessmentId);
3535

@@ -67,7 +67,7 @@ int categoryId
6767

6868
//DELETE DATA
6969
bool RemoveFrameworkCompetenciesFromAssessment(int competencyAssessmentId, int frameworkId);
70-
70+
7171
}
7272

7373
public class CompetencyAssessmentDataService : ICompetencyAssessmentDataService
@@ -366,7 +366,7 @@ WHERE NOT EXISTS (SELECT 1 FROM SelfAssessmentFrameworks WHERE SelfAssessmentId
366366
new { adminId, selfAssessmentId, frameworkId }
367367
);
368368
}
369-
if (numberOfAffectedRows < 1)
369+
if (numberOfAffectedRows < 1)
370370
{
371371
logger.LogWarning(
372372
"Not inserting SelfAssessmentFrameworks record as db insert failed. " +

DigitalLearningSolutions.Web/Controllers/CompetencyAssessmentsController/CompetencyAssessments.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using DigitalLearningSolutions.Web.Helpers;
1212
using System.Linq;
1313
using Microsoft.AspNetCore.Mvc.Rendering;
14+
using Serilog.Extensions.Hosting;
1415

1516
public partial class CompetencyAssessmentsController
1617
{
@@ -572,5 +573,13 @@ public IActionResult AddCompetencies(int competencyAssessmentId, int frameworkId
572573
var model = new AddCompetenciesViewModel(competencyAssessmentBase, groupedCompetencies, ungroupedCompetencies, frameworkId, framework.FrameworkName, selectedFrameworkCompetencies);
573574
return View(model);
574575
}
576+
[HttpPost]
577+
public IActionResult AddComptencies (AddCompetenciesFormData model)
578+
{
579+
if (!ModelState.IsValid)
580+
{
581+
//reload model and view
582+
}
583+
575584
}
576585
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace DigitalLearningSolutions.Web.ViewModels.CompetencyAssessments
2+
{
3+
using DigitalLearningSolutions.Data.Models.CompetencyAssessments;
4+
using DigitalLearningSolutions.Data.Models.Frameworks;
5+
using DigitalLearningSolutions.Web.Helpers;
6+
using System.Collections.Generic;
7+
public class AddCompetenciesFormData
8+
{
9+
public int ID { get; set; }
10+
public int[] SelectedCompetencyIds { get; set; }
11+
public int FrameworkId { get; set; }
12+
}
13+
}

DigitalLearningSolutions.Web/ViewModels/CompetencyAssessments/ViewSelectedCompetenciesViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public ViewSelectedCompetenciesViewModel(CompetencyAssessmentBase competencyAsse
3535
LinkedFrameworks = linkedFrameworks;
3636
}
3737
public int ID { get; set; }
38-
38+
3939
public string CompetencyAssessmentName { get; set; }
4040
public int UserRole { get; set; }
4141
public string VocabularySingular { get; set; }

DigitalLearningSolutions.Web/Views/CompetencyAssessments/ViewSelectedCompetencies.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<h1>@Model.VocabularyPlural to assess for @Model.CompetencyAssessmentName</h1>
2525
<h2>Linked frameworks</h2>
2626
<dl class="nhsuk-summary-list">
27-
@foreach(var framework in Model.LinkedFrameworks)
27+
@foreach (var framework in Model.LinkedFrameworks)
2828
{
2929
<div class="nhsuk-summary-list__row">
3030
<dt class="nhsuk-summary-list__key">

0 commit comments

Comments
 (0)