public async Task <IActionResult> Edit(int id, [Bind("Id,Score,FaceId,Type")] EmotionModel emotionModel) { if (id != emotionModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(emotionModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmotionModelExists(emotionModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FaceId"] = new SelectList(_context.Faces, "Id", "Id", emotionModel.FaceId); return(View(emotionModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Path")] PictureModel pictureModel) { if (id != pictureModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pictureModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PictureModelExists(pictureModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pictureModel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PictureId,Top,Left,Width,Height")] FaceModel faceModel) { if (id != faceModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(faceModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FaceModelExists(faceModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PictureId"] = new SelectList(_context.Pictures, "Id", "Id", faceModel.PictureId); return(View(faceModel)); }