Beispiel #1
0
void WLogin :: accept()
{
    int message;
    long long num;
    string str;
    num = Nios :: StrNum(usrLineEdit->text().trimmed().toStdString());
    str = pwdLineEdit -> text().trimmed().toStdString();
    queueNum.push(num);
    queueStr.push(str);
    message = procFunc(1);
    if(message == 0)
    {
        www -> btLogin -> setText("登出");
        QMessageBox::warning(this,"登录成功",("欢迎您, " + inOperation.userNickname).c_str(),QMessageBox::Yes);
        if ((inOperation.authority <= 1) && (EUsers.KeepingTimedOut(inOperation.userID)))
        {
            QMessageBox::warning(this,"警告","由于逾期未归还书籍,您已经被封禁,请联系馆长或代馆长",QMessageBox::Yes);
            if (inOperation.authority > 0)
                EUsers.SetUserAuthority(inOperation.userID, -inOperation.authority);
        }
        www -> userName -> setText(("当前用户 " + Nios :: level(inOperation.authority) + " : " + inOperation.userNickname).c_str());
        QWidget::close();
    }
    else
    {
        QMessageBox::warning(this,"","用户名或密码错误",QMessageBox::Yes);
        usrLineEdit->setFocus();
    }
}
Beispiel #2
0
void WUpgrade :: accept()
{
    int message;
    queueNum.push(Nios :: StrNum(usrLineEdit -> text().trimmed().toStdString()));
    queueNum.push(Nios :: StrNum(autLineEdit -> text().trimmed().toStdString()));

    message = procFunc(11);
    if (message == 0)
    {
        QMessageBox::warning(this,"","修改完成",QMessageBox::Yes);
        QWidget::close();
    }
    else
    {
        QMessageBox::warning(this,"","用户不存在或其他错误",QMessageBox::Yes);
        usrLineEdit->setFocus();
    }
}
void WGeneral1Num :: accept()
{
    int message;
    queueNum.push(Nios :: StrNum(numLineEdit -> text().trimmed().toStdString()));
    message = procFunc(workingModeGer);
    if (message == 0)
    {
        if (workingModeGer == -4)
            QMessageBox::warning(this,"",Nios :: ShowOneBookRequired().c_str(),QMessageBox::Yes);
        else
            if (workingModeGer == -10)
                QMessageBox::warning(this,"",Nios :: ShowUserRequired().c_str(),QMessageBox::Yes);
        else
            QMessageBox::warning(this,"成功","成功完成",QMessageBox::Yes);
        QWidget::close();
    }
    else
    {
        QMessageBox::warning(this,"失败","此对象不存在或者您没有权限访问",QMessageBox::Yes);
        numLineEdit->setFocus();
    }
}
Beispiel #4
0
void WPasswd :: accept()
{
    int message;
    long long num;
    string str, strr;
    num = Nios :: StrNum(usrLineEdit->text().trimmed().toStdString());
    str = pwdLineEdit -> text().trimmed().toStdString();
    strr = pwrLineEdit -> text().trimmed().toStdString();
    queueNum.push(num);
    queueStr.push(str);
    queueStr.push(strr);
    message = procFunc(6);
    if (message == 0)
    {
        QMessageBox::warning(this,"","修改成功",QMessageBox::Yes);
        inOperation = EUsers.GetUser(inOperation.userID);
        QWidget::close();
    }
    else
    {
        QMessageBox::warning(this,"","两次密码不一致或没有找到这个用户。",QMessageBox::Yes);
        usrLineEdit->setFocus();
    }
}
Beispiel #5
0
void* Event::process(){
    print();
    return procFunc(argc, argv);
};