
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import  QMessageBox, QLineEdit
from PyQt5 import QtWidgets
from MainTest.ModifyPwd import Ui_Form

import Login.CheckUserName as modify

class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):
    def __init__(self,username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username

        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)

    def slot_init(self):
        self.bt_back.clicked.connect(self.close)
        self.bt_confrim.clicked.connect(self.modify_pwd)
        self.bt_confrim.setShortcut(Qt.Key_Return)


    def modify_pwd(self):
        if(self.et_pwdn.text() == '' or self.et_pwdnc.text()=='' or self.et_pwdc.text()==''):
            QMessageBox.information(self, '提示', '请输入密码！', QMessageBox.Ok, QMessageBox.Ok)
        elif not(self.et_pwdnc.text() == self.et_pwdn.text()):
            QMessageBox.information(self, '提示', '两次新密码不一致！', QMessageBox.Ok, QMessageBox.Ok)
        else:
            flag = modify.Changpwd(newpwd=self.et_pwdnc.text(),
                                   oldpwd=self.et_pwdc.text(),
                                   username=self.username)
            if (flag):
                QMessageBox.information(self, '提示', '修改成功！', QMessageBox.Ok, QMessageBox.Ok)
                self.close()
            else:
                QMessageBox.information(self, '提示', '修改失败！', QMessageBox.Ok, QMessageBox.Ok)
a5a6c06b995f1ef3648a3b1b0077d0f956f70083
<mask token>


class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):

    def __init__(self, username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username
        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)
    <mask token>
    <mask token>

<mask token>


class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):

    def __init__(self, username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username
        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)

    def slot_init(self):
        self.bt_back.clicked.connect(self.close)
        self.bt_confrim.clicked.connect(self.modify_pwd)
        self.bt_confrim.setShortcut(Qt.Key_Return)
    <mask token>

<mask token>


class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):

    def __init__(self, username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username
        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)

    def slot_init(self):
        self.bt_back.clicked.connect(self.close)
        self.bt_confrim.clicked.connect(self.modify_pwd)
        self.bt_confrim.setShortcut(Qt.Key_Return)

    def modify_pwd(self):
        if self.et_pwdn.text() == '' or self.et_pwdnc.text(
            ) == '' or self.et_pwdc.text() == '':
            QMessageBox.information(self, '提示', '请输入密码！', QMessageBox.Ok,
                QMessageBox.Ok)
        elif not self.et_pwdnc.text() == self.et_pwdn.text():
            QMessageBox.information(self, '提示', '两次新密码不一致！', QMessageBox.Ok,
                QMessageBox.Ok)
        else:
            flag = modify.Changpwd(newpwd=self.et_pwdnc.text(), oldpwd=self
                .et_pwdc.text(), username=self.username)
            if flag:
                QMessageBox.information(self, '提示', '修改成功！', QMessageBox.Ok,
                    QMessageBox.Ok)
                self.close()
            else:
                QMessageBox.information(self, '提示', '修改失败！', QMessageBox.Ok,
                    QMessageBox.Ok)

from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMessageBox, QLineEdit
from PyQt5 import QtWidgets
from MainTest.ModifyPwd import Ui_Form
import Login.CheckUserName as modify


class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):

    def __init__(self, username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username
        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)

    def slot_init(self):
        self.bt_back.clicked.connect(self.close)
        self.bt_confrim.clicked.connect(self.modify_pwd)
        self.bt_confrim.setShortcut(Qt.Key_Return)

    def modify_pwd(self):
        if self.et_pwdn.text() == '' or self.et_pwdnc.text(
            ) == '' or self.et_pwdc.text() == '':
            QMessageBox.information(self, '提示', '请输入密码！', QMessageBox.Ok,
                QMessageBox.Ok)
        elif not self.et_pwdnc.text() == self.et_pwdn.text():
            QMessageBox.information(self, '提示', '两次新密码不一致！', QMessageBox.Ok,
                QMessageBox.Ok)
        else:
            flag = modify.Changpwd(newpwd=self.et_pwdnc.text(), oldpwd=self
                .et_pwdc.text(), username=self.username)
            if flag:
                QMessageBox.information(self, '提示', '修改成功！', QMessageBox.Ok,
                    QMessageBox.Ok)
                self.close()
            else:
                QMessageBox.information(self, '提示', '修改失败！', QMessageBox.Ok,
                    QMessageBox.Ok)


from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import  QMessageBox, QLineEdit
from PyQt5 import QtWidgets
from MainTest.ModifyPwd import Ui_Form

import Login.CheckUserName as modify

class LogicModifyPwd(QtWidgets.QMainWindow, Ui_Form):
    def __init__(self,username):
        super(LogicModifyPwd, self).__init__()
        self.setupUi(self)
        self.username = username

        self.init()
        self.slot_init()

    def init(self):
        self.et_name.setEnabled(False)
        self.et_name.setText(self.username)
        self.et_pwdc.setEchoMode(QLineEdit.Password)
        self.et_pwdn.setEchoMode(QLineEdit.Password)
        self.et_pwdnc.setEchoMode(QLineEdit.Password)

    def slot_init(self):
        self.bt_back.clicked.connect(self.close)
        self.bt_confrim.clicked.connect(self.modify_pwd)
        self.bt_confrim.setShortcut(Qt.Key_Return)


    def modify_pwd(self):
        if(self.et_pwdn.text() == '' or self.et_pwdnc.text()=='' or self.et_pwdc.text()==''):
            QMessageBox.information(self, '提示', '请输入密码！', QMessageBox.Ok, QMessageBox.Ok)
        elif not(self.et_pwdnc.text() == self.et_pwdn.text()):
            QMessageBox.information(self, '提示', '两次新密码不一致！', QMessageBox.Ok, QMessageBox.Ok)
        else:
            flag = modify.Changpwd(newpwd=self.et_pwdnc.text(),
                                   oldpwd=self.et_pwdc.text(),
                                   username=self.username)
            if (flag):
                QMessageBox.information(self, '提示', '修改成功！', QMessageBox.Ok, QMessageBox.Ok)
                self.close()
            else:
                QMessageBox.information(self, '提示', '修改失败！', QMessageBox.Ok, QMessageBox.Ok)