protected virtual void SeedTlevelTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Ncfe) { _tlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); _route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); _pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, _route); _specialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, _pathway); _tqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, _pathway, _tlAwardingOrganisation); DbContext.SaveChangesAsync(); }
protected virtual void SeedTestData() { TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, EnumAwardingOrganisation.Pearson); Route = TlevelDataProvider.CreateTlRoute(DbContext, EnumAwardingOrganisation.Pearson); Pathway = TlevelDataProvider.CreateTlPathway(DbContext, EnumAwardingOrganisation.Pearson, Route); TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); SeedProviderData(); DbContext.SaveChangesAsync(); }
protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false) { TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); Route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); Pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route); Specialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway); TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); TlProvider = ProviderDataProvider.CreateTlProvider(DbContext); TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider); AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true); DbContext.SaveChangesAsync(); }
private async Task <bool> SendEmailAsync(VerifyTlevelDetails model, TqAwardingOrganisation tqAwardingOrganisation) { var tokens = new Dictionary <string, dynamic> { { "tlevel_name", tqAwardingOrganisation.TlPathway.TlevelTitle }, { "user_comments", model.Query }, { "sender_name", model.ModifiedBy }, { "sender_email_address", model.QueriedUserEmail } }; return(await _notificationService.SendEmailNotificationAsync(NotificationTemplateName.TlevelDetailsQueried.ToString(), _resultsAndCertificationConfiguration.TlevelQueriedSupportEmailAddress, tokens)); }
protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false) { TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); Route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); Pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route); Specialism = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway).First(); TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); TlProvider = ProviderDataProvider.CreateTlProvider(DbContext); TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider); AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true); TlLookup = TlLookupDataProvider.CreateTlLookupList(DbContext, null, true); PathwayComponentGrades = TlLookup.Where(x => x.Category.Equals(LookupCategory.PathwayComponentGrade.ToString(), StringComparison.InvariantCultureIgnoreCase)).ToList(); DbContext.SaveChangesAsync(); }
protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false) { TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); Route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); Pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route); Specialism = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway).First(); TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); TlProviders = ProviderDataProvider.CreateTlProviders(DbContext); TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProviders.First()); AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true); TlLookup = TlLookupDataProvider.CreateTlLookupList(DbContext, null, true); foreach (var provider in TlProviders) { TlProviderAddressDataProvider.CreateTlProviderAddress(DbContext, new TlProviderAddressBuilder().Build(provider)); } DbContext.SaveChangesAsync(); }
public static TqAwardingOrganisation CreateTqAwardingOrganisation(ResultsAndCertificationDbContext _dbContext, TlPathway tlPathway, TlAwardingOrganisation tlAwardingOrganisation, TlevelReviewStatus tLevelReviewStatus = TlevelReviewStatus.AwaitingConfirmation, bool addToDbContext = true) { if (tlPathway != null) { var tqAwardingOrganisation = new TqAwardingOrganisation { TlAwardingOrganisatonId = tlAwardingOrganisation.Id, TlPathwayId = tlPathway.Id, TlAwardingOrganisaton = tlAwardingOrganisation, TlPathway = tlPathway, ReviewStatus = (int)tLevelReviewStatus }; if (addToDbContext) { _dbContext.Add(tqAwardingOrganisation); } return(tqAwardingOrganisation); } return(null); }
public static TqAwardingOrganisation CreateTqAwardingOrganisation(ResultsAndCertificationDbContext _dbContext, TqAwardingOrganisation tqAwardingOrganisation, bool addToDbContext = true) { if (addToDbContext && tqAwardingOrganisation == null) { _dbContext.Add(tqAwardingOrganisation); } return(tqAwardingOrganisation); }
public static TqProvider CreateTqProvider(ResultsAndCertificationDbContext _dbContext, TqAwardingOrganisation tqAwardingOrganisation, TlProvider tlProvider, bool addToDbContext = true) { if (tlProvider != null && tqAwardingOrganisation != null) { var tqProvider = new TqProvider { TlProviderId = tlProvider.Id, TqAwardingOrganisationId = tqAwardingOrganisation.Id, TqAwardingOrganisation = tqAwardingOrganisation }; if (addToDbContext) { _dbContext.Add(tqProvider); } return(tqProvider); } return(null); }