public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre")] SectorModel sectorModel) { if (id != sectorModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sectorModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SectorModelExists(sectorModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sectorModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Titulo,Dia,UsuarioId,presencial,ClienteId")] ReunionModel reunionModel) { if (id != reunionModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reunionModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReunionModelExists(reunionModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClienteId"] = new SelectList(_context.Cliente, "Id", "Nombre", reunionModel.ClienteId); ViewData["UsuarioId"] = new SelectList(_context.Set <UsuarioModel>(), "Id", "Nombre", reunionModel.UsuarioId); return(View(reunionModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Problema,Detalle,Estado,ClienteId")] SupportModel supportModel) { if (id != supportModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(supportModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SupportModelExists(supportModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClienteId"] = new SelectList(_context.Cliente, "Id", "Nombre", supportModel.ClienteId); return(View(supportModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,telefono,PuestoTrabajo,privilegios,cedula,contrasena")] UsuarioModel usuarioModel) { if (id != usuarioModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuarioModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioModelExists(usuarioModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuarioModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Juridica,Direccion,Numero,SectorId")] ClienteModel clienteModel) { if (id != clienteModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clienteModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteModelExists(clienteModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SectorId"] = new SelectList(_context.Sector, "Id", "Nombre", clienteModel.SectorId); return(View(clienteModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Apellido,Correo,Numero,Puesto,ClienteId")] ContactoModel contactoModel) { if (id != contactoModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contactoModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactoModelExists(contactoModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClienteId"] = new SelectList(_context.Cliente, "Id", "Nombre", contactoModel.ClienteId); return(View(contactoModel)); }