Sage.Dispatch
1.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sage.Dispatch --version 1.4.0
NuGet\Install-Package Sage.Dispatch -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sage.Dispatch" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sage.Dispatch --version 1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sage.Dispatch, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sage.Dispatch as a Cake Addin #addin nuget:?package=Sage.Dispatch&version=1.4.0 // Install Sage.Dispatch as a Cake Tool #tool nuget:?package=Sage.Dispatch&version=1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Example usage:
using Sage.Dispatch;
using System;
using System.Diagnostics;
namespace TestExample
{
class Program
{
static void Main(string[] args)
{
var useBatch = true;
try
{
using (dynamic script = new ComDynamic("ProvideX.Script"))
{
script.Init(@"c:\sage\sage 100 standard\mas90\home");
script.Execute("SET_PARAM 'NE'=0");
using (dynamic session = script.NewObject("SY_Session"))
{
if ((int)session.nSetUser("all", "") != 1) throw new ApplicationException("Failed to set user.");
if ((int)session.nSetCompany("ABC") != 1) throw new ApplicationException("Failed to set company.");
if ((int)session.nSetDate("S/O", DateTime.Today.ToString("MMddyyyy")) != 1) throw new ApplicationException("Failed to set date for S/O.");
if ((int)session.nSetModule("S/O") != 1) throw new ApplicationException("Failed to set module to S/O.");
int taskId = (int)session.nLookupTask("SO_Invoice_ui");
if (taskId == 0) throw new ApplicationException("Failed to lookup task 'SO_Invoice_ui'.");
session.nSetProgram(taskId, "SO_Invoice_ui");
using (dynamic cmd = script.NewObject("SO_Invoice_bus", session))
{
var batch = string.Empty;
if (useBatch)
{
if ((int)cmd.nSelectNewBatch(ref batch, "N", "BOL " + DateTime.Today.ToString("MM/dd/yyyy")) != 1) throw new ApplicationException("Failed to get new batch number.");
if ((int)cmd.nSelectBatch(batch) != 1) throw new ApplicationException("Failed to set batch number.");
}
var invoiceNo = string.Empty;
if ((int)cmd.nGetNextInvoiceNo(ref invoiceNo) != 1) throw new ApplicationException("Failed to get the next invoice number.");
if ((int)cmd.nSetKeyValue("InvoiceNo$", invoiceNo) != 1) throw new ApplicationException("Failed to set key value.");
cmd.nSetKey();
Trace.WriteLine((string)cmd.sLastErrorMsg);
}
}
}
}
catch (Exception exception)
{
Trace.WriteLine(exception.Message);
}
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Microsoft.CSharp (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.