public static Child CreateChild( HedwigContext context, string firstName = "Test", string lastName = "Child", string birthdate = "2000-01-01", Gender gender = Gender.Unknown, Family family = null, Organization organization = null ) { family = family ?? FamilyHelper.CreateFamily(context); organization = organization ?? OrganizationHelper.CreateOrganization(context); var child = new Child { FirstName = firstName, LastName = lastName, Birthdate = DateTime.Parse(birthdate), Gender = gender, FamilyId = family.Id, OrganizationId = organization.Id }; context.Add <Child>(child); context.SaveChanges(); return(child); }
public static FundingSpace CreateFundingSpace( HedwigContext context, int organizationId, FundingSource source = FundingSource.CDC, Age ageGroup = Age.Preschool, FundingTime time = FundingTime.Full, int capacity = 10 ) { var timeSplit = time != FundingTime.Split ? null : new FundingTimeSplit { FullTimeWeeks = 42, PartTimeWeeks = 10 }; var space = new FundingSpace { OrganizationId = organizationId, Source = source, AgeGroup = ageGroup, Capacity = capacity, Time = time, TimeSplit = timeSplit }; context.Add(space); context.SaveChanges(); return space; }
public static Family CreateFamily( HedwigContext context, Organization organization = null ) { organization = organization ?? OrganizationHelper.CreateOrganization(context); var family = new Family { OrganizationId = organization.Id }; context.Add(family); context.SaveChanges(); return(family); }
public static ReportingPeriod CreateReportingPeriod( HedwigContext context, FundingSource type = FundingSource.CDC, string period = "2019-10-01", string periodStart = "2019-10-01", string periodEnd = "2019-10-01", string dueAt = "2019-10-01" ) { var reportingPeriod = new ReportingPeriod { Type = type, Period = DateTime.Parse(period), PeriodStart = DateTime.Parse(periodStart), PeriodEnd = DateTime.Parse(periodEnd), DueAt = DateTime.Parse(dueAt) }; context.Add(reportingPeriod); context.SaveChanges(); return(reportingPeriod); }