当前位置: 首页>>代码示例>>C#>>正文


C# ManageMessageId类代码示例

本文整理汇总了C#中ManageMessageId的典型用法代码示例。如果您正苦于以下问题:C# ManageMessageId类的具体用法?C# ManageMessageId怎么用?C# ManageMessageId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ManageMessageId类属于命名空间,在下文中一共展示了ManageMessageId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Index

        //
        // 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 manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
            var currentUser = manager.FindById(userId);

            var model = new IndexViewModel
            {
                HasPassword = HasPassword(),
                IoTConnectionString = currentUser.IoTHubConnectionString,
                IoTHubEndpoint = currentUser.IoTHubEndpoint,
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
                Logins = await UserManager.GetLoginsAsync(userId),
                BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
            };
            return View(model);
        }
开发者ID:ThingLabsIo,项目名称:ThingLabsWeb,代码行数:29,代码来源:ManageController.cs

示例2: Index

        // GET: Account/Settings
        public ActionResult Index(ManageMessageId? message)
        {
            ViewBag.SubTitle = "Settings";

            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
                : message == ManageMessageId.ChangeUsernameSuccess ? "Your username has been changed."
                : message == ManageMessageId.ChangeEmailSuccess ? "Your email 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."
                : "";

            if(message == ManageMessageId.Error)
            {
                ViewBag.StatusClass = "alert-danger";
            }
            else
            {
                ViewBag.StatusClass = "alert-success";
            }
            
            return View();
        }
开发者ID:nikolamajcen,项目名称:rent-a-car,代码行数:27,代码来源:SettingsController.cs

示例3: Index

        //
        // GET: /Manage/Index
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            ApplicationDbContext db = new ApplicationDbContext();

            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),
                MinutesBetweenAlerts = db.Users.Single(m => m.UserName == User.Identity.Name).MinutesBetweenAlerts,
            };

            return View(model);
        }
开发者ID:johnnyRose,项目名称:PiSpy,代码行数:29,代码来源:ManageController.cs

示例4: Index

        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."
                : "";

            var user = await GetCurrentUserAsync();
            if (user == null)
            {
                return View("Error");
            }
            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);
        }
开发者ID:CDPEAK,项目名称:MVCmovie,代码行数:26,代码来源:ManageController.cs

示例5: Index

        //
        // GET: /Manage/Index
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "パスワードが変更されました。"
                : message == ManageMessageId.SetPasswordSuccess ? "パスワードが設定されました。"
                : message == ManageMessageId.SetTwoFactorSuccess ? "2 要素認証プロバイダーが設定されました。"
                : message == ManageMessageId.Error ? "エラーが発生しました。"
                : message == ManageMessageId.AddPhoneSuccess ? "電話番号が追加されました。"
                : message == ManageMessageId.RemovePhoneSuccess ? "電話番号が削除されました。"
                : "";

            var userId = User.Identity.GetUserId();
            var user = await GetApplicationUser();
            if (user == null)
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);

            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),
                User = user
            };
            return View(model);
        }
开发者ID:VSShare,项目名称:VSShare-Server,代码行数:29,代码来源:ManageController.cs

示例6: Index

        // GET: /Manage/Index
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            this.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."
                                                                           : string.Empty;

            var userId = this.User.Identity.GetUserId();
            var user = this.UserManager.FindById(userId);
            var model = new IndexViewModel
            {
                PhotoUrl = user.ProfilePhotoUrl,

                HasPassword = this.HasPassword(),
                PhoneNumber = await this.UserManager.GetPhoneNumberAsync(userId),
                TwoFactor = await this.UserManager.GetTwoFactorEnabledAsync(userId),
                Logins = await this.UserManager.GetLoginsAsync(userId),
                BrowserRemembered =
                                    await
                                    this.AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
            };
            return this.View(model);
        }
开发者ID:ahansb,项目名称:BeerApp,代码行数:33,代码来源:ManageController.cs

示例7: Index

        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."
                : "";

            var user = GetCurrentUser();
            var model = new IndexViewModel
            {
                HasPassword = await _userManager.HasPasswordAsync(user),
                EmailAddress = user.Email,
                IsEmailAddressConfirmed = user.EmailConfirmed,
                PhoneNumber = await _userManager.GetPhoneNumberAsync(user),
                TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user),
                Logins = await _userManager.GetLoginsAsync(user),
                BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user),
                AssociatedSkills = user.AssociatedSkills,
                TimeZoneId = user.TimeZoneId,
                Name = user.Name
            };
            return View(model);
        }
开发者ID:weiplanet,项目名称:allReady,代码行数:27,代码来源:ManageController.cs

示例8: Index

        //
        // GET: /Manage/Index
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "Ваш пароль изменен."
                : message == ManageMessageId.SetPasswordSuccess ? "Пароль задан."
                : message == ManageMessageId.SetTwoFactorSuccess ? "Настроен поставщик двухфакторной проверки подлинности."
                : message == ManageMessageId.Error ? "Произошла ошибка."
                : message == ManageMessageId.AddPhoneSuccess ? "Ваш номер телефона добавлен."
                : message == ManageMessageId.RemovePhoneSuccess ? "Ваш номер телефона удален."
                : "";

            var userId = User.Identity.GetUserId();
            ApplicationUser us = db.Users.Where(x => x.Id == userId).First();
            ViewBag.User = us;
            ViewBag.Photo = us.Photo;
           
            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);
            
        }
开发者ID:Pryanic,项目名称:TimeBank13,代码行数:30,代码来源:ManageController.cs

