#ifndef CWORKERDRIVERUSER_H
#define CWORKERDRIVERUSER_H


#include "cworkerdriver.h"

typedef struct _tagUserInfo:QObjectUserData
{
	QString _uid;
	QString _lid;
}STUserInfo;
Q_DECLARE_METATYPE(STUserInfo);

class CWorkerDriverUser : public CWorkerDriver
{
public:
    CWorkerDriverUser(const QString& name,int32_t id);

public:
    QSqlTableModel* m_ModelWorker;

    // CDriverCard interface
public:
    virtual int32_t init_driver() override;
    virtual int32_t exit_driver() override;

    bool ExistUser(const QString& userName);

	bool AddUser(const QString &userName, int levelId, const QString& team, const QString& password, QString& error);
	bool DeleteUser(const QString& userName, QString& error);
	bool ModifyUser(int userId, const QString &userName, int levelId, const QString& team, QString& error);
	bool ModifyUser(int userId, const QString &userName, int levelId, const QString& team, const QString& password, QString& error);

	bool Commit();
};

#endif // CWORKERDRIVERUSER_H
