public async Task <IActionResult> Edit(int id, [Bind("ID,CreationDate,Name,FamilyName,E_Mail,UserID,Visible")] Profile profile) { if (id != profile.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(profile); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfileExists(profile.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(profile)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Title,CreationDate,ValidFromDate,ValidTillDate,Text,Visible,BelongsToAssocID")] Document document) { if (id != document.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(document); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DocumentExists(document.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(document)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,CreationDate,Name,ShortName")] Association association) { if (id != association.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(association); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssociationExists(association.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(association)); }
public async Task <IActionResult> Edit(int id, List <IFormFile> file, [FromForm] string titulo, [FromForm] string processo, [FromForm] string categoria, Documents documents) { if (id != documents.Codigo) { return(NotFound()); } if (ModelState.IsValid) { this.convertFileByte(file, titulo, processo, categoria, documents); try { _context.Update(documents); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DocumentsExists(documents.Codigo)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(documents)); }