Exemplo n.º 1
0
        public ActionResult EditBook([Bind()] Models.ViewModels.Books4.EditBook.EditBook v)
        {
            if (ModelState.IsValid)
            {
                var result = v.Save();

                if (result.Result)
                {
                    return(RedirectToAction("Details", 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 EditBook(Guid documentId)
        {
            var v = new Models.ViewModels.Books4.EditBook.EditBook(documentId);

            return(View(v));
        }