Example #1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Inschrijving).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InschrijvingExists(Inschrijving.InschrijvingID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Example #2
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Verlofpoules.Add(Verlofpoule);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Example #3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                ZiekteAanvraag.AanvraagDatum = DateTime.Now;
                return(Page());
            }

            _context.ZiekteAanvragen.Add(ZiekteAanvraag);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Example #4
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Verlofpoule = await _context.Verlofpoules.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Example #5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Inschrijving = await _context.Inschrijvingen.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Example #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ZiekteAanvraag = await _context.ZiekteAanvragen.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Example #7
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            var emptyInschrijving = new Inschrijving();

            if (await TryUpdateModelAsync <Inschrijving>(
                    emptyInschrijving,
                    "inschrijving", // Prefix for form value.
                    s => s.InschrijvingID, s => s.VerlofpouleID))
            {
                _context.Inschrijvingen.Add(emptyInschrijving);
                await _context.SaveChangesAsync();

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

            // Select DepartmentID if TryUpdateModelAsync fails.
            PopulateVerlofpoulesDropDownList(_context, emptyInschrijving.VerlofpouleID);
            return(Page());
        }