public ActionResult Chapters_Destroy([DataSourceRequest]DataSourceRequest request, ChapterAdminViewModel chapter) { if (this.ModelState.IsValid) { var entity = new Chapter { Id = chapter.Id, IsDeleted = true }; this.chapterService.Update(entity); } return this.Json(new[] { chapter }.ToDataSourceResult(request, this.ModelState)); }
public ActionResult Chapters_Update([DataSourceRequest]DataSourceRequest request, ChapterAdminViewModel chapter) { if (this.ModelState.IsValid) { var entity = new Chapter { Id = chapter.Id, Title = chapter.Title, ModifiedOn = DateTime.Now, Content = chapter.Content, StoryId = chapter.StoryId, PreviousChapterId = chapter.PreviousChapterId, AuthorId = chapter.AuthorId, }; this.chapterService.Update(entity); } return this.Json(new[] { chapter }.ToDataSourceResult(request, this.ModelState)); }