public void Connect() { if (Connected) { return; } Company = settings.ToCompany(); int result = Company.Connect(); if (result != 0) { throw new ConnectionFailedException($"{result} {Company.GetLastErrorDescription()}"); } Connected = true; }
/// <summary> /// Connects to SAP Business One. /// </summary> /// <exception cref="ConnectionException"> /// Thrown when a connection cannot be established. /// </exception> public void Connect() { if (Connected) { return; } Company = settings.ToCompany(); var result = Company.Connect(); if (result != 0) { var message = $"{result} {Company.GetLastErrorDescription()}"; throw new ConnectionException(message); } Connected = true; }