public void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson)
        {
            AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true);
            TlProviders      = ProviderDataProvider.CreateTlProviders(DbContext).ToList();
            var tlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation);
            var routes   = TlevelDataProvider.CreateTlRoutes(DbContext, awardingOrganisation);
            var pathways = TlevelDataProvider.CreateTlPathways(DbContext, awardingOrganisation, routes);

            TlSpecialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, pathways.First());
            TlLookup      = TlLookupDataProvider.CreateTlLookupList(DbContext);

            var tqAwardingOrganisations = TlevelDataProvider.CreateTqAwardingOrganisations(DbContext, awardingOrganisation, tlAwardingOrganisation, pathways);

            DbContext.SaveChanges();

            PathwayComponentGrades = TlLookup.Where(x => x.Category.Equals(LookupCategory.PathwayComponentGrade.ToString(), StringComparison.InvariantCultureIgnoreCase)).ToList();
            TqProviders            = new List <TqProvider>();
            foreach (var tqAwardingOrganisation in tqAwardingOrganisations)
            {
                foreach (var tlProvider in TlProviders)
                {
                    TqProviders.Add(ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider));
                }
            }

            DbContext.SaveChanges();
        }
        public void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson)
        {
            AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true);
            TlProviders      = ProviderDataProvider.CreateTlProviders(DbContext).ToList();
            var tlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation);
            var routes   = TlevelDataProvider.CreateTlRoutes(DbContext, awardingOrganisation);
            var pathways = TlevelDataProvider.CreateTlPathways(DbContext, awardingOrganisation, routes);

            TlSpecialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, pathways.First());

            var tqAwardingOrganisations = TlevelDataProvider.CreateTqAwardingOrganisations(DbContext, awardingOrganisation, tlAwardingOrganisation, pathways);

            DbContext.SaveChanges();

            TqProviders = new List <TqProvider>();
            foreach (var tqAwardingOrganisation in tqAwardingOrganisations)
            {
                foreach (var tlProvider in TlProviders)
                {
                    TqProviders.Add(ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider));
                }
            }

            DbContext.SaveChanges();
        }
        public void TransferRegistration(TqRegistrationProfile profile, Provider transferTo)
        {
            var toProvider           = DbContext.TlProvider.FirstOrDefault(x => x.UkPrn == (long)transferTo);
            var transferToTqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, toProvider, true);

            foreach (var pathway in profile.TqRegistrationPathways)
            {
                pathway.Status  = RegistrationPathwayStatus.Transferred;
                pathway.EndDate = DateTime.UtcNow;

                foreach (var specialism in pathway.TqRegistrationSpecialisms)
                {
                    specialism.IsOptedin = true;
                    specialism.EndDate   = DateTime.UtcNow;
                }
            }

            var industryPlacement        = profile.TqRegistrationPathways.FirstOrDefault()?.IndustryPlacements?.FirstOrDefault();
            var tqRegistrationPathway    = RegistrationsDataProvider.CreateTqRegistrationPathway(DbContext, profile, transferToTqProvider);
            var tqRegistrationSpecialism = RegistrationsDataProvider.CreateTqRegistrationSpecialism(DbContext, tqRegistrationPathway, Specialism);

            DbContext.SaveChanges();

            if (industryPlacement != null)
            {
                IndustryPlacementProvider.CreateIndustryPlacement(DbContext, tqRegistrationPathway.Id, industryPlacement.Status);
            }

            DbContext.SaveChanges();
        }
Exemple #4
0
        protected override void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false)
        {
            TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation);
            var routes = TlevelDataProvider.CreateTlRoutes(DbContext, awardingOrganisation);

            _tlPathways = TlevelDataProvider.CreateTlPathways(DbContext, awardingOrganisation, routes);

            foreach (var pathway in _tlPathways)
            {
                TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, pathway);
            }

            var tqAwardingOrganisations = TlevelDataProvider.CreateTqAwardingOrganisations(DbContext, awardingOrganisation, TlAwardingOrganisation, _tlPathways);

            TqProviders = new List <TqProvider>();
            TlProviders = ProviderDataProvider.CreateTlProviders(DbContext).ToList();

            var tlProvider = TlProviders.FirstOrDefault();

            foreach (var tqAwardingOrganisation in tqAwardingOrganisations)
            {
                TqProviders.Add(ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider));
            }

            DbContext.SaveChangesAsync();
        }
 protected override void SeedTestData()
 {
     TlProvider             = ProviderDataProvider.CreateTlProvider(DbContext);
     TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, EnumAwardingOrganisation.Pearson);
     _routes   = TlevelDataProvider.CreateTlRoutes(DbContext, EnumAwardingOrganisation.Pearson);
     _pathways = TlevelDataProvider.CreateTlPathways(DbContext, EnumAwardingOrganisation.Pearson, _routes);
     TlevelDataProvider.CreateTqAwardingOrganisations(DbContext, EnumAwardingOrganisation.Pearson, TlAwardingOrganisation, _pathways);
     DbContext.SaveChangesAsync();
 }
Exemple #6
0
 protected override void SeedTestData()
 {
     TlProvider             = ProviderDataProvider.CreateTlProvider(DbContext);
     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);
     TlProvider             = ProviderDataProvider.CreateTlProvider(DbContext);
     TqProvider             = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider);
     DbContext.SaveChangesAsync();
 }
Exemple #7
0
 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();
 }
        protected override 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);
            var tqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation);

            TlProvider = ProviderDataProvider.CreateTlProvider(DbContext);
            TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, TlProvider);
            DbContext.SaveChangesAsync();
        }
Exemple #9
0
 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 override 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);
            var tqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation);

            TqProviders = new List <TqProvider>();
            TlProviders = ProviderDataProvider.CreateTlProviders(DbContext).ToList();

            foreach (var tlProvider in TlProviders)
            {
                TqProviders.Add(ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider));
            }
            AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true);
            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();
        }
Exemple #12
0
 protected override void SeedProviderData()
 {
     TlProvider = ProviderDataProvider.CreateTlProvider(DbContext);
     TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider);
 }
 protected virtual void SeedProviderData()
 {
     TlProvider = ProviderDataProvider.CreateTlProvider(DbContext);
 }
 private void SeedProviders()
 {
     ProviderDataProvider.CreateTlProviders(DbContext);
     DbContext.SaveChangesAsync();
 }
Exemple #15
0
 protected virtual void SeedTestData()
 {
     TlProviders = ProviderDataProvider.CreateTlProviders(DbContext);
     DbContext.SaveChanges();
 }