public Company GetSapRepository(CompanyResquest request)
 {
     if (company.Connected == false)
     {
         SapRepository sapb1repo = new SapRepository(company);
         Company = sapb1repo.SAPCompanyConnection(request);
     }
     return(Company);
 }
Beispiel #2
0
        public Company SAPCompanyConnection(CompanyResquest request)
        {
            //if (_oCompany.Connected == false)
            //{
            _oCompany = new SAPbobsCOM.Company
            {
                Server        = request.SapServer,
                LicenseServer = request.SapLinsansServer,
                DbServerType  = request.DbServerType,
                CompanyDB     = request.CompanyDB,
                UserName      = request.UserName,
                Password      = request.UserPassword
            };
            var result = _oCompany.Connect();

            string a = _oCompany.GetLastErrorDescription();

            if (result != 0)
            {
                _oCompany.GetLastError(out result, out var lastException);
            }
            // }
            return(_oCompany);
        }