protected void BtnSave_Click(object sender, EventArgs e)
    {
        RM rm = new RM(ResourceFile.Msg);
        if (String.IsNullOrEmpty(TxtOldPassword.Text))
        {
            errorMsg.InnerText = rm["password_incorrect"];
            return;
        }
        if (String.IsNullOrEmpty(TxtPassword.Text))
        {
            errorMsg.InnerText = rm["password_input"];
            return;
        }

        if (TxtPassword.Text.Length < EntpClass.Common.SqlMembershipProvider.pMinRequiredPasswordLength)
        {
            errorMsg.InnerText = string.Format(rm["Password_Length"], EntpClass.Common.SqlMembershipProvider.pMinRequiredPasswordLength);
            return;
        }
        if (!String.Equals(TxtConfirmPassword.Text, TxtPassword.Text))
        {
            errorMsg.InnerText = rm["Password_match"];
            return;
        }

        EntpClass.Common.SqlMembershipProvider memberShip = new EntpClass.Common.SqlMembershipProvider();
        int rowsAffected = memberShip.ChangePassword(CurrentUser.LoginName, TxtOldPassword.Text, TxtPassword.Text);

        //rowsAffected
        //      0:密码长度或者是格式不正确
        //      1:用户只读
        //      2:密码错误
        //      -1:修改成功
        if (rowsAffected == -1)
            Response.Redirect("Logout.aspx");            
        else if (rowsAffected == 0)
            errorMsg.InnerText = rm["Passwod_Format"];
        else if (rowsAffected == 1)
            errorMsg.InnerText = rm["User_ReadOnly"];
        else if (rowsAffected == 2)
            errorMsg.InnerText = rm["Passwod_Error"];
        else
            errorMsg.InnerText = rm["Change_Passwod_Failed"];
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        RM rm = new RM(ResourceFile.Msg);

        if (String.IsNullOrEmpty(ComboUser.GetValue()))
        {
            errorMsg.InnerText = rm["Employee_incorrect"];
            return;
        }

        if (String.IsNullOrEmpty(TxtAccountName.Text))
        {
            errorMsg.InnerText = rm["Account_incorrect"];
            return;
        }
        if (String.IsNullOrEmpty(TxtPassword.Text))
        {
            errorMsg.InnerText = rm["password_input"];
            return;
        }

        if (TxtPassword.Text.Length < EntpClass.Common.SqlMembershipProvider.pMinRequiredPasswordLength)
        {
            errorMsg.InnerText = string.Format(rm["Password_Length"], EntpClass.Common.SqlMembershipProvider.pMinRequiredPasswordLength);
            return;
        }

        if (TxtConfirmPassword.Text != TxtPassword.Text)
        {
            errorMsg.InnerText = rm["Password_match"];
            return;
        }

        EntpClass.Common.SqlMembershipProvider memberShip = new EntpClass.Common.SqlMembershipProvider();
        int rowsAffected = memberShip.UpdateUser(ComboUser.GetValue(), TxtAccountName.Text, TxtPassword.Text, TxtEmailAddress.Text);

        //rowsAffected
        //      0:密码长度或缺少特殊字符
        //      1:用户只读
        //      2:用户名重复
        //      -1:修改成功
        if (rowsAffected == -1)
        {
            if (Fn.ToInt(ComboUser.Value) == CurrentUser.UserID)                
                Response.Redirect("Logout.aspx");            
            else
                errorMsg.InnerText = rm["SaveSuccess"];
        }
        else if (rowsAffected == 0)
        {
            errorMsg.InnerText = rm["Passwod_Format"];
        }
        else if (rowsAffected == 1)
        {
            errorMsg.InnerText = rm["User_ReadOnly"];
        }
        else if (rowsAffected == 2)
        {
            errorMsg.InnerText = rm["User_Repeat"];
        }
        else
        {
            errorMsg.InnerText = rm["Update_User_Failed"];
        }
    }