예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fiiiType">0FiiiPay 1FiiiPos</param>
 /// <param name="accountId"></param>
 /// <returns></returns>
 public OpenAccount GetOpenAccount(FiiiType fiiiType, Guid accountId)
 {
     using (var con = ReadConnection())
     {
         return(con.QuerySingleOrDefault <OpenAccount> ("SELECT * FROM [dbo].[OpenAccount] WHERE FiiiType=@FiiiType AND AccountId=@AccountId", new { FiiiType = fiiiType, AccountId = accountId }));
     }
 }
        private decimal FiiiExBalance(FiiiType fiiiType, Guid accountId, Cryptocurrency crypto)
        {
            var openAccountDac = new OpenAccountDAC();
            var data           = openAccountDac.GetOpenAccount(fiiiType, accountId);

            if (data == null)
            {
                return(0M);
            }

            LogHelper.Info($"GetFiiiExUserCoin: openId={data.OpenId}, coinCode={crypto.Code}");
            int result = new TransferCoinSoapClient().GetUserCoin(data.OpenId.ToString(), crypto.Code, out decimal amount);

            LogHelper.Info($"GetFiiiExUserCoin: result={result}, amount={amount}");
            return(amount);
        }
예제 #3
0
        public OpenAccount Create(int platform, FiiiType fiiiType, Guid accountId)
        {
            OpenAccount account = new OpenAccount
            {
                CreateTime = DateTime.UtcNow,
                PlatformId = platform,
                FiiiType   = fiiiType,
                OpenId     = Guid.NewGuid(),
                SecretKey  = RandomAlphaNumericGenerator.Generate(32),
                AccountId  = accountId
            };

            long id = new OpenAccountDAC().Create(account);

            account.Id = id;

            return(account);
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fiiiType">0FiiiPay 1FiiiPos</param>
 /// <param name="accountId"></param>
 /// <returns></returns>
 public OpenAccount GetOpenAccount(FiiiType fiiiType, Guid accountId)
 {
     return(new OpenAccountDAC().GetOpenAccount(fiiiType, accountId));
 }
예제 #5
0
        public bool HasExAccount(FiiiType fiiiType, Guid accountId)
        {
            var openAccount = new OpenAccountDAC().GetOpenAccount(fiiiType, accountId);

            return(openAccount != null);
        }