public ActionResult AddAbout(About about)
        {
            AboutValidator   validationRules  = new AboutValidator();
            ValidationResult validationResult = validationRules.Validate(about);

            if (validationResult.IsValid)
            {
                am.AddAbout(about);
            }
            else
            {
                foreach (var item in validationResult.Errors)
                {
                    ModelState.AddModelError(item.PropertyName, item.ErrorMessage);
                }
            }
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult AddAbout(About about)
 {
     _aboutManager.AddAbout(about);
     return(RedirectToAction("Index"));
 }
Esempio n. 3
0
 public ActionResult AddAbout(About p)
 {
     abm.AddAbout(p);
     return(RedirectToAction("Index"));
 }