Example #1
0
 protected void btnModPwd_Click(object sender, EventArgs e)
 {
     try
     {
         QPS.NEW.BLL.Enterprise Buser = new QPS.NEW.BLL.Enterprise();
       QPS.NEW.Model.Enterprise   Muser =Buser.GetModel(userid);
         // === modified by jeffery
         //if (txfOriginalPwd.Value != Buser.GetModel(userid).Password)
       if (QPS.NEW.BLL.MD5Helper.Encode(txfOriginalPwd.Value) != Muser.Password)
         // ===
         {
             Response.Write("<script>alert('原始密码错误,请重新输入')</script>");
             return;
         }
         if (txfModPwd.Value != txfRepwd.Value)
         {
             Response.Write("<script>alert('确认密码与修改密码不一致,请重新输入')</script>");
             return;
         }
         if (txfModPwd.Value == string.Empty)
         {
             Response.Write("<script>alert('确认密码不能为空,请重新输入')</script>");
             return;
         }
         Muser.Password = txfModPwd.Value;
         Buser.Update(Muser);
         Response.Write("<script>alert('密码修改成功! ')</script>");
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('修改失败!')</script>");
     }
 }
Example #2
0
 protected void btnModPwd_Click(object sender, EventArgs e)
 {
     try
     {
         QPS.NEW.BLL.Enterprise   Buser = new QPS.NEW.BLL.Enterprise();
         QPS.NEW.Model.Enterprise Muser = Buser.GetModel(userid);
         // === modified by jeffery
         //if (txfOriginalPwd.Value != Buser.GetModel(userid).Password)
         if (QPS.NEW.BLL.MD5Helper.Encode(txfOriginalPwd.Value) != Muser.Password)
         // ===
         {
             Response.Write("<script>alert('原始密码错误,请重新输入')</script>");
             return;
         }
         if (txfModPwd.Value != txfRepwd.Value)
         {
             Response.Write("<script>alert('确认密码与修改密码不一致,请重新输入')</script>");
             return;
         }
         if (txfModPwd.Value == string.Empty)
         {
             Response.Write("<script>alert('确认密码不能为空,请重新输入')</script>");
             return;
         }
         Muser.Password = txfModPwd.Value;
         Buser.Update(Muser);
         Response.Write("<script>alert('密码修改成功! ')</script>");
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('修改失败!')</script>");
     }
 }
Example #3
0
 protected void btnModify_Click(object sender, EventArgs e)
 {
     try
     {
         Menter.Id = userid;
         if (txfUserName.Value == String.Empty)
         {
             Response.Write("<script>alert('用户名不能为空,请重新输入')</script>");
             return;
         }
         if (txfPhone.Value == String.Empty)
         {
             Response.Write("<script>alert('电话不能为空,请重新输入')</script>");
             return;
         }
         if (txfNickName.Value == String.Empty)
         {
             Response.Write("<script>alert('昵称不能为空,请重新输入')</script>");
             return;
         }
         Menter.Username = txfUserName.Value;
         Menter.Phone    = txfPhone.Value;
         Menter.Mail     = txfEmail.Value;
         Menter.Nickname = txfNickName.Value;
         Menter.Address  = txfAddress.Value;
         Benter.Update(Menter);
         Session["username"] = Menter.Username;
         Response.Write("<script>alert('修改成功')</script>");
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('修改失败')</script>");
         return;
     }
 }