© 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 - Census Funding and Monitoring

Overview of Example

We can obtain data from census screens as follows:

Funding and Monitoring

Example Call

            List<FAMDetail> fam = SIMSInterface.FAM.FAMGet();
            json = Newtonsoft.Json.JsonConvert.SerializeObject(fam, Formatting.Indented);
            System.IO.File.WriteAllText(Path.Combine(OutputFolder, "fam.json"), json);

Output Class

public class FAMDetail
    {
        public int id { get; set; }
        public string name { get; set; }
        /// <summary>
        /// Learner Funding and Monitoring(FAM) Type
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// Learner Funding and Monitoring(FAM) Code
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// Learner Funding and Monitoring(FAM) Hours
        /// </summary>
        public string Hours { get; set; }
    }

Code Sample

public static List<FAMDetail> FAMGet()
{
    EditStudentFundingAndMonitoring esfm = new EditStudentFundingAndMonitoring();
    esfm.LoadStudents(2023);
    List<FAMDetail> details = new List<FAMDetail>();    
    foreach (StudentFAM s in esfm.StudFAMs.Value) 
    {
        FAMDetail f = new FAMDetail();
        f.id = s.personIdAttribute.Value;
        f.name = s.Name;
        f.Type = s.FamTypeAttribute.Value;
        f.Code = "?"; // Not clear from the picture
        f.Hours = s.TotalHours.ToString();  // Check that this is the number needed.
        details.Add(f);
    }
    return details;
}

Example Output

  {
    "id": 14261,
    "name": "Abbot,Benjamin",
    "Type": "",
    "Code": "?",
    "Hours": "0"
  },