Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            MaterialOfGloves = await _context.MaterialOfGloves
                               .Include(m => m.Gloves).FirstOrDefaultAsync(m => m.Id == id);

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

            MaterialOfGloves = await _context.MaterialOfGloves
                               .Include(m => m.Gloves).FirstOrDefaultAsync(m => m.Id == id);

            if (MaterialOfGloves == null)
            {
                return(NotFound());
            }
            ViewData["GlovesId"] = new SelectList(_context.Gloves, "Id", "Id");
            return(Page());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

            return(RedirectToPage("./Index"));
        }