Esempio n. 1
0
        public async Task <ActionResult> NewBook()
        {
            ViewBag.Tab       = "Desk";
            ViewBag.Genres    = GenreCache.GetAll();
            ViewBag.Languages = LanguagesCache.GetAll();

            var user = await GetCurrentUserAsync();

            var newBookKey = Guid.NewGuid(); //_service.StartANewBook(user);

            return(RedirectToAction("Book", "Desk", new { key = newBookKey }));
        }
Esempio n. 2
0
        internal async System.Threading.Tasks.Task <Genres> GetGenre(long ger)
        {
            if (GenreCache.TryGetValue(ger, out Genres genre))
            {
                return(genre);
            }
            var jsonResult = await webclient.DownloadStringTaskAsync("https://api-endpoint.igdb.com/" + "genres/" + ger);

            var ge = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Genres> >(jsonResult)[0];

            GenreCache.Add(ger, ge);
            return(ge);
        }
Esempio n. 3
0
        // GET: /Desk/Book
        public async Task <ActionResult> Book(string key, string message)
        {
            ViewBag.Key       = key;
            ViewBag.Tab       = "Desk";
            ViewBag.SubTab    = "Book";
            ViewBag.Genres    = GenreCache.GetAll();
            ViewBag.Languages = LanguagesCache.GetAll();

            if (!string.IsNullOrEmpty(message))
            {
                ViewBag.StatusMessage = message;
            }

            return(View(new BookModel()));// _service.GetBookByKey(key));
        }