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

            Dolznost = await _context.Dolznost.FirstOrDefaultAsync(m => m.ID == id);

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

            Dolznost = await _context.Dolznost.FirstOrDefaultAsync(m => m.ID == id);

            if (Dolznost == null)
            {
                return(NotFound());
            }
            sotrudniki = await _context.sotrudniki.Where(m => m.DolznostID == Dolznost.ID).ToListAsync();

            return(Page());
        }
Example #3
0
        public async Task <IActionResult> OnPostAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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