public ActionResult Insert(VerseModel model) { if (!ModelState.IsValid) { return(View()); } VerseService vs = new VerseService(model); vs.InsertVerse(); return(View()); }
public ActionResult Insert(VerseModel model) { if (!ModelState.IsValid) { ViewBag.Message = "This verse was already added previously!"; return(View("Index")); } VerseService service = new VerseService(model); service.InsertVerse(); ViewBag.Message = "You have added: " + model.Book + " " + model.Chapter + ":" + model.Verse + " to the app!"; return(View("Index")); }