本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}