示例9: Index

        // GET: Account/Email
        public ActionResult Index(ManageMessageId? message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.SentConfirmationEmail ? "Confirmation email has been sent to your email address."
                : message == ManageMessageId.ConfirmedEmailSuccess ? "Your email has been confirmed."
                : message == ManageMessageId.ChangeEmailSuccess ? "Your email has been changed."
                : message == ManageMessageId.Error ? "An error has occurred."
                : "";

            if (message == ManageMessageId.Error)
            {
                ViewBag.StatusClass = "alert-danger";
            }
            else
            {
                ViewBag.StatusClass = "alert-success";
            }

            var user = UserManager.FindById(User.Identity.GetUserId<int>());

            EmailViewModel model = new EmailViewModel
            {
                EmailAddress = user.Email,
                EmailConfirmed = user.EmailConfirmed
            };

            return View(model);
        }
开发者ID:nikolamajcen,项目名称:rent-a-car,代码行数:29,代码来源:EmailController.cs

示例10: Index

        //
        // GET: /Manage/Index
        //public ActionResult Index()
        //{
        //    var userId = getGuid(User.Identity.GetUserId());
        //    var model = _userManager.FindById(userId);

        //   // var model = new IndexViewModel();

        //    return View(model);
        //}

        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."
                : message == ManageMessageId.ChangeEmailSuccess ? "Your Email was changed."
                : message == ManageMessageId.ChangeNumberSuccess ? "Your phone number was changed."
                : message == ManageMessageId.ChangeInfoSuccess ? "Your information was changed."
                : "";

            var userId = getGuid(User.Identity.GetUserId());
            var user = _userManager.FindById(userId);

            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.ToString())
                //MyCustomField = user.MyCustomField
            };
            model.ChangeCityModel = user.City;
            model.ChangeNameModel = user.Name;
            model.ChangeLastNameModel = user.LastName;
            return View(model);
        }
开发者ID:karosas,项目名称:Congregatio,代码行数:43,代码来源:ManageController.cs

示例11: Index

        //
        // 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)
            };

            var tickets = from ticket in db.Tickets
                          select ticket;

            tickets = tickets.Where(x => x.OwnerLogin == User.Identity.Name && x.DateFrom > DateTime.Now);

            var user = MyUserManager.FindById(User.Identity.GetUserId());

            var viewModel = new IndexViewModel();
            viewModel.UserMoney = user.UserMoney;
            viewModel.UserTickets = tickets.ToList();

            return View(viewModel);
        }
开发者ID:resaglow,项目名称:study,代码行数:36,代码来源:ManageController.cs

示例12: Index

        //
        // 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 user = UserManager.Users.Where(_ => _.Id == userId).FirstOrDefault();
            var model = new IndexViewModel
            {
                HasPassword = HasPassword(),
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                Logins = await UserManager.GetLoginsAsync(userId),
                BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId),
                City = user.City,
                FirstName = user.FirstName,
                LastName = user.LastName,
                StreetAndNumber = user.StreetAndNumber,
                ZipCode = user.ZipCode
            };
            return View(model);
        }
开发者ID:derderov,项目名称:Trucizny,代码行数:29,代码来源:ManageController.cs

示例13: Index

        //
        // GET: /Account/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 provider has been set."
                : message == ManageMessageId.Error ? "An error has occurred."
                : message == ManageMessageId.AddPhoneSuccess ? "The phone number was added."
                : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed."
                : "";

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

            // check if display cancel option
            if(hasSubscription() == true)
                ViewData["hasSubscription"] = true;
            else
                ViewData["hasSubscription"] = false;

            return View(model);
        }
开发者ID:SwavekS,项目名称:WorkDistributionService,代码行数:30,代码来源:ManageController.cs

示例14: Index

        //
        // 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."
                : "";

            // DRM Changed -- all occurences in this file
            //TODO: need better implementation of this to avoif the X.Parse junk...
            //x var userId = User.Identity.GetUserId();
            var userId = Guid.Parse(User.Identity.GetUserId());
            var model = new IndexViewModel
            {
                HasPassword = HasPassword(),
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
                Logins = await UserManager.GetLoginsAsync(userId),
                // DRM Changed
                //x BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
                BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId.ToString())
            };

            var context = HttpContext.GetOwinContext().Get<ApplicationDbContext>();
            model.UserId = context.CurrentUserId;
            model.UserName = context.CurrentUserName;

            return View(model);
        }
开发者ID:dmayhak,项目名称:HyperSlackers.DbContext,代码行数:34,代码来源:ManageController.cs

示例15: Index

        /// <summary>
        ///     Display UserProfile management view
        /// </summary>
        /// <param name="message">message about changes in account settings</param>
        /// <returns></returns>
        public async Task<ActionResult> Index(ManageMessageId? message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess
                    ? ManageResource.PasswordChanged
                    : message == ManageMessageId.SetPasswordSuccess
                        ? ManageResource.PasswordSet
                        : message == ManageMessageId.SetTwoFactorSuccess
                            ? ManageResource.TwoFactorAuthProviderSet
                            : message == ManageMessageId.Error
                                ? ManageResource.ErrorOccured
                                : message == ManageMessageId.AddPhoneSuccess
                                    ? ManageResource.PhoneNumberAdded
                                    : message == ManageMessageId.RemovePhoneSuccess
                                        ? ManageResource.PhoneNumberRemoved
                                        : "";

            var userId = User.Identity.GetUserId();
            var model = new IndexViewModel
            {
                HasPassword = this.HasPassword(),
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
                Logins = await UserManager.GetLoginsAsync(userId),
                BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
            };
            return this.View(model);
        }
开发者ID:sthapa123,项目名称:PV247-Expense-manager,代码行数:33,代码来源:ManageController.cs


注:本文中的ManageMessageId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。