Esempio n. 1
0
 public async Task <ActionResult> Edit(int id, [Bind("CharacterID, Name, SweetRoleUserId")] Character character)
 {
     if (id != character.CharacterID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(character);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!CharacterExists(character.CharacterID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(character));
 }
Esempio n. 2
0
 public async Task <ActionResult> Edit(int id, [Bind("Title")] Scene scene)
 {
     if (id != scene.SceneID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(scene);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!StoryExists(scene.SceneID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(scene));
 }
Esempio n. 3
0
 public async Task <ActionResult> Edit(int id, [Bind("StoryID, Title, DateCreated, Genre, SweetRoleUserId")] Story story)
 {
     if (id != story.StoryID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(story);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!StoryExists(story.StoryID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(story));
 }