示例#1
0
 protected void btnCo_Click(object sender, EventArgs e)
 {
     MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
     if (GridUser.FocusedRowIndex > -1)
     {
         DM_USER sysUser = (DM_USER)GridUser.GetRow(GridUser.FocusedRowIndex);
         sysUser.PASSWORD = DM_USER.Encrypt("123");
         _IDM_USERService.UpdateDM_USER_PASSWORD(sysUser, session.User.MA_DVIQLY);
         pcThongBao.ShowOnPageLoad = false;
     }
     else
     {
         GridUser.FocusedRowIndex = 0;
         DM_USER sysUser = (DM_USER)GridUser.GetRow(GridUser.FocusedRowIndex);
         sysUser.PASSWORD = DM_USER.Encrypt("123");
         if (sysUser != null)
         {
             _IDM_USERService.UpdateDM_USER_PASSWORD(sysUser, session.User.MA_DVIQLY);
         }
         pcThongBao.ShowOnPageLoad = false;
     }
 }
示例#2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            string msg = "";

            if (checkRetypePassword(ref msg))
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Cập nhật thành công.');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Đã xảy ra lỗi. " + msg + " vui lòng nhập lại.');", true);
                return;
            }

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            session.User.PASSWORD = DM_USER.Encrypt(txtPassWordNew.Text);
            _userService.UpdateDM_USER_PASSWORD(session.User, session.User.MA_DVIQLY);
            //WriteLog("Thay đổi mật khẩu", Action.Update);
        }