Example #1
0
        public ActionResult Index(IndexViewModel model)
        {
            if (!Request.IsAjaxRequest())
                model = new IndexViewModel
                {
                    Versions = new List<SelectListItem>
                    {
                        //new SelectListItem { Text = "Select a version...", Value = "Select a version..."},
                        new SelectListItem {Text = "1.0.0", Value = "1.0.0"},
                        new SelectListItem {Text = "1.0.1", Value = "1.0.1"},
                        new SelectListItem {Text = "1.1.0", Value = "1.1.0"},
                        new SelectListItem {Text = "2.0.0", Value = "2.0.0"},
                        new SelectListItem {Text = "2.1.0", Value = "2.1.0"}
                    },
                    Changes = new List<Change>()
                };
            else
            {
                model.Changes = new List<Change>
                {
                    new Change {Id = "123", Title = "Something"},
                    new Change {Id = "456", Title = "Something Else"}
                };
                return PartialView("_ChangesList", model);
            }

            return View(model);
        }
Example #2
0
        //
        // GET: /Manage/Index
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            ViewBag.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."
                : "";

            var userId = User.Identity.GetUserId();
            var model = new IndexViewModel
            {
                HasPassword = HasPassword(),
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
                Logins = await UserManager.GetLoginsAsync(userId),
                BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
            };
            return View(model);
        }