예제 #1
0
        public async Task <ActionResult <BookText> > GetBookText(int languageId)
        {
            var bookText = new BookText {
                Sentences = _context.BookTexts.Where(i => i.LanguageId == languageId).ToList()
            };

            if (bookText == null)
            {
                return(NotFound());
            }

            return(bookText);
        }
예제 #2
0
        public BookText getRandomBookText()
        {
            getRandomBookText_Result result = _context.getRandomBookText().First();
            BookText bt = new BookText
            {
                Author    = result.Author,
                ShortName = result.ShortName,
                Text      = result.Text,
                Title     = result.Title,
                Reference = result.Reference
            };

            return(bt);
        }
예제 #3
0
        public ActionResult Index()
        {
            Random             r     = new Random();
            List <vwPhotoData> model = _repo.GetRandomPhotoData(46);
            BookText           bt1   = _repo.getRandomBookText();

            ViewData.Add("book1", bt1);
            BookText bt2 = _repo.getRandomBookText();

            ViewData.Add("book2", bt2);
            ViewBag.Date = "Date";
            ViewBag.r1   = r.Next(24, 27);
            ViewBag.r2   = r.Next(34, 36);

            return(View(model));
        }