Пример #1
0
        public AppReturnObject MakeTransaction(UserFunds userFunds)
        {
            var             _serviceResult = new UserFundsService().MakeTransaction(userFunds.UserID, userFunds.Amount);
            AppReturnObject _retval        = new AppReturnObject()
            {
                Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList()
            };

            if (_serviceResult.Succeeded)
            {
                _retval.UserAccount = new UserAccount()
                {
                    Id = userFunds.UserID, CurrentBalance = _serviceResult.AppUser.CurrentBalance
                }
            }
            ;

            return(_retval);
        }
Пример #2
0
        public AppReturnObject GetBalance(UserGetBalance userGetBalance)
        {
            var             _serviceResult = new UserFundsService().GeteBalance(userGetBalance.UserID, userGetBalance.ExchangeRate);
            AppReturnObject _retval        = new AppReturnObject()
            {
                Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList()
            };

            if (_serviceResult.Succeeded)
            {
                _retval.UserAccount = new UserAccount()
                {
                    Id = userGetBalance.UserID, CurrentBalanceForeignCurrency = _serviceResult.AppUser.CurrentBalanceForeignCurrency, CurrentBalance = _serviceResult.AppUser.CurrentBalance
                }
            }
            ;

            return(_retval);
        }
    }