public async Task OnGetAsync(string academicYear, int plan, string course)
        {
            Guid sessionID = Guid.NewGuid();

            //HttpContext.Session.SetString("SessionID", sessionID.ToString());
            SessionID = sessionID;
            //SessionID = Guid.Parse(HttpContext.Session.GetString("SessionID"));

            int planRevisionID = 0;

            if (plan >= 1)
            {
                planRevisionID = plan;
            }
            else
            {
                planRevisionID = int.Parse(_configuration.GetSection("ProResource")["PlanRevisionID"]);
            }

            AcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            UserDetails = await Identity.GetFullName(academicYear, User.Identity.Name.Split('\\').Last(), _context);

            UserGreeting = Identity.GetGreeting();

            SystemVersion = _configuration["Version"];

            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            ProgrammeSelectList = await _context.SelectListData
                                  .FromSqlInterpolated($"EXEC SPR_ETG_ProgrammeSelectList @AcademicYear={CurrentAcademicYear}, @PlanRevisionID={planRevisionID}")
                                  .ToListAsync();

            ViewData["CourseSL"] = new SelectList(ProgrammeSelectList, "Code", "Description");
        }
        public async Task <IActionResult> OnGetJsonAsync(string academicYear, int plan, string course)
        {
            int planRevisionID = 0;

            if (plan >= 1)
            {
                planRevisionID = plan;
            }
            else
            {
                planRevisionID = int.Parse(_configuration.GetSection("ProResource")["PlanRevisionID"]);
            }

            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            Programme = (await _context.Programme
                         .FromSqlInterpolated($"EXEC SPR_ETG_ProgrammeData @AcademicYear={CurrentAcademicYear}, @PlanRevisionID={planRevisionID}, @Course={course}")
                         .ToListAsync())
                        .FirstOrDefault();

            var collectionWrapper = new
            {
                programme = Programme
            };

            return(new JsonResult(collectionWrapper));
        }
        public async Task <IActionResult> OnGetAsync(string system, string systemILP, string AcademicYear, string StudentRef, int CourseID)
        {
            if (StudentRef == null)
            {
                return(NotFound());
            }

            //Student = await _context.Student.ToListAsync();
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string systemILPDB         = DatabaseSelector.GetILPDatabase(_configuration, systemILP, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(AcademicYear, _context);

            string ProgressionAcademicYear = await AcademicYearFunctions.GetProgressionYear(AcademicYear, _context);

            SystemID    = systemDB;
            SystemILPID = systemILPDB;
            UserDetails = await Identity.GetFullName(system, AcademicYear, User.Identity.Name.Split('\\').Last(), _context, _configuration);

            Student = (await _context.Student
                       .FromSqlInterpolated($"EXEC SPR_PRG_GetStudent @System={systemDB}, @AcademicYear={ProgressionAcademicYear}, @StudentRef={StudentRef}, @CourseID={CourseID}")
                       .ToListAsync())
                      .FirstOrDefault();

            if (Student == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(string academicYear, int plan, string course)
        {
            if (course == null)
            {
                return(NotFound());
            }

            int planRevisionID = 0;

            if (plan >= 1)
            {
                planRevisionID = plan;
            }
            else
            {
                planRevisionID = int.Parse(_configuration.GetSection("ProResource")["PlanRevisionID"]);
            }

            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            Programme = (await _context.Programme
                         .FromSqlInterpolated($"EXEC SPR_ETG_ProgrammeData @AcademicYear={CurrentAcademicYear}, @PlanRevisionID={planRevisionID}, @Course={course}")
                         .ToListAsync())
                        .FirstOrDefault();

            if (Programme == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task OnGetAsync(string system, string academicYear, string measure, int level, string drill)
        {
            //ChartData = await _context.ChartData.ToListAsync();
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            ChartData = await _context.ChartData
                        .FromSqlInterpolated($"EXEC SPR_PRG_GetOutcomesChartData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Measure={measure}, @Level={level}, @Drill={drill}")
                        .ToListAsync();
        }
        public async Task OnGetAsync(string system, string systemILP, string AcademicYear, int CourseID, int GroupID)
        {
            //Student = await _context.Student.ToListAsync();
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string SystemILPDB         = DatabaseSelector.GetILPDatabase(_configuration, systemILP, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(AcademicYear, _context);

            Student = await _context.Student
                      .FromSqlInterpolated($"EXEC SPR_PRG_GetStudentList @System={systemDB}, @SystemILP={SystemILPDB}, @AcademicYear={CurrentAcademicYear}, @CourseID={CourseID}, @GroupID={GroupID}")
                      .ToListAsync();
        }
        public async Task OnGetAsync(string system, string systemILP, string academicYear)
        {
            string defaultAcademicYear = await AcademicYearFunctions.GetDefaultAcademicYear(_context);

            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string systemILPDB         = DatabaseSelector.GetILPDatabase(_configuration, systemILP, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            string ProgressionAcademicYear = await AcademicYearFunctions.GetProgressionYear(academicYear, _context);

            SystemID            = systemDB;
            SystemILPID         = systemILPDB;
            AcademicYear        = CurrentAcademicYear;
            ProgressionYear     = ProgressionAcademicYear;
            DefaultAcademicYear = defaultAcademicYear;
            string selectListDomain = null;

            selectListDomain = "ACADEMIC_YEAR";
            AcademicYearData = await _context.SelectListData
                               .FromSqlInterpolated($"EXEC SPR_PRG_SelectListData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Domain={selectListDomain}")
                               .ToListAsync();

            ViewData["AcademicYearID"] = new SelectList(AcademicYearData, "Code", "Description", CurrentAcademicYear);

            selectListDomain = "APPLICATION_OFFER";
            ApplicationOffer = await _context.SelectListData
                               .FromSqlInterpolated($"EXEC SPR_PRG_SelectListData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Domain={selectListDomain}")
                               .ToListAsync();

            ViewData["OfferID"] = new SelectList(ApplicationOffer, "Code", "Description");

            selectListDomain     = "APPLICATION_CONDITION";
            ApplicationCondition = await _context.SelectListData
                                   .FromSqlInterpolated($"EXEC SPR_PRG_SelectListData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Domain={selectListDomain}")
                                   .ToListAsync();

            ViewData["ConditionID"] = new SelectList(ApplicationCondition, "Code", "Description");

            UserDetails = await Identity.GetFullName(system, academicYear, User.Identity.Name.Split('\\').Last(), _context, _configuration);

            UserGreeting = Identity.GetGreeting();

            SystemVersion = _configuration["Version"];

            Browser = Request.Headers["User-Agent"];

            ShowCharts = _showCharts;

            ShowCoursesWithoutEnrols = _showCoursesWithoutEnrols;
        }
Exemple #8
0
        public async Task OnGetAsync(string system, string academicYear, bool showCoursesWithoutEnrols, bool showOutstanding, string search)
        {
            if (String.IsNullOrEmpty(search))
            {
                search = "";
            }

            //CourseGroup = await _context.CourseGroup.ToListAsync();
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            CourseGroup = await _context.CourseGroup
                          .FromSqlInterpolated($"EXEC SPR_PRG_GetCourseGroupList @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @ShowCoursesWithoutEnrols={showCoursesWithoutEnrols}, @ShowOutstanding={showOutstanding}, @CourseSearch={search}")
                          .ToListAsync();
        }
Exemple #9
0
        public async Task OnGetAsync(string system, string academicYear, string domain)
        {
            //SelectListData = await _context.SelectListData.ToListAsync();

            if (String.IsNullOrEmpty(domain))
            {
                domain = "";
            }

            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            SelectListData = await _context.SelectListData
                             .FromSqlInterpolated($"EXEC SPR_PRG_SelectListData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Domain={domain}")
                             .ToListAsync();
        }
        public async Task <IActionResult> OnGetJsonAsync(string system, string systemILP, string AcademicYear, int CourseID, int GroupID)
        {
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string SystemILPDB         = DatabaseSelector.GetILPDatabase(_configuration, systemILP, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(AcademicYear, _context);

            Student = await _context.Student
                      .FromSqlInterpolated($"EXEC SPR_PRG_GetStudentList @System={systemDB}, @SystemILP={SystemILPDB}, @AcademicYear={CurrentAcademicYear}, @CourseID={CourseID}, @GroupID={GroupID}")
                      .ToListAsync();

            var collectionWrapper = new
            {
                Students = Student
            };

            return(new JsonResult(collectionWrapper));
        }
Exemple #11
0
        public async Task <IActionResult> OnGetJsonAsync(string system, string academicYear, string domain)
        {
            if (String.IsNullOrEmpty(domain))
            {
                domain = "";
            }

            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            SelectListData = await _context.SelectListData
                             .FromSqlInterpolated($"EXEC SPR_PRG_SelectListData @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @Domain={domain}")
                             .ToListAsync();

            var collectionWrapper = new
            {
                SelectOptions = SelectListData
            };

            return(new JsonResult(collectionWrapper));
        }
        public async Task <IActionResult> OnGetAsync(string system, string AcademicYear, string StudentRef)
        {
            if (StudentRef == null)
            {
                return(NotFound());
            }

            //Student = await _context.Student.FirstOrDefaultAsync(m => m.StudentRef == id);
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(AcademicYear, _context);

            Student = (await _context.Student
                       .FromSqlInterpolated($"EXEC SPR_PRG_GetStudent @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @StudentRef={StudentRef}")
                       .ToListAsync())
                      .FirstOrDefault();

            if (Student == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemple #13
0
        public async Task <IActionResult> OnGetJsonAsync(string system, string academicYear, bool requireEnrols, bool showOutstanding, string search)
        {
            if (String.IsNullOrEmpty(search))
            {
                search = "";
            }

            //CourseGroup = await _context.CourseGroup.ToListAsync();
            string systemDB            = DatabaseSelector.GetDatabase(_configuration, system);
            string CurrentAcademicYear = await AcademicYearFunctions.GetAcademicYear(academicYear, _context);

            CourseGroup = await _context.CourseGroup
                          .FromSqlInterpolated($"EXEC SPR_PRG_GetCourseGroupList @System={systemDB}, @AcademicYear={CurrentAcademicYear}, @RequireEnrols={requireEnrols}, @ShowOutstanding={showOutstanding}, @CourseSearch={search}")
                          .ToListAsync();

            var collectionWrapper = new
            {
                Courses = CourseGroup
            };

            return(new JsonResult(collectionWrapper));
        }
        public async Task OnGetAsync(string academicYear, string collegeGroup, string fac, string team, string username, string dataMode)
        {
            string academicYearID = null;

            if (academicYear != null)
            {
                academicYearID = academicYear.Replace("-", "/");
            }

            AcademicYearID = await AcademicYearFunctions.GetAcademicYear(academicYearID, _context);

            DefaultAcademicYearID = await AcademicYearFunctions.GetDefaultAcademicYear(_context);

            if (username != null)
            {
                AppUserID = username;
            }
            else
            {
                AppUserID = User.GetUsername();
            }

            if (team != null)
            {
                StructureLevelID = 4;
            }
            else if (fac != null)
            {
                StructureLevelID = 3;
            }
            else if (collegeGroup != null)
            {
                StructureLevelID = 2;
            }
            else
            {
                StructureLevelID = 1;
            }
            CollegeGroupID = collegeGroup;
            FacID          = fac;
            TeamID         = team;

            if (dataMode == null)
            {
                dataMode = "STATIC";
            }
            DataModeID = dataMode;

            //UserDetails = await Identity.GetFullName(academicYear, User.Identity.Name.Split('\\').Last(), _context);
            UserDetails = await Identity.GetFullName(academicYearID, "r.wilson2", _context);

            string selectListDomain = null;

            selectListDomain = "ACADEMIC_YEAR";
            AcademicYearData = await _context.SelectListData
                               .FromSqlInterpolated($"EXEC SPR_GPR_SelectListData @AcademicYear={AcademicYearID}, @Domain={selectListDomain}")
                               .ToListAsync();

            ViewData["AcademicYearID"] = new SelectList(AcademicYearData, "Code", "Description", AcademicYearID);

            Staff = await _context.Staff
                    .FromSqlInterpolated($"EXEC SPR_GPR_StaffList @AcademicYear={AcademicYearID}")
                    .ToListAsync();
        }