本文整理汇总了C#中SocioBoard.Model.UserRepository.UpdatePassword方法的典型用法代码示例。如果您正苦于以下问题:C# UserRepository.UpdatePassword方法的具体用法?C# UserRepository.UpdatePassword怎么用?C# UserRepository.UpdatePassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocioBoard.Model.UserRepository
的用法示例。
在下文中一共展示了UserRepository.UpdatePassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
Session["login"] = null;
Registration regpage = new Registration();
User user = (User)Session["LoggedUser"];
if (user != null)
{
user.EmailId = txtEmail.Text;
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
UserRepository userrepo = new UserRepository();
if (userrepo.IsUserExist(user.EmailId))
{
try
{
user.AccountType = Request.QueryString["type"];
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
Console.WriteLine(ex.StackTrace);
}
if (string.IsNullOrEmpty(user.Password))
{
user.Password = regpage.MD5Hash(txtPassword.Text);
userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName,user.AccountType);
MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text);
}
}
Session["LoggedUser"] = user;
Response.Redirect("Home.aspx");
}
}
示例2: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
Session["login"] = null;
Registration regpage = new Registration();
User user = (User)Session["LoggedUser"];
if (user != null)
{
user.EmailId = txtEmail.Text;
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
UserActivation objUserActivation = new UserActivation();
UserRepository userrepo = new UserRepository();
if (userrepo.IsUserExist(user.EmailId))
{
try
{
string acctype = string.Empty;
if (Request.QueryString["type"] != null)
{
if (Request.QueryString["type"] == "INDIVIDUAL" || Request.QueryString["type"] == "CORPORATION" || Request.QueryString["type"] == "SMALL BUSINESS")
{
acctype = Request.QueryString["type"];
}
else
{
acctype = "INDIVIDUAL";
}
}
else
{
acctype = "INDIVIDUAL";
}
user.AccountType = Request.QueryString["type"];
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
Console.WriteLine(ex.StackTrace);
}
if (string.IsNullOrEmpty(user.Password))
{
user.Password = regpage.MD5Hash(txtPassword.Text);
userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName,user.AccountType);
//add userActivation
objUserActivation.Id = Guid.NewGuid();
objUserActivation.UserId = user.Id;
objUserActivation.ActivationStatus = "0";
UserActivationRepository.Add(objUserActivation);
//add package start
UserPackageRelation objUserPackageRelation = new UserPackageRelation();
UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository();
PackageRepository objPackageRepository = new PackageRepository();
Package objPackage = objPackageRepository.getPackageDetails(user.AccountType);
objUserPackageRelation.Id = new Guid();
objUserPackageRelation.PackageId = objPackage.Id;
objUserPackageRelation.UserId = user.Id;
objUserPackageRelation.ModifiedDate = DateTime.Now;
objUserPackageRelation.PackageStatus = true;
objUserPackageRelationRepository.AddUserPackageRelation(objUserPackageRelation);
//end package
MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text,user.Id.ToString());
}
}
Session["LoggedUser"] = user;
Response.Redirect("Home.aspx");
}
}