public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LastName,Adress,email,CelphoneNumber,Position")] 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))); } return(View(contact)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Date,IsVirtual")] Meeting meeting) { if (id != meeting.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(meeting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingExists(meeting.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(meeting)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LegalDocument,WebSite,Adress,CelphoneNumber,Sector")] 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)); }
public async Task <IActionResult> Edit(int id, [Bind("id,Name,Surname,DateOfBirth,Login")] 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,Title,Detail,ReportedBy,State")] SupportTicket supportTicket) { if (id != supportTicket.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(supportTicket); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SupportTicketExists(supportTicket.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(supportTicket)); }
public async Task<IActionResult> Edit (int id, [Bind ("ID,Name,LastName,email,password,role")] 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); }