Beispiel #1
0
        public async Task <bool> BuyInstrument(string ticker, float price, int volumen)
        {
            if (ticker != null && price > 0 && volumen > 0)
            {
                var userName = User.Identity.Name;
                var user     = await userManager.FindByNameAsync(userName);

                var transDto = new OrderForm()
                {
                    Ticker          = ticker,
                    Price           = price,
                    Volumen         = volumen,
                    TransactionTime = DateTime.Now,
                    UserId          = user.Id,
                    OrderType       = OrderType.Buy
                };
                var pricesTask = serviceClient.AcceptTransactionAsync(transDto);
                return(await pricesTask);
            }
            return(false);
        }