Пример #1
0
        public ActionResult AddAbout(About about)
        {
            AboutValidator   aboutValidator   = new AboutValidator();
            ValidationResult validationResult = aboutValidator.Validate(about);

            if (validationResult.IsValid)
            {
                aboutManager.AboutAddBL(about);
                return(RedirectToAction("Index"));
            }
            else
            {
                foreach (var error in validationResult.Errors)
                {
                    ModelState.AddModelError(error.PropertyName, error.ErrorMessage);
                }
            }
            return(View());
        }
Пример #2
0
 public ActionResult AddAbout(About p)
 {
     abm.AboutAddBL(p);
     return(RedirectToAction("Index"));
 }
Пример #3
0
 public ActionResult AddAbout(About about)
 {
     aboutManager.AboutAddBL(about);
     return(RedirectToAction("Index"));
 }