Exemplo n.º 1
0
        public ActionResult EditChapter([Bind()] Models.ViewModels.Books4.EditChapter.EditChapter 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));
        }
Exemplo n.º 2
0
        public ActionResult EditChapter(Guid documentId)
        {
            var v = new Models.ViewModels.Books4.EditChapter.EditChapter(documentId);

            return(View(v));
        }