예제 #1
0
 /// <summary>
 /// Thuc hien thay doi mat khau cho nguoi dung
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnChangePass_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         UserAccount user = db.UserAccounts.SingleOrDefault <UserAccount>(u => u.UserId == UID);
         if (user != null)
         {
             user.Password = Hash.GetHashMD5Value(txtNewPass3.Text);
             SysUser sUser = user.SysUser;
             db.SubmitChanges();
             if (ckbSendAlertChangePassEmail.Checked)
             {
                 MailController.SendResetPassByAdminEmail(sUser.Email, user.AccountName, sUser.FirstSurName + " " + sUser.LastName, txtNewPass3.Text);
             }
             lblMessage.Text = Resources.AccountMessage.ChangePassSuccess;
         }
     }
 }