Skip to content

Commit 30426fb

Browse files
committed
TD-5153 Updates competency group if description changed
1 parent 1812111 commit 30426fb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

DigitalLearningSolutions.Web/Services/FrameworkService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public interface IFrameworkService
5858
int GetMaxFrameworkCompetencyGroupID();
5959
IEnumerable<BulkCompetency> GetBulkCompetenciesForFramework(int frameworkId);
6060
List<int> GetFrameworkCompetencyOrder(int frameworkId, List<int> frameworkCompetencyIds);
61+
int GetFrameworkCompetencyGroupId(int frameworkId, int competencyGroupId);
6162

6263
// Assessment questions:
6364
IEnumerable<AssessmentQuestion> GetAllCompetencyQuestions(int adminId);
@@ -717,5 +718,10 @@ public void UpdateReviewRequestedDate(int reviewId)
717718
{
718719
frameworkDataService.UpdateReviewRequestedDate(reviewId);
719720
}
721+
722+
public int GetFrameworkCompetencyGroupId(int frameworkId, int competencyGroupId)
723+
{
724+
return frameworkDataService.GetFrameworkCompetencyGroupId(frameworkId, competencyGroupId);
725+
}
720726
}
721727
}

DigitalLearningSolutions.Web/Services/ImportCompetenciesFromFileService.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ CompetencyTableRow competencyRow
184184
maxFrameworkCompetencyGroupId = (int)frameworkCompetencyGroupId;
185185
competencyRow.RowStatus = RowStatus.CompetencyGroupInserted;
186186
}
187+
else
188+
{
189+
//TO DO: Need to get frameworkCompetencyGroupId and check admin ID
190+
frameworkCompetencyGroupId = frameworkService.GetFrameworkCompetencyGroupId(frameworkId, newCompetencyGroupId);
191+
var isUpdated = frameworkService.UpdateFrameworkCompetencyGroup((int)frameworkCompetencyGroupId, newCompetencyGroupId, competencyRow.CompetencyGroup, competencyRow.GroupDescription, adminUserId);
192+
competencyRow.RowStatus = RowStatus.CompetencyGroupUpdated;
193+
}
194+
}
195+
else
196+
{
197+
187198
}
188199
}
189200
// If FrameworkCompetency ID is supplied, update the competency

0 commit comments

Comments
 (0)