public async Task <IActionResult> Edit(int id, [Bind("ProductoID,EmpresaID,Nombre,Precio,UrlImg,Tipo,Unidad,Codigo,Promocion,Descuento")] Producto producto) { if (id != producto.ProductoID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(producto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductoExists(producto.ProductoID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmpresaID"] = new SelectList(_context.Empresa, "EmpresaID", "EmpresaID", producto.EmpresaID); return(View(producto)); }
public async Task <IActionResult> Edit(int id, [Bind("ModeloNegocioID,Descripcion")] ModeloNegocio modeloNegocio) { if (id != modeloNegocio.ModeloNegocioID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(modeloNegocio); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ModeloNegocioExists(modeloNegocio.ModeloNegocioID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(modeloNegocio)); }
public async Task <IActionResult> Edit(int id, [Bind("CiiuClaseID,CiiuGrupoID,Descripcion,Codigo")] CiiuClase ciiuClase) { if (id != ciiuClase.CiiuClaseID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ciiuClase); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CiiuClaseExists(ciiuClase.CiiuClaseID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CiiuGrupoID"] = new SelectList(_context.Set <CiiuGrupo>(), "CiiuGrupoID", "CiiuGrupoID", ciiuClase.CiiuGrupoID); return(View(ciiuClase)); }
public async Task <IActionResult> Edit(int id, [Bind("ComponenteID,SeccionID,Descripcion,Tipo,Visible")] Componente componente) { if (id != componente.ComponenteID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(componente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComponenteExists(componente.ComponenteID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SeccionID"] = new SelectList(_context.Set <Seccion>(), "SeccionID", "SeccionID", componente.SeccionID); return(View(componente)); }
public async Task <IActionResult> Edit(int id, [Bind("RolID")] Rol rol) { if (id != rol.RolID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rol); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RolExists(rol.RolID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rol)); }
public async Task <IActionResult> Edit(int id, [Bind("GaleriaID,UrlImg")] Galeria galeria) { if (id != galeria.GaleriaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(galeria); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GaleriaExists(galeria.GaleriaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(galeria)); }
public async Task <IActionResult> Edit(int id, [Bind("UsuarioID,Nombre,Apellido,Email,VerificacionEmail,Contrasenia")] Usuario usuario) { if (id != usuario.UsuarioID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(usuario.UsuarioID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuario)); }
public async Task <IActionResult> Edit(int id, [Bind("TipoRolID,RolID,UsuarioID,FechaInicio")] TipoRol tipoRol) { if (id != tipoRol.TipoRolID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipoRol); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoRolExists(tipoRol.TipoRolID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RolID"] = new SelectList(_context.Rol, "RolID", "RolID", tipoRol.RolID); ViewData["UsuarioID"] = new SelectList(_context.Set <Usuario>(), "UsuarioID", "Contrasenia", tipoRol.UsuarioID); return(View(tipoRol)); }
public async Task <IActionResult> Edit(int id, [Bind("SeccionID,PlantillaID,Visible")] Seccion seccion) { if (id != seccion.SeccionID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(seccion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SeccionExists(seccion.SeccionID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PlantillaID"] = new SelectList(_context.Plantilla, "PlantillaID", "PlantillaID", seccion.PlantillaID); return(View(seccion)); }
public async Task <IActionResult> Edit(int id, [Bind("SectorEconomicoID,CiiuClaseID,Codigo,Tipo")] SectorEconomico sectorEconomico) { if (id != sectorEconomico.SectorEconomicoID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sectorEconomico); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SectorEconomicoExists(sectorEconomico.SectorEconomicoID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CiiuClaseID"] = new SelectList(_context.CiiuClase, "CiiuClaseID", "CiiuClaseID", sectorEconomico.CiiuClaseID); return(View(sectorEconomico)); }
public async Task <IActionResult> Edit(int id, [Bind("EmpresaID,ModeloNegocioID,GaleriaID,SectorEconomicoID,RazonSocial,Nit")] Empresa empresa) { if (id != empresa.EmpresaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(empresa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmpresaExists(empresa.EmpresaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ModeloNegocioID"] = new SelectList(_context.Set <ModeloNegocio>(), "ModeloNegocioID", "ModeloNegocioID", empresa.ModeloNegocioID); return(View(empresa)); }
public async Task <IActionResult> Edit(int id, [Bind("UsuarioEmpresaID,EmpresaID,UsuarioID")] UsuarioEmpresa usuarioEmpresa) { if (id != usuarioEmpresa.UsuarioEmpresaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuarioEmpresa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioEmpresaExists(usuarioEmpresa.UsuarioEmpresaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmpresaID"] = new SelectList(_context.Empresa, "EmpresaID", "EmpresaID", usuarioEmpresa.EmpresaID); ViewData["UsuarioID"] = new SelectList(_context.Usuario, "UsuarioID", "Contrasenia", usuarioEmpresa.UsuarioID); return(View(usuarioEmpresa)); }
public async Task <IActionResult> Edit(int id, [Bind("PlantillaID,ModeloNegocioID,Fecha,Visible")] Plantilla plantilla) { if (id != plantilla.PlantillaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(plantilla); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlantillaExists(plantilla.PlantillaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ModeloNegocioID"] = new SelectList(_context.ModeloNegocio, "ModeloNegocioID", "ModeloNegocioID", plantilla.ModeloNegocioID); return(View(plantilla)); }
public async Task<IActionResult> Edit(int id, [Bind("CiiuSeccionID,Descripcion,Codigo")] CiiuSeccion ciiuSeccion) { if (id != ciiuSeccion.CiiuSeccionID) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(ciiuSeccion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CiiuSeccionExists(ciiuSeccion.CiiuSeccionID)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(ciiuSeccion); }