Exemplo n.º 1
0
 public IActionResult OnGet()
 {
     ViewData["CasualtiesID"]  = new SelectList(_context.Casualtie, "ID", "ID");
     ViewData["StaffID"]       = new SelectList(_context.Set <Staff>(), "ID", "ID");
     ViewData["TypesCrimesID"] = new SelectList(_context.Set <TypeCrime>(), "ID", "ID");
     return(Page());
 }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Criminal = await _context.Criminal
                       .Include(c => c.Casualties)
                       .Include(c => c.Staff)
                       .Include(c => c.TypesCrimes).FirstOrDefaultAsync(m => m.ID == id);

            if (Criminal == null)
            {
                return(NotFound());
            }
            ViewData["CasualtiesID"]  = new SelectList(_context.Casualtie, "ID", "ID");
            ViewData["StaffID"]       = new SelectList(_context.Set <Staff>(), "ID", "ID");
            ViewData["TypesCrimesID"] = new SelectList(_context.Set <TypeCrime>(), "ID", "ID");
            return(Page());
        }