/// <summary> /// 更新密码操作 /// </summary> protected void btnCon_Click(object sender, EventArgs e) { string relpwd = this.txtrelpwd.Value.Trim(); string newpwd = this.txtnewpwd.Value.Trim(); string chkpwd = this.txtchkpwd.Value.Trim(); if (string.IsNullOrEmpty(relpwd) || string.IsNullOrEmpty(newpwd) || string.IsNullOrEmpty(chkpwd)) { FinalMessage("输入不完整或网络错误", "Edit_Psssword.aspx", 1); } if (newpwd != chkpwd) { FinalMessage("新密码两次输入不一致", "Edit_Psssword.aspx", 1); } if (newpwd.Length < 6 || newpwd.Length > 16) { FinalMessage("新密码长度与要求不符", "Edit_Psssword.aspx", 1); } Test_BUL.sys_Common common = new Test_BUL.sys_Common(); string strsql = " update tb_sys_userinfo set password='******' where id=" + ID + " and password='******' "; if (common.ExecuteSql(strsql) > 0) { Response.Redirect("Manage_Member.aspx"); } else { FinalMessage("修改失败", "Edit_Psssword.aspx", 1); } }
/// <summary> /// 更新密码操作 /// </summary> protected void btnCon_Click(object sender, EventArgs e) { string relpwd = this.txtrelpwd.Value.Trim(); string newpwd = this.txtnewpwd.Value.Trim(); string chkpwd = this.txtchkpwd.Value.Trim(); if (string.IsNullOrEmpty(relpwd) || string.IsNullOrEmpty(newpwd) || string.IsNullOrEmpty(chkpwd)) FinalMessage("输入不完整或网络错误", "Edit_Psssword.aspx", 1); if (newpwd != chkpwd) FinalMessage("新密码两次输入不一致", "Edit_Psssword.aspx", 1); if (newpwd.Length < 6 || newpwd.Length > 16) FinalMessage("新密码长度与要求不符", "Edit_Psssword.aspx", 1); Test_BUL.sys_Common common = new Test_BUL.sys_Common(); string strsql = " update tb_sys_userinfo set password='******' where id=" + ID + " and password='******' "; if (common.ExecuteSql(strsql) > 0) Response.Redirect("Manage_Member.aspx"); else FinalMessage("修改失败", "Edit_Psssword.aspx", 1); }
/// <summary> /// 按钮操作 /// </summary> protected void rpt_Mod_ItemCommand(object source, RepeaterCommandEventArgs e) { Test_BUL.sys_Common common = new Test_BUL.sys_Common(); HiddenField hfGetId = (HiddenField)e.Item.FindControl("hfGetId"); int id = Tools.StringHelp.GetInt(hfGetId.Value); if (e.CommandName == "freeze") { try { if (common.ExecuteSql(" update tb_sys_admin set AccountState=20 where id=" + id) > 0) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblfreeze"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定禁用吗?')) return false;"); } } } catch (Exception ex) { Response.Write("<script>alert('冻结失败:" + ex.Message + "');</script>"); } } if (e.CommandName == "open") { try { if (common.ExecuteSql(" update tb_sys_admin set AccountState=10 where id=" + id) > 0) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblopen"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定启用吗?')) return false;"); } } } catch (Exception ex) { Response.Write("<script>alert('启用失败:" + ex.Message + "');</script>"); } } if (e.CommandName == "del") { try { if (common.Delete("tb_sys_admin", id)) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblDelete"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定删除吗?')) return false;"); } } } catch (Exception ex) { FinalMessage("删除失败" + ex.Message, "Manage_SysUser.aspx", 1); } } }
/// <summary> /// 按钮操作 /// </summary> protected void rpt_Mod_ItemCommand(object source, RepeaterCommandEventArgs e) { Test_BUL.sys_Common common = new Test_BUL.sys_Common(); HiddenField hfGetId = (HiddenField)e.Item.FindControl("hfGetId"); int id = Tools.StringHelp.GetInt(hfGetId.Value); if (e.CommandName == "freeze") { try { if (common.ExecuteSql(" update tb_sys_admin set AccountState=20 where id=" + id) > 0) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblfreeze"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定禁用吗?')) return false;"); } } } catch (Exception ex) { Response.Write("<script>alert('冻结失败:" + ex.Message + "');</script>"); } } if (e.CommandName == "open") { try { if (common.ExecuteSql(" update tb_sys_admin set AccountState=10 where id=" + id) > 0) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblopen"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定启用吗?')) return false;"); } } } catch (Exception ex) { Response.Write("<script>alert('启用失败:" + ex.Message + "');</script>"); } } if (e.CommandName == "del") { try { if (common.Delete("tb_sys_admin", id)) { DataBind_role(); foreach (RepeaterItem rpItem in rpt_Mod.Items) { LinkButton lbbDel = (LinkButton)rpItem.FindControl("lblDelete"); lbbDel.Attributes.Add("onclick", "if(!confirm('确定删除吗?')) return false;"); } } } catch (Exception ex) { FinalMessage("删除失败" + ex.Message, "Manage_SysUser.aspx", 1); } } }