public IActionResult Index(int?id = 1) { //ClassroomGrid myClass = new ClassroomGrid(); if (grid == null) { this.grid = new ClassroomGrid(); this.grid = getViewModel(id); } else { this.grid = getViewModel(id); } //Sections Button Prep for View //This is where we are preparing the data to send the sections available //to dispaly as buttons to the view. var classes = new List <Section>(); foreach (Section s in _sectionContext.Section) { classes.Add(s); } ViewData["classes"] = classes; ViewData["tracer"] = "This is the ID: " + id.ToString(); ViewData["sectionId"] = id; return(View(this.grid)); }
public HomeController(EventContext ec, GradeContext gc, StudentContext sc, SectionContext ssc) { _context = ec; _gradeContext = gc; _studentContext = sc; _sectionContext = ssc; grid = new ClassroomGrid(); }