Beispiel #1
0
        public ActionResult CreateChapterSubLevel([Bind()] Models.ViewModels.Books4.CreateChapterSubLevel.CreateChapterSubLevel 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 CreateChapterSubLevel(Guid parentDocumentId)
        {
            var v = new Models.ViewModels.Books4.CreateChapterSubLevel.CreateChapterSubLevel(parentDocumentId);

            return(View(v));
        }