Beispiel #1
0
    public bool ChangeDiginoteValue(string sessionId, float power)
    {
        string username = _db.GetUsername(sessionId);

        if (username == null)
        {
            Console.WriteLine("Null username");
            return(false);
        }

        if (waitActiveTransactions != null && !waitActiveTransactions.IsCompleted)
        {
            Console.WriteLine("Wait Active Transactions is not over");
            return(false);
        }

        bool success = _db.ChangeDiginoteValue(power);

        Console.WriteLine("Change diginote is {0}", success);
        if (success)
        {
            _db.SetActiveTransactions(false);
            waitActiveTransactions = WaitForAcceptTransactions();
            return(true);
        }
        return(false);
    }