本文整理汇总了C#中TransactionStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TransactionStatus.ToString方法的具体用法?C# TransactionStatus.ToString怎么用?C# TransactionStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransactionStatus
的用法示例。
在下文中一共展示了TransactionStatus.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllOutgoingSingleCredit
public IList<OutgoingSingleCredit> GetAllOutgoingSingleCredit(TransactionStatus transactionStatus)
{
using (var db = new RTGSGen2DBContext(connectionString))
{
IList<OutgoingSingleCredit> outgoingSingleCreditList = db.GetAllOutgoingSingleCredit().ToList();
return outgoingSingleCreditList
.Where(o => o.Status == transactionStatus.ToString()).ToList();
}
}
示例2: Refund
public void Refund(TransactionStatus RefundTransactionStatus, Int64 TransactionID, string ORNo, decimal ItemSold, decimal QuantitySold, decimal GrossSales, decimal SubTotal, decimal NetSales, decimal ItemsDiscount, decimal SNRItemsDiscount, decimal PWDItemsDiscount, decimal OtherItemsDiscount, decimal Discount, decimal SNRDiscount, decimal PWDDiscount, decimal OtherDiscount, decimal TransDiscount, DiscountTypes TransDiscountType, decimal VAT, decimal VATableAmount, decimal ZeroRatedSales, decimal NonVATableAmount, decimal VATExempt, decimal EVAT, decimal EVATableAmount, decimal NonEVATableAmount, decimal LocalTax, decimal AmountPaid, decimal CashPayment, decimal ChequePayment, decimal CreditCardPayment, decimal CreditPayment, decimal DebitPayment, decimal RewardPointsPayment, decimal RewardConvertedPayment, decimal BalanceAmount, decimal ChangeAmount, PaymentTypes PaymentType, string DiscountCode, string DiscountRemarks, decimal Charge, decimal ChargeAmount, string ChargeCode, string ChargeRemarks, Int64 CashierID, string CashierName)
{
try
{
MySqlCommand cmd = new MySqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
string SQL = "UPDATE tblTransactions SET " +
"ORNo = @ORNo, " +
"TransactionStatus = @TransactionStatus, " +
"ItemSold = @ItemSold, " +
"QuantitySold = @QuantitySold, " +
"GrossSales = @GrossSales, " +
"SubTotal = @SubTotal, " +
"NetSales = @NetSales, " +
"ItemsDiscount = @ItemsDiscount, " +
"SNRItemsDiscount = @SNRItemsDiscount, " +
"PWDItemsDiscount = @PWDItemsDiscount, " +
"OtherItemsDiscount = @OtherItemsDiscount, " +
"Discount = @Discount, " +
"SNRDiscount = @SNRDiscount, " +
"PWDDiscount = @PWDDiscount, " +
"OtherDiscount = @OtherDiscount, " +
"TransDiscount = @TransDiscount, " +
"TransDiscountType = @TransDiscType, " +
"VAT = @VAT, " +
"VATableAmount = @VATableAmount, " +
"ZeroRatedSales = @ZeroRatedSales, " +
"NonVATableAmount = @NonVATableAmount, " +
"VATExempt = @VATExempt, " +
"EVAT = @EVAT, " +
"EVATableAmount = @EVATableAmount, " +
"NonEVATableAmount = @NonEVATableAmount, " +
"LocalTax = @LocalTax, " +
"AmountPaid = @AmountPaid, " +
"CashPayment = @CashPayment, " +
"ChequePayment = @ChequePayment, " +
"CreditCardPayment = @CreditCardPayment, " +
"CreditPayment = @CreditPayment, " +
"DebitPayment = @DebitPayment, " +
"RewardPointsPayment = @RewardPointsPayment, " +
"RewardConvertedPayment = @RewardConvertedPayment, " +
"BalanceAmount = @BalanceAmount, " +
"ChangeAmount = @ChangeAmount, " +
"DateClosed = NOW(), " +
"PaymentType = @PaymentType, " +
"DiscountCode = @DiscCode, " +
"DiscountRemarks = @DiscRemarks, " +
"Charge = @Charge, " +
"ChargeAmount = @ChargeAmount, " +
"ChargeCode = @ChargeCode, " +
"ChargeRemarks = @ChargeRemarks, " +
"CashierID = @CashierID, " +
"CashierName = @CashierName, " +
"LastModified = NOW() " +
"WHERE TransactionID = @TransactionID;";
cmd.Parameters.AddWithValue("ORNo", ORNo);
cmd.Parameters.AddWithValue("TransactionStatus", RefundTransactionStatus.ToString("d"));
cmd.Parameters.AddWithValue("ItemSold", ItemSold);
cmd.Parameters.AddWithValue("QuantitySold", QuantitySold);
cmd.Parameters.AddWithValue("GrossSales", GrossSales);
cmd.Parameters.AddWithValue("SubTotal", SubTotal);
cmd.Parameters.AddWithValue("NetSales", NetSales);
cmd.Parameters.AddWithValue("ItemsDiscount", ItemsDiscount);
cmd.Parameters.AddWithValue("SNRItemsDiscount", SNRItemsDiscount);
cmd.Parameters.AddWithValue("PWDItemsDiscount", PWDItemsDiscount);
cmd.Parameters.AddWithValue("OtherItemsDiscount", OtherItemsDiscount);
cmd.Parameters.AddWithValue("Discount", Discount);
cmd.Parameters.AddWithValue("SNRDiscount", SNRDiscount);
cmd.Parameters.AddWithValue("PWDDiscount", PWDDiscount);
cmd.Parameters.AddWithValue("OtherDiscount", OtherDiscount);
cmd.Parameters.AddWithValue("TransDiscount", TransDiscount);
cmd.Parameters.AddWithValue("TransDiscType", TransDiscountType.ToString("d"));
cmd.Parameters.AddWithValue("VAT", VAT);
cmd.Parameters.AddWithValue("VATableAmount", VATableAmount);
cmd.Parameters.AddWithValue("ZeroRatedSales", ZeroRatedSales);
cmd.Parameters.AddWithValue("NonVATableAmount", NonVATableAmount);
cmd.Parameters.AddWithValue("VATExempt", VATExempt);
cmd.Parameters.AddWithValue("EVAT", EVAT);
cmd.Parameters.AddWithValue("EVATableAmount", EVATableAmount);
cmd.Parameters.AddWithValue("NonEVATableAmount", NonEVATableAmount);
cmd.Parameters.AddWithValue("LocalTax", LocalTax);
cmd.Parameters.AddWithValue("AmountPaid", AmountPaid);
cmd.Parameters.AddWithValue("CashPayment", CashPayment);
cmd.Parameters.AddWithValue("ChequePayment", ChequePayment);
cmd.Parameters.AddWithValue("CreditCardPayment", CreditCardPayment);
cmd.Parameters.AddWithValue("CreditPayment", CreditPayment);
cmd.Parameters.AddWithValue("DebitPayment", DebitPayment);
cmd.Parameters.AddWithValue("RewardPointsPayment", RewardPointsPayment);
cmd.Parameters.AddWithValue("RewardConvertedPayment", RewardConvertedPayment);
cmd.Parameters.AddWithValue("BalanceAmount", BalanceAmount);
cmd.Parameters.AddWithValue("ChangeAmount", ChangeAmount);
cmd.Parameters.AddWithValue("PaymentType", PaymentType.ToString("d"));
cmd.Parameters.AddWithValue("DiscCode", string.IsNullOrEmpty(DiscountCode) ? "" : DiscountCode);
cmd.Parameters.AddWithValue("DiscRemarks", DiscountRemarks);
cmd.Parameters.AddWithValue("Charge", Charge);
cmd.Parameters.AddWithValue("ChargeAmount", ChargeAmount);
cmd.Parameters.AddWithValue("ChargeCode", ChargeCode);
cmd.Parameters.AddWithValue("ChargeRemarks", string.IsNullOrEmpty(ChargeRemarks) ? "" : ChargeRemarks);
//.........这里部分代码省略.........
示例3: ListAsDataTable
public System.Data.DataTable ListAsDataTable(Int32 BranchID, string TerminalNo = "", Int64 TransactionID = 0, string TransactionNo = "", DateTime? TransactionDateFrom = null, DateTime? TransactionDateTo = null,
TransactionStatus TransactionStatus = TransactionStatus.NotYetApplied, PaymentTypes PaymentType = PaymentTypes.NotYetAssigned, bool isConsignment = false, bool isPacked = false,
string CustomerName = "", string CustomerGroupName = "", Int64 CashierID = 0, string CashierName = "", string AgentName = "",
bool WithTF = false, bool ShowSuspendedOnly = false, string SortField = "", SortOption SortOption = SortOption.Ascending, Int32 limit = 0)
{
try
{
MySqlCommand cmd = new MySqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
string SQL = "CALL procTransactionsSelect(@BranchID, @TerminalNo, @TransactionID, @TransactionNo, @TransactionDateFrom, " +
"@TransactionDateTo, @TransactionStatus, @PaymentType, @isConsignment, @isPacked, @CustomerName, " +
"@CustomerGroupName, @CashierID, @CashierName, @AgentName, @WithTF, @ShowSuspended, " +
"@SortField, @SortOption, @Limit);";
cmd.Parameters.AddWithValue("BranchID", BranchID);
cmd.Parameters.AddWithValue("TerminalNo", TerminalNo);
cmd.Parameters.AddWithValue("TransactionID", TransactionID);
cmd.Parameters.AddWithValue("TransactionNo", TransactionNo);
cmd.Parameters.AddWithValue("TransactionDateFrom", TransactionDateFrom.GetValueOrDefault() == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : TransactionDateFrom);
cmd.Parameters.AddWithValue("TransactionDateTo", TransactionDateTo.GetValueOrDefault() == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : TransactionDateTo);
cmd.Parameters.AddWithValue("TransactionStatus", TransactionStatus.ToString("d"));
cmd.Parameters.AddWithValue("PaymentType", PaymentType.ToString("d"));
cmd.Parameters.AddWithValue("isConsignment", isConsignment);
cmd.Parameters.AddWithValue("isPacked", isPacked);
cmd.Parameters.AddWithValue("CustomerName", CustomerName);
cmd.Parameters.AddWithValue("CustomerGroupName", CustomerGroupName);
cmd.Parameters.AddWithValue("CashierID", CashierID);
cmd.Parameters.AddWithValue("CashierName", CashierName);
cmd.Parameters.AddWithValue("AgentName", AgentName);
cmd.Parameters.AddWithValue("WithTF", WithTF);
cmd.Parameters.AddWithValue("ShowSuspended", ShowSuspendedOnly);
cmd.Parameters.AddWithValue("SortField", SortField);
cmd.Parameters.AddWithValue("SortOption", SortOption==SortOption.Ascending ? "ASC" : "DESC");
cmd.Parameters.AddWithValue("Limit", limit);
cmd.CommandText = SQL;
string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
base.MySqlDataAdapterFill(cmd, dt);
return dt;
}
catch (Exception ex)
{
throw base.ThrowException(ex);
}
}
示例4: TestCase_PSPENonMsdtc
//.........这里部分代码省略.........
for (int i = 0; i < p1AfterPromote; i++)
{
vols[p0BeforePSPE + p1BeforePSPE + p0AfterPSPE + p1AfterPSPE + p0AfterPromote + i] = CreateVolatileEnlistment(
enlistmentDoneEvts[p0BeforePSPE + p1BeforePSPE + p0AfterPSPE + p1AfterPSPE + p0AfterPromote + i],
null, EnlistmentOptions.None, /*votePrepared=*/ true);
}
}
}
if (commit)
{
ts.Complete();
}
}
}
catch (Exception ex)
{
TransactionAbortedException abortedEx = ex as TransactionAbortedException;
if ((abortedEx != null) && (spcResponse != TransactionStatus.Aborted))
{
TestFailed(testCaseDescription, "The transaction aborted unexpectedly");
return;
}
TransactionInDoubtException indoubtEx = ex as TransactionInDoubtException;
if ((indoubtEx != null) && (spcResponse != TransactionStatus.InDoubt))
{
TestFailed(testCaseDescription, "The transaction was indoubt unexpectedly");
return;
}
if (spcResponse == TransactionStatus.Committed)
{
Trace(string.Format("Caught unexpected exception {0}:{1}", ex.GetType().ToString(), ex.ToString()));
return;
}
}
NonMSDTCPromoterEnlistment nonDtcEnlistment = enlistment as NonMSDTCPromoterEnlistment;
if (nonDtcEnlistment == null)
{
TestFailed(testCaseDescription, "The enlistment was not a NonMSDTCPromoterEnlistment");
return;
}
if (numVolatiles > 0)
{
for (int i = 0; i < numVolatiles; i++)
{
if (!enlistmentDoneEvts[i].WaitOne(TimeSpan.FromSeconds(5)))
{
TestFailed(testCaseDescription, "Timeout waiting for enlistment outcomes");
return;
}
}
//if (WaitHandle.WaitAll(enlistmentDoneEvts, TimeSpan.FromSeconds(5)))
//{
int passCount = 0;
for (int i = 0; i < numVolatiles; i++)
{
if (commit)
{
if (((spcResponse == TransactionStatus.Committed) && vols[i].CommittedOutcome) ||
((spcResponse == TransactionStatus.Aborted) && vols[i].AbortedOutcome) ||
示例5: TestCase_VolatileEnlistments
private static void TestCase_VolatileEnlistments(
int count,
TransactionStatus expectedOutcome,
EnlistmentOptions options = EnlistmentOptions.None,
bool commitTx = true,
bool votePrepared = true,
Type expectedExceptionType = null)
{
string testCaseDescription = string.Format("TestCase_VolatileEnlistments; count = {0}; expectedOutcome = {1}; options = {2}; votePrepared = {3}, expectedExceptionType = {4}",
count,
expectedOutcome.ToString(),
options.ToString(),
votePrepared,
expectedExceptionType);
Trace("**** " + testCaseDescription + " ****");
AutoResetEvent[] enlistmentDoneEvts = new AutoResetEvent[count];
MyEnlistment[] vols = new MyEnlistment[count];
for (int i = 0; i < count; i++)
{
enlistmentDoneEvts[i] = new AutoResetEvent(false);
}
try
{
using (TransactionScope ts = new TransactionScope())
{
for (int i = 0; i < count; i++)
{
vols[i] = CreateVolatileEnlistment(enlistmentDoneEvts[i], null, options, votePrepared);
}
if (commitTx)
{
ts.Complete();
}
}
}
catch (Exception ex)
{
if (ex.GetType() != expectedExceptionType)
{
TestFailed(testCaseDescription, string.Format("Unexpected exception {0}: {1}", ex.GetType().ToString(), ex.ToString()));
return;
}
}
for (int i = 0; i < count; i++)
{
if (!enlistmentDoneEvts[i].WaitOne(TimeSpan.FromSeconds(5)))
{
TestFailed(testCaseDescription, "Timeout waiting for enlistment outcomes");
return;
}
}
int passCount = 0;
for (int i = 0; i < count; i++)
{
if (((expectedOutcome == TransactionStatus.Committed) && vols[i].CommittedOutcome) ||
((expectedOutcome == TransactionStatus.Aborted) && vols[i].AbortedOutcome) ||
((expectedOutcome == TransactionStatus.InDoubt) && vols[i].InDoubtOutcome)
)
{
passCount++;
}
}
if (passCount == count)
{
TestPassed();
}
else
{
TestFailed(testCaseDescription, string.Format("{0} enlistments received an outcome of {1}", passCount, expectedOutcome.ToString()));
}
}