Exemple #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Nombre")] Persona persona)
        {
            if (id != persona.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persona);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonaExists(persona.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persona));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Details")] Accion accion)
        {
            if (id != accion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(accion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AccionExists(accion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(accion));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Matricula")] Medico medico)
        {
            if (id != medico.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(medico);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MedicoExists(medico.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"] = new SelectList(_context.Personas, "Id", "Id", medico.Id);
            return(View(medico));
        }
Exemple #4
0
 public void Atualizar(Voucher voucher)
 {
     _context.Update(voucher);
 }