© 2018 Capita Business Services Ltd. All rights reserved.

Capita Education Software Solutions is a trading name of Capita Business Services Ltd. Our Registered office is 30 Berners Street, London, W1T 3LR and our registered number is 02299747. Further information about Capita plc can be found in our legal statement.

Local - Pastoral structure extract

We have been asked how a TI can extract the pastoral structure for a school and have included sample code below.  Whilst reading the structure is a safe task, we would recommend that TIs do not amend it.  If there is a need to amend the pastoral structure, it is essential that TIs get the code approved by the Partner Support Team before deployment.  Changing structures may need some additional behind the scenes calls to be made.

 

            SIMS.Processes.YearGroupsSetup ygs = new YearGroupsSetup();
            ygs.Load(DateTime.Parse("2023/09/01"));

            // if there are no Tiers setup, the PastoralYears sit under the SystemTiers default
            // in other circumstances a school may have Tiers setup and the PastoralYears will sit under these.
            foreach (SIMS.Entities.PastoralTier tier in ygs.Tiers)
            {
                string tierCode = tier.Description;

                if (tier.PastoralYears.Count > 0)
                {
                    foreach (SIMS.Entities.PastoralYear py in tier.PastoralYears)
                    {
                        // Determine whether this year has vertical or horizontal registration structure.
                        // In the Green Abbey dataset the 6th Form has a vertical structure.
                        if (py.IsVertical)
                        {
                            string logMSG = "This is a vertical registation year for years " + py.ToString();
                        }
                        else // (py.IsHorizontal)
                        {
                            string yearGrp = py.ActiveYearGroup.Description;
                            string mainSuperYG = py.ActiveYearGroup.MainSupervisor.ToString();
                            string supervisorTitleYG = py.YearGroups[0].MainSupervisor.GroupSupervisorTitle.ToString();

                            // Here's the Reg Grp's for the Year plus the other attributes...
                            foreach (SIMS.Entities.RegistrationGroup regGrp in py.RegistrationGroups)
                            {
                                string codeAttribute = regGrp.CodeAttribute.ToString();
                                string mainSuperRG = regGrp.MainSupervisor.ChosenFullName;
                                string supervisorTitleRG = regGrp.MainSupervisor.GroupSupervisorTitle.ToString();
                                string regRoomName = regGrp.CurrentRoom.Name;
                            }
                        }
                    }
                }
            }