public async Task <IActionResult> Index(ManageMessageId?message = null) { ViewData["StatusMessage"] = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : message == ManageMessageId.SaveSuccess ? "Saved" : ""; var user = await GetCurrentUserAsync(); ViewData["User"] = user; ViewData["Languages"] = LanguagesCache.GetAll(); var model = new IndexViewModel { HasPassword = await _userManager.HasPasswordAsync(user), PhoneNumber = await _userManager.GetPhoneNumberAsync(user), TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), Logins = await _userManager.GetLoginsAsync(user), BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) }; return(View(model)); }
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 })); }
// 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)); }