SIMS 7 - Sample Code for Census Top up Funding
Overview of Example
Just gets the set of appropriate pupil ids.
Example Call
List<TopUp> tops = SIMSInterface.TopUpFunding.GetTopups();
json = Newtonsoft.Json.JsonConvert.SerializeObject(tops, Formatting.Indented);
System.IO.File.WriteAllText(Path.Combine(OutputFolder, "top_ups.json"), json);
Output Class
public class TopUp
{
public int id { get; set; }
public string name { get; set; }
}
Code Sample
public static List<TopUp> GetTopups()
{
List<TopUp> list = new List<TopUp>();
SIMS.Processes.CensusImportTopupFundings ctups = new SIMS.Processes.CensusImportTopupFundings();
ctups.PopulateMembersforBottomGrid("SPR","24");
foreach (CensusTopupFundingMember s in ctups.TopupFundingMembersAdded.Value)
{
TopUp tu = new TopUp();
tu.id = s.PersonID;
tu.name = s.Forename + " " + s.PreferredSurname;
list.Add(tu);
}
return list;
}
Example Output
[
{
"id": 12108,
"name": "Stephen Ackton"
},
{
"id": 13318,
"name": "Louie Allen"
},