public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ReferenciaLab = await _context.Referencias
                            .Include(e => e.Candidato).FirstOrDefaultAsync(m => m.Id == id);

            if (ReferenciaLab == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ReferenciaLab = await _context.Referencias.FindAsync(id);

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

            return(RedirectToPage("/Proyect/CrearOrden"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ReferenciaLab = await _context.Referencias
                            .Include(e => e.Candidato).FirstOrDefaultAsync(m => m.Id == id);

            if (ReferenciaLab == null)
            {
                return(NotFound());
            }

            ViewData["Id"] = new SelectList(_context.Referencias, "Id", "Nombre");
            return(Page());
        }