© 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.

SIMS 7 - Sample Code - Funded Hours

Overview of Example

Example of using the census screens to extract funding hours.

Example Call

List<FHours> FundedHours = SIMSInterface.FundedHours.GetFundedHours();
            json = Newtonsoft.Json.JsonConvert.SerializeObject(FundedHours, Formatting.Indented);
            System.IO.File.WriteAllText(Path.Combine(OutputFolder, "FundedHours.json"), json);

Output Class

    public class FHours
    {
        public int id { get; set; }
        public int? PersonID {get;set;}
        public string name { get; set; }
        public double FundedHours { get; set; }
        public double HoursAtSetting { get; set; }
        public double ExtendedFundedHours { get; set; }

        public string DisabilityAccessFund { get; set; }
        public string ThirtyHourCode { get; set; }

    }

Code Sample

 public static List<FHours> GetFundedHours()
        {
            List<FHours > hours = new List<FHours>();
            EditStudentUpdateFundedHours ef = new EditStudentUpdateFundedHours();
            ef.LoadStudents(-1, "SPR", "2024");
            
            foreach (StudentFundedHour s in ef.StudFundedHours.Value)
            {
                FHours hour = new FHours();
                //Funded free entitlement hours[1]
                //Extended entitlement hours[2]
                //Eligibility code[4]
                //Hours at setting[6]

                hour.id = s.ID;
                hour.PersonID = s.PersonID;
                hour.name = s.Name;
                hour.HoursAtSetting =  s.HoursAtSetting;
                hour.FundedHours = s.FundedHours;
                hour.ThirtyHourCode = s.ThirtyHourCode;
                if (s.DisabilityAccessFund != null && s.DisabilityAccessFund.CategoryCodeAttribute != null)
                {
                    hour.DisabilityAccessFund = s.DisabilityAccessFund.CategoryCodeAttribute.Description;
                }
                hour.ExtendedFundedHours = s.ExtendedFundedHours;
                hours.Add(hour);
            }
            return hours;
        }

Example Output

// Json output - none in test data