public async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SGPA = await _context.SGPA.FindAsync(id);

            if (SGPA != null)
            {
                _context.SGPA.Remove(SGPA);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SGPA = await _context.SGPA
                   .Include(s => s.Semester)
                   .Include(s => s.User)
                   .Include(s => s.Year).FirstOrDefaultAsync(m => m.SGPAID == id);

            if (SGPA == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SGPA = await _context.SGPA
                   .Include(s => s.Semester)
                   .Include(s => s.User)
                   .Include(s => s.Year).FirstOrDefaultAsync(m => m.SGPAID == id);

            if (SGPA == null)
            {
                return(NotFound());
            }
            ViewData["SemesterID"] = new SelectList(_context.Semester, "SemesterID", "SemesterID");
            ViewData["StudentID"]  = new SelectList(_context.Set <ApplicationUser>(), "Id", "Id");
            ViewData["YearID"]     = new SelectList(_context.Set <Year>(), "YearID", "YearID");
            return(Page());
        }