Ejemplo n.º 1
0
        public virtual ApiLogOnResponseDTO Login(string username, string password, string tradingUrl)
        {
            try
            {
                if (_loggedIn)
                {
                    throw new InvalidOperationException("Already logged in.");
                }

                var response = _apiConnection.Login(username, password, tradingUrl);
                if (response.Session != null)
                {
                    _loggedIn = true;
                }
                return(response);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                throw;
            }
        }