using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class usercontrol_gmpwdl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void change_ServerClick(object sender, EventArgs e)
    {
        if (this.CustomValidator1.IsValid == false)
        {
            msgBox.putMsg("旧密码输入错误");
            return;
        }
        MODEL.Employee employee = BLL.BLLemployee.getMobile(Session["user"].ToString());
        employee.Pwd = this.newPasswordTxt.Text;
        BLL.BLLemployee.Update(employee);
        this.successTxt.Text = "密码修改成功...";
        this.oldPasswordTxt.Text = "";
        this.newPasswordTxt.Text = "";
        this.newPasswordTxt2.Text = "";
    }
    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (BLL.check.checkUser(Session["user"].ToString(), args.Value) == "0")
        {
            args.IsValid = false;
        }
        else
        {
            args.IsValid = true;
        }
    }
}
