Exemple #1
0
    public static string GetColoredTransactionStatus(CryptocurrencyTransactionStatus status)
    {
        if (status == CryptocurrencyTransactionStatus.AwaitingPayment)
        {
            return("<span style=\"color:red\">" + U6010.AWAITINGPAYMENTCONFIRM + "</span>");
        }

        if (status == CryptocurrencyTransactionStatus.AwaitingPaymentConfirmation)
        {
            return("<span style=\"color:orange\">" + U6010.AWAITINGPAYMENTRECEIVEDCONFIRM + "</span>");
        }

        if (status == CryptocurrencyTransactionStatus.Finished)
        {
            return("<span style=\"color:green\">" + L1.FINISHED + "</span>");
        }

        if (status == CryptocurrencyTransactionStatus.NotPaid)
        {
            return("<span style=\"color:red\"><b>" + U6010.BUYERDIDNTPAID + "</b></span>");
        }

        if (status == CryptocurrencyTransactionStatus.PaymentNotConfirmed)
        {
            return("<span style=\"color:red\"><b>" + U6010.SELLERDIDNTRECEIVEPAYMENT + "</b></span>");
        }

        return(""); //for compilator
    }
Exemple #2
0
    private static void CheckIfEscrowPassed(CryptocurrencyTransactionStatus statusBefore)
    {
        var statusAfter = statusBefore == CryptocurrencyTransactionStatus.AwaitingPayment ? CryptocurrencyTransactionStatus.NotPaid : CryptocurrencyTransactionStatus.PaymentNotConfirmed;

        String UpdateQuery = String.Format(@"UPDATE CryptoCurrencyTradeTransactions SET PaymentStatus = {0} WHERE PaymentStatus = {1} AND 
                                                DATEADD(MINUTE, (SELECT EscrowTime FROM CryptocurrencyTradeOffers WHERE Id = CryptoCurrencyTradeTransactions.OfferId), ExecutionTime) 
                                                    < '{2}'", (int)statusAfter, (int)statusBefore, AppSettings.ServerTime.ToDBString());

        TableHelper.ExecuteRawCommandNonQuery(UpdateQuery);
    }
Exemple #3
0
    private static String GenerateQueryStringForNumberOfPositiveActions(CryptocurrencyOfferType type, int userId)
    {
        String TypeOfUser = type == CryptocurrencyOfferType.Buy ? "BuyerId" : "SellerId";
        CryptocurrencyTransactionStatus TypeOfTransactionDispute = type == CryptocurrencyOfferType.Buy ?
                                                                   CryptocurrencyTransactionStatus.SolvedCryptocurrencyToOfferOwner :
                                                                   CryptocurrencyTransactionStatus.SolvedCryptocurrencyToOfferClient;

        String Query = String.Format(@"SELECT COUNT(*) FROM CryptoCurrencyTradeTransactions WHERE 
                                                                            OfferId IN (SELECT OfferId FROM CryptocurrencyFinishedTradeOffers WHERE {0}={1}) AND
                                                                            PaymentStatus IN ({2},{3})",
                                     TypeOfUser,
                                     userId,
                                     (int)CryptocurrencyTransactionStatus.Finished,
                                     (int)TypeOfTransactionDispute);

        return(Query);
    }