protected void btnChangePwd_Click(object sender, EventArgs e) { if (Page.IsValid) { lbPwdMsg.Text = ""; D_LoginUserInfo ui = Session["LoginUserInfo"] as D_LoginUserInfo; EmployeeBiz biz = new EmployeeBiz(); if (biz.ChangeMyPassword(ui.userId, txtOldPassword.Text, txtPassword.Text) == false) { lbPwdMsg.Text = "原密码不正确,请检查。"; txtOldPassword.Focus(); } else lbPwdMsg.Text = "密码已修改."; } }
protected void btnChangePwd_Click(object sender, EventArgs e) { if (Page.IsValid) { lbPwdMsg.Text = ""; int employeeID = PageTools.GetSavedId("EmployeeID", null); if (employeeID == 0) { lbPwdMsg.Text = "没有指定employee"; return; } EmployeeBiz biz = new EmployeeBiz(); if (Request.QueryString["id"] == null) { if (biz.ChangeMyPassword(employeeID, txtOldPassword.Text, txtPassword.Text) == false) { lbPwdMsg.Text = "原密码不正确,请检查。"; txtOldPassword.Focus(); } else Response.Redirect("MyAccount.aspx"); } else { if (biz.ChangePassword(employeeID, txtPassword.Text) == false) { lbPwdMsg.Text = "密码修改失败,请检查。"; txtPassword.Focus(); } else Response.Redirect("EmployeeEdit.aspx?id=" + employeeID.ToString(), true); } } }