public async Task <IActionResult> Edit(int id, [Bind("id,name,lastName,email,userName,password,phone,job")] User user) { if (id != user.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("id,ClientId,name,lastName,email,phone,jobPositions")] Contact contact) { if (id != contact.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contact); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactExists(contact.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", contact.ClientId); return(View(contact)); }
public async Task <IActionResult> Edit(int id, [Bind("id,subject,problem,who,ClientId,state")] SupportTickets supportTickets) { if (id != supportTickets.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(supportTickets); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SupportTicketsExists(supportTickets.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", supportTickets.ClientId); return(View(supportTickets)); }
public async Task <IActionResult> Edit(int id, [Bind("id,subject,date,UserId,AVirtual,ClientId")] Meetings meetings) { if (id != meetings.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(meetings); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingsExists(meetings.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", meetings.ClientId); ViewData["UserId"] = new SelectList(_context.User, "id", "id", meetings.UserId); return(View(meetings)); }
public async Task <IActionResult> Edit(int id, [Bind("id,name,identityCard,webPage,address,phone,sectors")] Client client) { if (id != client.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(client); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(client.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(client)); }