/// <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); }
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); }
/// <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)); }
public bool HasExAccount(FiiiType fiiiType, Guid accountId) { var openAccount = new OpenAccountDAC().GetOpenAccount(fiiiType, accountId); return(openAccount != null); }