Example #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (Session["UserLogin"] != null)
     {
         UserExtension_DTO objInfo = (UserExtension_DTO)Session["UserLogin"];
         User_BAL          objImpl = new User_BAL();
         if (objInfo.Password == StringHelper.MD5(txtCurrentPassword.Text))
         {
             objImpl.ChangePassword(objInfo.UserID, StringHelper.MD5(txtNewPassword.Text));
             litError.Text = "<div class='alert alert-danger'><button class='close' data-close='alert'></button><span>Thay đổi mật khẩu thành công!</span></div>";
         }
         else
         {
             litError.Text = "<div class='alert alert-danger'><button class='close' data-close='alert'></button><span>Mật khẩu không đúng!</span></div>";
         }
     }
 }
Example #2
0
        protected void rptUser_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int      userID  = int.Parse(e.CommandArgument.ToString());
            string   cmd     = e.CommandName;
            User_BAL objImpl = new User_BAL();

            if (cmd == "ResetPassword")
            {
                objImpl.ChangePassword(userID, StringHelper.MD5("123456"));
                litError.Text = "<div class='alert alert-danger'><button class='close' data-close='alert'></button><span>Reset mật khẩu thành công!</span></div>";
            }
            else if (cmd == "LockUsser")
            {
                objImpl.UpdateLockUsser(userID, true);
                litError.Text = "<div class='alert alert-danger'><button class='close' data-close='alert'></button><span>Khóa tài khoản thành công!</span></div>";
            }
            else if (cmd == "UnLockUsser")
            {
                objImpl.UpdateLockUsser(userID, false);
                litError.Text = "<div class='alert alert-danger'><button class='close' data-close='alert'></button><span>Mở khóa tài khoản thành công!</span></div>";
            }
            LoadData();
        }