Example #1
0
        // To protect from overposting attacks, please 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(Periodo).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PeriodoExists(Periodo.periodoID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Example #2
0
        // To protect from overposting attacks, please 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.Grados.Add(Grado);
            await _context.SaveChangesAsync();

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

            Matricula = await _context.Matriculas.FindAsync(id);

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

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

            Estudiante = await _context.Estudiantes.FindAsync(id);

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

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

            Tutor = await _context.Tutors.FindAsync(id);

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

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