public EnglishAndMathsStatus GetEMStatus(string uln)
        {
            string profileTableQuery  = "select IsEnglishAndMathsAchieved from TqRegistrationProfile where UniqueLearnerNumber= " + uln;
            var    englishMathsStatus = SqlDatabaseConncetionHelper.ReadDataFromDataBase(profileTableQuery, ConnectionString);

            return((EnglishAndMathsStatus)Convert.ToInt32(englishMathsStatus[0][0]));
        }
Beispiel #2
0
        private static IEnumerable <int> GetPathwayIds(string uln)
        {
            var getPathwayId = "select rs.TqRegistrationPathwayId from TqRegistrationSpecialism rs join TqRegistrationPathway rp on rp.Id = rs.TqRegistrationPathwayId join TqRegistrationProfile pr on pr.Id = rp.TqRegistrationProfileId where pr.UniqueLearnerNumber = '" + uln + "'";
            var pathwayIds   = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getPathwayId, ConnectionString);

            return(pathwayIds.Select(x => Convert.ToInt32(x[0])).ToList());
        }
        public static int getPathwayId(string uln)
        {
            string getPathwayId = "select rs.TqRegistrationPathwayId from TqRegistrationSpecialism rs join TqRegistrationPathway rp on rp.Id = rs.TqRegistrationPathwayId join TqRegistrationProfile pr on pr.Id = rp.TqRegistrationProfileId where pr.UniqueLearnerNumber = '" + uln + "'";
            var    pathwayId    = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getPathwayId, ConnectionString);
            int    result       = Convert.ToInt32(pathwayId[0][0]);

            return(result);
        }
        public static int GetProfileID(string uln)
        {
            string getProfileId = "Select top 1 Id from TqRegistrationProfile where UniqueLearnerNumber = '" + uln + "'";
            var    profileId    = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getProfileId, ConnectionString);
            int    result       = Convert.ToInt32(profileId[0][0]);

            return(result);
        }
        public IndustryPlacementStatus GetIPStatus(string uln)
        {
            string profileIdQuery = "select  rep.Id from TqRegistrationProfile rp join TqRegistrationPathway rep on rp.Id = rep.TqRegistrationProfileId where rp.UniqueLearnerNumber = " + uln;
            var    regPathwayId   = SqlDatabaseConncetionHelper.ReadDataFromDataBase(profileIdQuery, ConnectionString);
            string IpQuery        = "select status from IndustryPlacement where TqRegistrationPathwayId=" + Convert.ToInt32(regPathwayId[0][0]);;
            var    ipStatusId     = SqlDatabaseConncetionHelper.ReadDataFromDataBase(IpQuery, ConnectionString);

            return((IndustryPlacementStatus)Convert.ToInt32(ipStatusId[0][0]));
        }
        private static int InsertRegistrationProfile(string uln)
        {
            var createRegistrationProfile = "Insert into TqRegistrationProfile values(" + uln + ", 'Db FirstName','Db LastName','2001-01-01',Null,Null,Null,Null,Null,GETDATE(),'System', GETDATE(),'System')";
            var getRegProfileId           = "Select top 1 id from TqRegistrationProfile where UniqueLearnerNumber='" + uln + "'";

            SqlDatabaseConncetionHelper.ExecuteSqlCommand(createRegistrationProfile, ConnectionString);
            var profileId = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getRegProfileId, ConnectionString);

            return((int)profileId.FirstOrDefault().FirstOrDefault());
        }
        private static int InsertSpecialismAssessment2(int specialismId)
        {
            var tlAssessmentSeriesId       = Constants.TlAssessmentSeriesId;
            var createSpecialismAssessment = "Insert into TqSpecialismAssessment values('" + specialismId + "','" + tlAssessmentSeriesId + "',GETDATE(),Null,1,0,GETDATE(),'System',GETDATE(),'System')";
            var getSpecialismAssessmentId  = "select top 1 id from TqSpecialismAssessment where TqRegistrationSpecialismId  = '" + specialismId + "'order by Id desc";

            SqlDatabaseConncetionHelper.ExecuteSqlCommand(createSpecialismAssessment, ConnectionString);
            var specialismAssessmentId = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getSpecialismAssessmentId, ConnectionString);

            return((int)specialismAssessmentId.FirstOrDefault().FirstOrDefault());
        }
        private static int InsertCoreAssessment(int pathwayId)
        {
            var pathwayAssessmentSeriesId = Constants.PathwayAssessmentSeriesId;
            var createPathwayAssessment   = "Insert into TqPathwayAssessment values('" + pathwayId + "','" + pathwayAssessmentSeriesId + "',GETDATE(),NULL,1,0,GETDATE(),'System',Null,Null )";
            var getRegPathwayId           = "select top 1 id from TqPathwayAssessment where TqRegistrationPathwayId  = '" + pathwayId + "'";

            SqlDatabaseConncetionHelper.ExecuteSqlCommand(createPathwayAssessment, ConnectionString);
            var regPathwayId = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getRegPathwayId, ConnectionString);

            return((int)regPathwayId.FirstOrDefault().FirstOrDefault());
        }
        private static int InsertRegistrationSpecialism2(int pathwayId)
        {
            var tlSpecialismId2     = Constants.VentilationSpecialismId;
            var createRegSpecialism = "Insert into TqRegistrationSpecialism values('" + pathwayId + "','" + tlSpecialismId2 + "',GETDATE(),NULL,1,0,GETDATE(),'System',Null,Null )";
            var getSpecialismId     = "select top 1 id from TqRegistrationSpecialism where TqRegistrationPathwayId  = '" + pathwayId + "'order by Id desc";

            SqlDatabaseConncetionHelper.ExecuteSqlCommand(createRegSpecialism, ConnectionString);
            var specialismId = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getSpecialismId, ConnectionString);

            return((int)specialismId.FirstOrDefault().FirstOrDefault());
        }
        private static int InsertRegistrationPathway(int profileId)
        {
            var tqProviderId     = Constants.CityAndGuildsProviderId;
            var createRegPathway = "Insert into TqRegistrationPathway values('" + profileId + "', '" + tqProviderId + "','2020', GETDATE(),NULL,1,1,GETDATE(),'System',NULL,NULL)";
            var getRegPathwayId  = "select top 1 id from TqRegistrationPathway where TqRegistrationProfileId = '" + profileId + "'";

            SqlDatabaseConncetionHelper.ExecuteSqlCommand(createRegPathway, ConnectionString);
            var pathwayId = SqlDatabaseConncetionHelper.ReadDataFromDataBase(getRegPathwayId, ConnectionString);

            return((int)pathwayId.FirstOrDefault().FirstOrDefault());
        }