Beispiel #1
0
        public ActionResult CreateChapterSameLevel([Bind()] Models.ViewModels.Books4.CreateChapterSameLevel.CreateChapterSameLevel v)
        {
            if (ModelState.IsValid)
            {
                var result = v.Save();

                if (result.Result)
                {
                    return(RedirectToAction("DetailsChapter", new { id = v.DocumentId }));
                }
                else if (result.ValidateErrors.Count() == 0)
                {
                    return(HttpNotFound());
                }
                else
                {
                    foreach (var error in result.ValidateErrors)
                    {
                        ModelState.AddModelError(error.ParaName, error.Description);
                    }
                }
            }

            return(View(v));
        }
Beispiel #2
0
        public ActionResult CreateChapterSameLevel(Guid currentDocumentId, Guid?currentDocumentIdToSetFinished)
        {
            var v = new Models.ViewModels.Books4.CreateChapterSameLevel.CreateChapterSameLevel(currentDocumentId);

            v.CurrentDocumentIdToSetFinished = currentDocumentIdToSetFinished;

            return(View(v));
        }