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

            cats_generales = await _context.cat_generales
                             .Include(c => c.Gene).SingleOrDefaultAsync(m => m.IdGeneral == id);

            if (cats_generales == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(short?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            cats_generales = await _context.cat_generales.FindAsync(id);

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

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

            cats_generales = await _context.cat_generales
                             .Include(c => c.Gene).SingleOrDefaultAsync(m => m.IdGeneral == id);

            if (cats_generales == null)
            {
                return(NotFound());
            }
            ViewData["IdTipoGeneral"] = new SelectList(_context.cat_tipos_generales, "IdTipoGeneral", "IdTipoGeneral");
            return(Page());
        }