예제 #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(Preguntas).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PreguntasExists(Preguntas.PreguntaId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        // 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(Tutor).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TutorExists(Tutor.TutorId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Redirect("./DetailsUser?id=" + Tutor.TutorId));
        }
        // 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.Cuestionario.Add(Cuestionario);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Tutor.Add(Tutor);
            await _context.SaveChangesAsync();

            return(RedirectToPage("/Home/UserPage"));
        }
        // 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());
            }
            Tutor.Contraseña = BCrypt.Net.BCrypt.HashPassword(Tutor.Contraseña);
            _context.Tutor.Add(Tutor);
            await _context.SaveChangesAsync();


            return(Redirect("./DetailsUser?id=" + Tutor.TutorId));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

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

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

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

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

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

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

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

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

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

            Centro_educativo = await _context.Centro_Educativo.FindAsync(id);

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

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