public async Task <IActionResult> Edit(int id, [Bind("IdInstanciaPlantilla,Nombre,AspNetUser,Estado,Iniciada,Descripcion,Fecha")] InstanciasPlantillas instanciasPlantillas)
        {
            if (id != instanciasPlantillas.IdInstanciaPlantilla)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(instanciasPlantillas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InstanciasPlantillasExists(instanciasPlantillas.IdInstanciaPlantilla))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AspNetUser"] = new SelectList(_context.Users, "Id", "Id", instanciasPlantillas.AspNetUser);
            return(View(instanciasPlantillas));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPlantilla,Nombre,Descripcion")] Plantillas plantillas)
        {
            if (id != plantillas.IdPlantilla)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(plantillas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlantillasExists(plantillas.IdPlantilla))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(plantillas));
        }