public ActionResult AddAbout(About p) { ValidationResult results = aboutValidator.Validate(p); if (results.IsValid) { abm.AboutAdd(p); return(RedirectToAction("Index")); } else { foreach (var item in results.Errors) { ModelState.AddModelError(item.PropertyName, item.ErrorMessage); } } return(View()); }
public ActionResult AddAbout(About about) { AboutValidator aboutValidator = new AboutValidator(); ValidationResult result = aboutValidator.Validate(about); if (result.IsValid) { abm.AboutAdd(about); return(RedirectToAction("Index")); } else { foreach (var item in result.Errors) { ModelState.AddModelError(item.PropertyName, item.ErrorMessage); } } return(PartialView("AboutPartial")); }
public ActionResult AddAbout(About a) { abm.AboutAdd(a); return(RedirectToAction("Index")); }
public ActionResult AddAbout(About about) { aboutManager.AboutAdd(about); return(RedirectToAction("Index")); }
public ActionResult AddAbout(About p) { p.AboutStatus = true; abm.AboutAdd(p); return(RedirectToAction("Index")); }