public ActionResult Search(VerseModel model) { if (!ModelState.IsValid) { return(View("Search")); } VerseService vs = new VerseService(model); List <string> text = vs.SearchVerses(); return(View("SearchResults", text)); }
public ActionResult Insert(VerseModel model) { if (!ModelState.IsValid) { return(View()); } VerseService vs = new VerseService(model); vs.InsertVerse(); return(View()); }
public ActionResult Search(VerseModel model) { if (!ModelState.IsValid) { return(View("Index")); } VerseService service = new VerseService(model); List <string> text = service.SearchVerses(); return(View("Results", text)); }
public async Task <ActionResult <Passage> > GetPassageAsync(Books book, byte chapter, byte verse, [FromQuery] byte length = 1, [FromQuery] Translations translation = Translations.KJV) { if (chapter == 0 || verse == 0 || length == 0) { return(BadRequest()); } var passageRef = new PassageReference(book, chapter, verse, length, 0, 0); var verses = await VerseService.GetVersesAsync(passageRef.Verses, translation); return(Ok(verses)); }
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")); }