本文整理汇总了C#中CurrencyType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CurrencyType.ToString方法的具体用法?C# CurrencyType.ToString怎么用?C# CurrencyType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurrencyType
的用法示例。
在下文中一共展示了CurrencyType.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInsideTransferBySequenceNo
public InsideTransferModel GetInsideTransferBySequenceNo(string seqNo, TransactionState txstate, CurrencyType currency)
{
Check.Argument.IsNotEmpty(seqNo, "seqNo");
return this.Context.Sql(getInsideTransferBySequenceNo_Sql.FormatWith(currency.ToString()))
.Parameter("@seqNo", seqNo)
.Parameter("@state", txstate)
.QuerySingle<InsideTransferModel>();
}
示例2: Deposits
public ActionResult Deposits(CurrencyType currency)
{
ViewBag.Currency = this.Lang(currency.GetDescription());
ViewBag.CurrencyCode = currency.ToString();
string viewName = string.Empty;
#region 获取充值地址
if (currency == CurrencyType.CNY) viewName = "CNYDeposits";
else viewName = "VirtualCoinDeposits";
#endregion
return View(viewName);
}
示例3: Index
public ActionResult Index(CurrencyType currency)
{
ViewBag.Currency = this.Lang(currency.GetDescription());
ViewBag.CurrencyCode = currency.ToString();
var currentUserID = this.CurrentUser.UserID;
var account = IoC.Resolve<IAccountQuery>().GetAccountByUserID(currentUserID, currency);
var paymentAddress = string.Empty;
var viewName = string.Empty;
ViewBag.Balance = (account == null || account.ID == 0) ? 0 : account.Balance;
if (currency == CurrencyType.CNY) viewName = "CNY";
return View(viewName);
}
示例4: GetSendTransactionListenerConsumer
private static QueueingBasicConsumer GetSendTransactionListenerConsumer(CurrencyType currency)
{
var mqname = currency.ToString() + "SendTransactionListener";
var channel = _mqpool.GetMQChannel(mqname);
var exchangeAndQueueName = Utilities.GenerateVirtualCoinSendPaymentExchangeAndQueueName(currency);
channel.ExchangeDeclare(exchangeAndQueueName.Item1, ExchangeType.Direct, true, false, null);
channel.QueueDeclare(exchangeAndQueueName.Item2, true, false, false, null);
channel.QueueBind(exchangeAndQueueName.Item2, exchangeAndQueueName.Item1, string.Empty);
channel.BasicQos(0, 1, false);
var consumer = new QueueingBasicConsumer(channel);
//auto ack ,最大程度上避免重复发出币
channel.BasicConsume(exchangeAndQueueName.Item2, true, consumer);
return consumer;
}
示例5: GenerateNewAddress
public ActionResult GenerateNewAddress(CurrencyType currency)
{
var result = FCJsonResult.CreateFailResult(this.Lang("Unknow Exception,Please refresh the page and try again"));
var cacheKey = CacheKey.USER_GENERATE_PAYMENT_ADDRESS + currency.ToString() + this.CurrentUser.UserID;
object tmp;
if (Config.Debug || !Cache.TryGet(cacheKey, out tmp))
{
try
{
var cmd = new GeneratePaymentAddress(this.CurrentUser.UserID, currency);
this.CommandBus.Send(cmd);
Cache.Add(cacheKey, cmd.ID);
result = FCJsonResult.CreateSuccessResult(this.Lang("Generating deposit address ..."));
}
catch (Exception ex)
{
Log.Error("Action GenerateNewAddress Error", ex);
}
}
return Json(result);
}
示例6: CountReceivePayMentTransactionBySearch
/***********************************************************/
public int CountReceivePayMentTransactionBySearch(CurrencyType currency, DepositState state)
{
var paramters = new object[] { (int)state };
return this.Context.Sql(countReceivePayMentTransactionBySearch_Sql.FormatWith(currency.ToString()))
.Parameters(paramters)
.QuerySingle<int>();
}
示例7: CountVirtualCoinDepositByUserID
public int CountVirtualCoinDepositByUserID(int userID, CurrencyType currency)
{
Check.Argument.IsNotNegativeOrZero(userID, "userID");
return this.Context.Sql(countVirtualCoinDepositByUserID_Sql.FormatWith(currency.ToString()))
.Parameter("@userID", userID)
.QuerySingle<int>();
}
示例8: GetMyVirtualCoinWithdraw
public IEnumerable<DotPay.ViewModel.WithdrawListModel> GetMyVirtualCoinWithdraw(int userID, CurrencyType currency, int start, int limit)
{
Check.Argument.IsNotNegativeOrZero(userID, "userID");
var paramters = new object[] { userID };
var result = this.Context.Sql(getLastTenVirtualCoinWithdrawByUserID_Sql.FormatWith(currency.ToString()))
.Parameter("@userID", userID)
.Parameter("@start", start)
.Parameter("@limit", limit)
.QueryMany<WithdrawListModel>();
return result;
}
示例9: ExistConfirmTx
private static bool ExistConfirmTx(GetTransactionResponse tx, CurrencyType currency)
{
bool isExist = false;
var cacheKey = currency.ToString() + tx.Transaction + "_" + (tx.AmountNQT / 100000000) + "confirm";
var tmp = new object();
if (Cache.TryGet(cacheKey, out tmp))
{
isExist = true;
}
return isExist;
}
示例10: ProcessTx
private static void ProcessTx(int userID, GetTransactionResponse tx, UInt64 nxtAccountID, CurrencyType currency)
{
var cacheKey = currency.ToString() + tx.SenderRS + tx.Transaction + "create";
if (tx.Type != TransactionType.Ordinary || tx.Recipient != nxtAccountID)
{
//如果交易类型不是普通交易或者收款账户非当前账户(非收款),忽略,并加入忽略名单,防止多次请求交易明细,浪费资源
Cache.Add(cacheKey, tx.Confirmations);
return;
}
object obj = null;
if (Cache.TryGet(cacheKey, out obj)) return;
Log.Info("发现新的交易....");
var actualAmount = tx.AmountNQT / 100000000;
#region 发送交易到处理消息队列
var mqname = "NXTReceiveTransactionListener";
_channel = _mqpool.GetMQChannel(mqname);
var exchangeName = Utilities.GenerateVirtualCoinReceivePaymentExchangeAndQueueName(currency).Item1;
var build = new BytesMessageBuilder(_channel);
var cmd = new CreateReceivePaymentTransaction(tx.Transaction, tx.RecipientRS, actualAmount, currency);
build.WriteBytes(Encoding.UTF8.GetBytes(IoC.Resolve<IJsonSerializer>().Serialize(cmd)));
((IBasicProperties)build.GetContentHeader()).DeliveryMode = 2;
try
{
Log.Info("交易将被发送到Exchange->{0}", exchangeName);
_channel.BasicPublish(exchangeName, string.Empty, ((IBasicProperties)build.GetContentHeader()), build.GetContentBody());
Log.Info("交易成功发送到Exchange->{0}", exchangeName);
Cache.Add(cacheKey, tx.Confirmations);
}
catch (RabbitMQ.Client.Exceptions.AlreadyClosedException ex)
{
Log.Error("发送{0}新交易创建指令时发现消息队列服务器已关闭".FormatWith(Config.CoinCode), ex);
try
{
_channel = _mqpool.GetMQChannel(mqname);
_channel.BasicPublish(exchangeName, string.Empty, ((IBasicProperties)build.GetContentHeader()), build.GetContentBody());
Log.Info("交易成功发送到Exchange->{0}", exchangeName);
}
catch (Exception eex)
{
Log.Fatal("重新链接消息队列发送NXT新交易仍然出错了".FormatWith(Config.CoinCode), eex);
}
}
catch (Exception ex)
{
Log.Error("发送{0}新交易创建指令时出现错误".FormatWith(Config.CoinCode), ex);
}
#endregion
#region 提取币到总账户中
try
{
var nxtclient = new NXTClient4Net(Config.NXTServer, Config.SecretPhrase + userID);
var result = nxtclient.SendMoneyAsnc(Config.NxtSumAccount, actualAmount - 1).Result;
Log.Info("用户充值的币发送到总帐户成功");
}
catch (Exception ex)
{
Log.Fatal("用户ID={0}充值的{1}NXT发送到总帐户失败了,请及时处理".FormatWith(userID, actualAmount), ex);
}
#endregion
}
示例11: CountMyCoinWithdraw_Sql
public int CountMyCoinWithdraw_Sql(int userID, CurrencyType currency)
{
return this.Context.Sql(countMyCoinWithdraw_Sql.FormatWith(currency.ToString()))
.Parameter("@userID", userID)
.QuerySingle<int>();
}
示例12: UpdateUserWithdrawDayLimitRemain
private void UpdateUserWithdrawDayLimitRemain(decimal withdrawAmount, CurrencyType currency)
{
var limiteAmount = 0M;
var cacheKey = CacheKey.USER_WITHDRAW_DAY_LIMITE + currency.ToString() + this.CurrentUser.UserID;
Cache.TryGet(cacheKey, out limiteAmount);
limiteAmount += withdrawAmount;
var now = DateTime.Now;
Cache.Add(cacheKey, limiteAmount, new DateTime(now.Year, now.Month, now.Day, 23, 59, 56));
}
示例13: GetVirtualCurrencyDepositBySearch
public IEnumerable<DotPay.ViewModel.VirtualCurrencyDepositInListModel> GetVirtualCurrencyDepositBySearch(int? userID, DateTime? starttime, DateTime? endtime, CurrencyType currency, DepositState state, int page, int pageCount)
{
var paramters = new object[] { userID.HasValue ? userID.Value : 0, starttime.HasValue ? starttime.Value.ToUnixTimestamp() : 0, endtime.HasValue ? endtime.Value.ToUnixTimestamp() : 0, (int)state, (page - 1) * pageCount, pageCount };
var users = this.Context.Sql(depositVirtualCurrency_Sql.FormatWith(currency.ToString()))
.Parameters(paramters)
.QueryMany<VirtualCurrencyDepositInListModel>();
return users;
}
示例14: GetUserWithdrawDayLimitRemain
private decimal GetUserWithdrawDayLimitRemain(CurrencyType currency)
{
var limiteAmount = 0M;
var cacheKey = CacheKey.USER_WITHDRAW_DAY_LIMITE + currency.ToString() + this.CurrentUser.UserID;
var currencySetting = IoC.Resolve<ICurrencyQuery>().GetCurrency(currency);
Cache.TryGet(cacheKey, out limiteAmount);
return currencySetting.WithdrawDayLimit - limiteAmount;
}
示例15: StartNXTBalanceWatcher
private static void StartNXTBalanceWatcher(CurrencyType currency)
{
var currencyQuery = IoC.Resolve<ICurrencyQuery>();
var thread = new Thread(new ThreadStart(() =>
{
while (true)
{
var balance = 0M;
if (TryGetBalance(out balance))
{
UpdateBalanceRecord(currency, balance);
var currencySetting = currencyQuery.GetAllCurrencies().SingleOrDefault(c => c.Code == currency.ToString());
//如果小于该币提现日限额*3的数量,则发送预警消息
var warnLine = currencySetting.WithdrawOnceLimit * 3;
if (balance < warnLine)
{
SendBalanceWarnMessage("{0}已不足{1:#####},请及时补充".FormatWith(currency, warnLine));
}
}
else
{
Log.Warn("获取{0}钱包余额失败,flg={1}", currency, Config.StatisticsFlg);
}
var sleepTime = Config.Debug ? 1000 : 300 * 1000;
Thread.Sleep(sleepTime);
}
}));
Log.Info("{0}钱包余额监控器正在启动...", currency);
thread.Start();
Log.Warn("{0}钱包余额监控器启动成功!", currency);
}