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