本文整理汇总了C#中UserAccount.GetUserAccountByEmail方法的典型用法代码示例。如果您正苦于以下问题:C# UserAccount.GetUserAccountByEmail方法的具体用法?C# UserAccount.GetUserAccountByEmail怎么用?C# UserAccount.GetUserAccountByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount.GetUserAccountByEmail方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string email = Server.UrlDecode(Request.QueryString[SiteEnums.QueryStringNames.email.ToString()]);
string autoUnSub = Server.UrlDecode(Request.QueryString[SiteEnums.QueryStringNames.autounsubscribe.ToString()]);
if (!string.IsNullOrWhiteSpace(email) &&
!string.IsNullOrWhiteSpace(autoUnSub))
{
var ua = new UserAccount();
ua.GetUserAccountByEmail(email);
var uad = new UserAccountDetail();
uad.GetUserAccountDeailForUser(ua.UserAccountID);
uad.EmailMessages = false;
uad.Update();
}
}
示例2: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
var ua = new UserAccount();
ua.GetUserAccountByEmail(txtEmail.Text.Trim());
if (ua.UserAccountID == 0)
{
litResult.Text = @"<span style=""color:red"">Email not found!</span>";
return;
}
var uad = new UserAccountDetail();
uad.GetUserAccountDeailForUser(ua.UserAccountID);
uad.EmailMessages = false;
if (uad.Update())
{
litResult.Text = @"<span style=""color:green"">Unsubscribed!</span>";
}
else
{
litResult.Text = @"<span style=""color:red"">error!</span>";
}
}
示例3: LogOn
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
bool remember = Convert.ToBoolean(model.RememberMe);
if (string.IsNullOrWhiteSpace(model.UserName) ||
string.IsNullOrWhiteSpace(model.Password))
{
return View(model);
}
ua = new UserAccount(model.UserName);
if (ua.UserAccountID == 0)
{
ua = new UserAccount();
ua.GetUserAccountByEmail(model.UserName);
if (ua.UserAccountID > 0)
{
// they were stupid and put their email not username
model.UserName = ua.UserName;
}
}
if (Membership.ValidateUser(model.UserName, model.Password))
{
FormsAuthentication.RedirectFromLoginPage(model.UserName, remember);
if (!String.IsNullOrEmpty(returnUrl))
{
return Redirect(returnUrl);
}
else
{
ua = new UserAccount(model.UserName);
if (ua.IsLockedOut)
{
ModelState.AddModelError(string.Empty, BootBaronLib.Resources.Messages.IsLockedOut);
return View(model);
}
ua.LastLoginDate = DateTime.UtcNow;
ua.FailedPasswordAttemptCount = 0;
ua.IsOnLine = true;
ua.SigningOut = false;
ua.Update();
UserAccountDetail uad = new UserAccountDetail();
uad.GetUserAccountDeailForUser(ua.UserAccountID);
//uad.DefaultLanguage = Utilities.GetCurrentLanguageCode();
//uad.Update();
if (!string.IsNullOrWhiteSpace(uad.DefaultLanguage))
{
HttpCookie hc =
new HttpCookie(SiteEnums.CookieName.usersetting.ToString(), uad.DefaultLanguage);
NameValueCollection nvc = new NameValueCollection();
nvc.Add(SiteEnums.CookieValue.language.ToString(), uad.DefaultLanguage);
Utilities.CookieMaker(SiteEnums.CookieName.usersetting, nvc);
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(uad.DefaultLanguage);
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(uad.DefaultLanguage);
}
return RedirectToAction("Home", "Account");
}
}
else
{
// it updates as online, make off
ua = new UserAccount(model.UserName);
if (ua.UserAccountID > 0)
{
ua.IsOnLine = false;
ua.SigningOut = true;
ua.Update();
}
}
}
ModelState.AddModelError(string.Empty, BootBaronLib.Resources.Messages.LoginUnsuccessfulPleaseCorrect);
// If we got this far, something failed, redisplay form
return View(model);
}
示例4: ForgotPassword
public ActionResult ForgotPassword(string email)
{
UserAccount ua = new UserAccount();
ua.GetUserAccountByEmail(email);
if (ua.UserAccountID == 0)
{
ViewBag.Result = Messages.NotFound;
}
else
{
ua.FailedPasswordAnswerAttemptCount = 0;
ua.FailedPasswordAttemptCount = 0;
ua.IsLockedOut = false;
ua.Update();
mu = Membership.GetUser(ua.UserName);
string newPassword = mu.ResetPassword();
BootBaronLib.Operational.Utilities.SendMail(email, BootBaronLib.Configs.AmazonCloudConfigs.SendFromEmail, Messages.PasswordReset,
Messages.UserName + ": " + ua.UserName + Environment.NewLine +
Environment.NewLine + Messages.NewPassword + ": " + newPassword +
Environment.NewLine +
Environment.NewLine + Messages.SignIn + ": " + BootBaronLib.Configs.GeneralConfigs.SiteDomain);
ViewBag.Result = Messages.CheckYourEmailAndSpamFolder;
}
return View();
}
示例5: FindByEmail
public ActionResult FindByEmail(string email)
{
var ua = new UserAccount();
ua.GetUserAccountByEmail(email);
if (ua.UserAccountID > 0)
{
SetUserAccountToEdit(ua);
}
LoadAllRoles();
return View("UserManagement");
}
示例6: ForgotPassword
public ActionResult ForgotPassword(string email)
{
var ua = new UserAccount();
ua.GetUserAccountByEmail(email);
if (ua.UserAccountID == 0)
{
ViewBag.Result = Messages.NotFound;
}
else
{
ua.FailedPasswordAnswerAttemptCount = 0;
ua.FailedPasswordAttemptCount = 0;
ua.Update();
_mu = Membership.GetUser(ua.UserName);
if (_mu != null)
{
string newPassword = _mu.ResetPassword();
_mail.SendMail(AmazonCloudConfigs.SendFromEmail, email, Messages.PasswordReset,
string.Format("{0}: {1}{2}{2}{3}: {4}{2}{2}{5}: {6}",
Messages.UserName, ua.UserName, Environment.NewLine,
Messages.NewPassword, newPassword, Messages.SignIn, GeneralConfigs.SiteDomain));
}
ViewBag.Result = Messages.CheckYourEmailAndSpamFolder;
}
return View();
}
示例7: FindByEmail
public ActionResult FindByEmail(string email)
{
UserAccount ua = new UserAccount();
ua.GetUserAccountByEmail(email);
if (ua.UserAccountID > 0)
{
ViewBag.SelectedUser = ua;
UserAccountDetail uad = new UserAccountDetail();
uad.GetUserAccountDeailForUser(ua.UserAccountID);
ViewBag.UserAccountDetail = uad;
}
LoadAllRoles();
return View("UserManagement");
}