Пример #1
0
        public ActionResult EditAddition([Bind()] Models.ViewModels.Books4.EditAddition.EditAddition 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));
        }
Пример #2
0
        public ActionResult EditAddition(Guid additionId)
        {
            var v = new Models.ViewModels.Books4.EditAddition.EditAddition(additionId);

            if (!v._isExist)
            {
                return(HttpNotFound());
            }

            return(View(v));
        }