public SessionReportConfiguration GetSessionReportConfig(ProviderTypeIDs providerTypeID, int serviceID) { return(SessionReportConfiguration.CreateSample()); //var config = Context.SessionReportConfigurations.SingleOrDefault(s => s.ProviderTypeID == (int)providerTypeID && s.ServiceID == serviceID); //if (config == null) //{ // throw new System.Exception("Configuration does not exist."); //} //return JsonConvert.DeserializeObject<SessionReportConfiguration>(config.Configuration); }
public static SessionReport CreateSample() { var config = SessionReportConfiguration.CreateSample(); var behaviors = config.Fields.Where(f => f.Name == "Behaviors").Cast <MultiSelectFieldConfiguration <MultiSelectOption> >().Single().Options; var interventions = config.Fields.Where(f => f.Name == "Interventions").Cast <MultiSelectFieldConfiguration <MultiSelectOptionWithResponses> >().Single().Options; var reinforcers = config.Fields.Where(f => f.Name == "Reinforcers").Cast <MultiSelectFieldConfiguration <MultiSelectOption> >().Single().Options; var barriers = config.Fields.Where(f => f.Name == "Barriers").Cast <MultiSelectFieldConfiguration <MultiSelectOption> >().Single().Options; return(new SessionReport { Summary = "This is a summary text. Lorem ipsum. More to come.", BehaviorsSection = new BehaviorsReportSection { Behaviors = new List <Behavior> { new Behavior { Name = behaviors.First().Name, Description = "Some random description" }, new Behavior { Name = behaviors.Last().Name, Description = null } } }, InterventionsSection = new InterventionsReportSection { Interventions = new List <Intervention> { new Intervention { Name = interventions.First().Name, Response = interventions.First().Responses.First().Name }, new Intervention { Name = interventions.Last().Name, Response = interventions.Last().Responses.First().Name } } }, ReinforcersSection = new ReinforcersReportSection { Reinforcers = new List <Reinforcer> { new Reinforcer { Name = reinforcers.First().Name, Description = "Some random description for reinforcer" }, new Reinforcer { Name = reinforcers.Last().Name, Description = null } } }, GoalsSection = new GoalsReportSection() { Goals = new List <Goal> { new Goal { Name = "Say Thank you", Progress = "Reluctant at first, he finally said it" } } }, BarriersSection = new BarriersReportSection { Barriers = new List <Barrier> { new Barrier { Name = barriers.First().Name, Description = "Some random description for barrier" }, new Barrier { Name = barriers.Last().Name, Description = null } } } }); }