Skip to content

Commit cf3a97a

Browse files
committed
ECER-5270: Store Countries on update international certification piece is done now
1 parent 6a46987 commit cf3a97a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ECER.Resources.Documents/ICRA/ICRAChildren/InternationalCertifications.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,17 @@ private async Task UpdateInternationalCertifications(ecer_ICRAEligibilityAssessm
3333
context.Detach(oldInternationalCertification);
3434
ecerInternationalCertification.StatusCode = oldInternationalCertification.StatusCode;
3535
}
36-
36+
3737
context.Attach(ecerInternationalCertification);
3838
context.UpdateObject(ecerInternationalCertification);
39+
if (InternationalCertification.CountryId != null)
40+
{
41+
var ecer_country = context.ecer_CountrySet.SingleOrDefault(c => c.ecer_CountryId == Guid.Parse(InternationalCertification.CountryId));
42+
if (ecer_country != null)
43+
{
44+
context.AddLink(ecer_country, ecer_InternationalCertification.Fields.ecer_internationalcertification_CountryId, ecerInternationalCertification);
45+
}
46+
}
3947
await HandleInternationalCertificationFiles(ecerInternationalCertification, Guid.Parse(ApplicantId), InternationalCertification.NewFiles, InternationalCertification.DeletedFiles, ct);
4048
}
4149

0 commit comments

Comments
 (0)