public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } StudentLevel = await _context.StudentLevel .Include(s => s.SlCo) .Include(s => s.SlEr) .Include(s => s.SlFirstLanguageLang) .Include(s => s.SlFosterCareOpt) .Include(s => s.SlFreeReducedLunchProgramOpt) .Include(s => s.SlGe) .Include(s => s.SlHomelessStatusOpt) .Include(s => s.SlIfspOpt) .Include(s => s.SlInc) .Include(s => s.SlMigrantStatusOpt) .Include(s => s.SlOnt) .Include(s => s.SlPrvd) .Include(s => s.SlRe) .Include(s => s.SlRecieveServicesOpt) .Include(s => s.SlSecondLanguageLang) .Include(s => s.SlSnapOpt) .Include(s => s.SlSsiOpt) .Include(s => s.SlTanfOpt) .Include(s => s.SlThirdLanguageLang) .Include(s => s.SlWicOpt).FirstOrDefaultAsync(m => m.SlId == id); if (StudentLevel == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } StudentLevel = await _context.StudentLevel .Include(s => s.SlCo) .Include(s => s.SlEr) .Include(s => s.SlFirstLanguageLang) .Include(s => s.SlFosterCareOpt) .Include(s => s.SlFreeReducedLunchProgramOpt) .Include(s => s.SlGe) .Include(s => s.SlHomelessStatusOpt) .Include(s => s.SlIfspOpt) .Include(s => s.SlInc) .Include(s => s.SlMigrantStatusOpt) .Include(s => s.SlOnt) .Include(s => s.SlPrvd) .Include(s => s.SlRe) .Include(s => s.SlRecieveServicesOpt) .Include(s => s.SlSecondLanguageLang) .Include(s => s.SlSnapOpt) .Include(s => s.SlSsiOpt) .Include(s => s.SlTanfOpt) .Include(s => s.SlThirdLanguageLang) .Include(s => s.SlWicOpt).FirstOrDefaultAsync(m => m.SlId == id); if (StudentLevel == null) { return(NotFound()); } ViewData["SlCoId"] = new SelectList(_context.County, "CoId", "CoName"); ViewData["SlErId"] = new SelectList(_context.ExitReason, "ErId", "ErType"); ViewData["SlFirstLanguageLangId"] = new SelectList(_context.Language, "LangId", "LangName"); ViewData["SlFosterCareOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlFreeReducedLunchProgramOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlGeId"] = new SelectList(_context.Gender, "GeId", "GeAbbreviation"); ViewData["SlHomelessStatusOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlIfspOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlIncId"] = new SelectList(_context.Income, "IncId", "IncRange"); ViewData["SlMigrantStatusOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlOntId"] = new SelectList(_context.OtherNameType, "OntId", "OntName"); ViewData["SlPrvdId"] = new SelectList(_context.Provider, "PrvdId", "PrvdName"); ViewData["SlReId"] = new SelectList(_context.RaceEthnicity, "ReId", "ReName"); ViewData["SlRecieveServicesOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlSecondLanguageLangId"] = new SelectList(_context.Language, "LangId", "LangName"); ViewData["SlSnapOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlSsiOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlTanfOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); ViewData["SlThirdLanguageLangId"] = new SelectList(_context.Language, "LangId", "LangName"); ViewData["SlWicOptId"] = new SelectList(_context.Option, "OptId", "OptValue"); return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } StudentLevel = await _context.StudentLevel.FindAsync(id); if (StudentLevel != null) { _context.StudentLevel.Remove(StudentLevel); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }