void DataParser::processLine(QString name, QString time, QString inOut, QString date)
{
    Student *stu = NULL;

    for(int i = 0;i<allStudents.size();i++)
    {
        if(name==this->allStudents.at(i)->getName())
        {
            stu = this->allStudents.at(i);
        }
    }
    if(stu==NULL)
    {
        stu = new Student();
        this->allStudents.append(stu);
    }
    stu->setName(name);

    if(inOut=="Sign In")
    {
        QDateTime signIn(QDate::fromString(date),QTime::fromString(time));
        stu->setLastSignIn(signIn);
    }
    else
    {
        QDateTime signOut(QDate::fromString(date),QTime::fromString(time));
        stu->setLastSignOut(signOut);
        processSignOut(stu);

    }
}
예제 #2
0
void signIn(Data* data){
	clearScreen();
	string email, password,input;


	cout << "\nEmail: ";
	getline(cin, email);

	cout << "\nPassword: "******"Wrong email and password combination.\n";
		cout << "Try Again? (Y/N)"<<endl;
		cin>>input;
		if (input=="y"||input=="Y")
		{
			cin.ignore();
			cin.clear();
			signIn(data);
		}
		else mainMenu(data);
	}
}
예제 #3
0
void AsteriskManager::reconnect()
{
    if (!m_autoSignIn)
    {
        m_timer.stop();
        m_autoConnectingOnError = false;
        return;
    }

    m_autoConnectingOnError = true;
    signIn(m_server, m_port);
}
void TwitterDataTypeSyncAdaptor::updateDataForAccount(int accountId)
{
    Accounts::Account *account = Accounts::Account::fromId(m_accountManager, accountId, this);
    if (!account) {
        SOCIALD_LOG_ERROR("existing account with id" << accountId << "couldn't be retrieved");
        setStatus(SocialNetworkSyncAdaptor::Error);
        decrementSemaphore(accountId);
        return;
    }

    // will be decremented by either signOnError or signOnResponse.
    incrementSemaphore(accountId);
    signIn(account);
}
예제 #5
0
void menu (int sid)
{
    int numberOperation=0;
    int idUser = 0;
    int koniec = 0;
    for(;;)
    {
        if (idUser>0)
        {
            printf("\n===== WYBIERZ AKCJE =====\n");
            printf("\n 1 - Wyjdź\n");
            printf("\n 2 - Synchronizuj pliki\n");
            scanf("%d",&numberOperation);

            switch(numberOperation)
            {
            case 1:
            {
                koniec = 1;
                //numberOperation=1;
                //send(sid, &numberOperation, 1, 0);
                //receiveFiles(sid);
                numberOperation=1;
                send(sid, &numberOperation, 1, 0);
                break;
            }
            case 2:
            {
                numberOperation=2;
                send(sid, &numberOperation, 1, 0);
                nameFilesFolder(sid);
                break;
            }
            default:
                printf("\nunknown operation\n");
            }
        }
        else
        {
            idUser = signIn(sid);

        }
        if (koniec>0)
            break;
    }
}