Arturo
Arturo

Reputation: 1131

How do I create a BaaN interface in C#?

What is the best way to create an interface to the BaaN MRP system?

I'm looking for a way to use C# to create an interface to update the inventory at the ERP.

Upvotes: 1

Views: 2239

Answers (2)

roeland
roeland

Reputation: 6336

You need to add a com reference to /baan/bin/bw.tlb
(Ole Automation Baan Type Library)

Upvotes: 1

Jaime Oro
Jaime Oro

Reputation: 10145

object Baan = null ;
Type t;
t = Type.GetTypeFromProgID("Baan4.Application.someuser");
Baan = Activator.CreateInstance(t);
object[] Parameters = new Object[1];
Parameters[0] = 3600;

//Baan.Timeout = 3600;
Baan.GetType().InvokeMember("Timeout", 
                            BindingFlags.SetProperty, 
                            null, 
                            Baan, 
                            Parameters
);

Parameters = new Object[2];
Parameters[0] = "otccomdll...";
Parameters[1] = "function.name...";
Baan.GetType().InvokeMember("ParseExecFunction", 
                             BindingFlags.InvokeMethod, 
                             null, 
                             Baan, 
                             Parameters
);
//your code here    
//Baan.Quit();
Baan.GetType().InvokeMember("Quit", BindingFlags.InvokeMethod, null, Baan, null);

Upvotes: 0

Related Questions