Пример #1
0
        public Session Login(string loginServerUrl, string user, string password, string organisation)
        {
            Console.WriteLine("Log in");
            var sessionService = new SessionService(clientFactory);

            _session = sessionService.Logon(loginServerUrl, user, password, organisation);
            if (_session == null)
            {
                Console.WriteLine("Failed to log in to organisation {0} with user {1} on {2}.", organisation, user,
                                  loginServerUrl);
                return(null);
            }

            Console.WriteLine("Logged in to organisation {0} with user {1} on {2}.", organisation, user,
                              loginServerUrl);
            Console.WriteLine();
            _customerInterface = new CustomerOperations(_session);
            _supplierInterface = new SupplierOperations(_session);
//            _generalLedgerInterface = new GeneralLedgerOperations(_session);
            _articleInterface       = new ArticleOperations(_session);
            _salesInvoiceInterface  = new SalesInvoiceOperations(_session);
            _costCenterInterface    = new CostCenterOperatons(_session);
            _costCenterConverter    = new CostCenterConverter();
            _generalLedgerConverter = new GeneralLedgerConverter();
            _dimensionTypeInterface = new DimensionTypeOperations(_session);
            _balanceSheetInterface  = new BalanceSheetOperations(_session);
            _countryOperations      = new CountryOperations(_session);
            _customerConverter      = new CustomerConverter();
            _supplierConverter      = new SupplierConverter();
            _articleConverter       = new ArticleConverter();
            _salesInvoiceConverter  = new SalesInvoiceConverter(_session);
            return(_session);
        }
Пример #2
0
 public void Initialize()
 {
     _middlewareData        = new MiddlewareData();
     _session               = Utilities.CreateValidSession();
     _salesInvoiceConverter = new SalesInvoiceConverter(_session);
     _salesInvoiceInterface = new SalesInvoiceOperations(_session);
 }
Пример #3
0
 public DataFunctions(Twinfield form, Session session)
 {
     _customerInterface      = new CustomerOperations(session);
     _supplierInterface      = new SupplierOperations(session);
     _balanceSheetInterface  = new BalanceSheetOperations(session);
     _profitLossInterface    = new ProfitLossOperations(session);
     _articleInterface       = new ArticleOperations(session);
     _salesInvoiceInterface  = new SalesInvoiceOperations(session);
     _costCenterInterface    = new CostCenterOperatons(session);
     _customerConverter      = new CustomerConverter();
     _supplierConverter      = new SupplierConverter();
     _generalLedgerConverter = new GeneralLedgerConverter();
     _articleConverter       = new ArticleConverter();
     _salesInvoiceConverter  = new SalesInvoiceConverter(session);
     _costCenterConverter    = new CostCenterConverter();
     _form    = form;
     _session = session;
 }