예제 #1
0
        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"));
        }
예제 #3
0
 public ActionResult AddAbout(About a)
 {
     abm.AboutAdd(a);
     return(RedirectToAction("Index"));
 }
예제 #4
0
 public ActionResult AddAbout(About about)
 {
     aboutManager.AboutAdd(about);
     return(RedirectToAction("Index"));
 }
예제 #5
0
 public ActionResult AddAbout(About p)
 {
     p.AboutStatus = true;
     abm.AboutAdd(p);
     return(RedirectToAction("Index"));
 }