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

            HVKage = await _context.HVKage
                     .Include(h => h.KVillages).FirstOrDefaultAsync(m => m.KID == id);

            if (HVKage == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            HVKage = await _context.HVKage
                     .Include(h => h.KVillages).FirstOrDefaultAsync(m => m.KID == id);

            if (HVKage == null)
            {
                return(NotFound());
            }
            ViewData["HVID"] = new SelectList(_context.HVillage, "HVID", "HVID");
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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