コード例 #1
0
        //
        // GET: /Verse/Edit/5

        public ActionResult Edit(Guid id)
        {
            Verse verse = VerseManager.Get(id);

            ViewBag.ChapterId = new SelectList(ChapterManager.GetAll(), "Id", "Title", verse.ChapterId);
            return(View(verse));
        }
コード例 #2
0
        public ActionResult ReadReference(Guid id)
        {
            var verse = VerseManager.EagerLoadVerse(id);

            ViewBag.VerseNumber = verse.VerseNumber;

            return(PartialView(verse.Chapter.Book));
        }
コード例 #3
0
        public ActionResult Edit(Verse verse)
        {
            if (ModelState.IsValid)
            {
                VerseManager.Edit(verse);
                return(RedirectToAction("Index"));
            }

            return(View());
        }
コード例 #4
0
        public ActionResult AddReference(Guid targetVerseId, Guid sourceBookId, int sourceChapterNum, int sourceVerseNum, int startOffset, int endOffset)
        {
            var sourceVerse = VerseManager.GetByBookIdChapterVerse(sourceBookId, sourceChapterNum, sourceVerseNum);

            if (startOffset < endOffset)
            {
                ReferenceManager.Create(targetVerseId, sourceVerse.Id, startOffset, endOffset);
            }
            else
            {
                ReferenceManager.Create(targetVerseId, sourceVerse.Id, endOffset, startOffset);
            }

            return(View());
        }
コード例 #5
0
 public ActionResult DeleteConfirmed(Guid id)
 {
     VerseManager.Delete(id);
     return(RedirectToAction("Index"));
 }
コード例 #6
0
        //
        // GET: /Verse/Delete/5

        public ActionResult Delete(Guid id)
        {
            return(View(VerseManager.Get(id)));
        }
コード例 #7
0
        //
        // GET: /Verse/Details/5

        public ViewResult Details(Guid id)
        {
            return(View(VerseManager.Get(id)));
        }
コード例 #8
0
        //
        // GET: /Verse/

        public ViewResult Index()
        {
            return(View(VerseManager.GetAll()));
        }
コード例 #9
0
ファイル: BookReaderService.cs プロジェクト: imanf/BookReader
 public List <Verse> GetVerseList(Guid chapterId)
 {
     return(VerseManager.GetAllByChapter(chapterId));
 }
コード例 #10
0
 public JsonResult GetVerses(Guid chapterId)
 {
     return(Json(VerseManager.GetAllByChapter(chapterId)));
 }