Using the Jiwa Assemblies from a .NET application

Samples and Examples of using the Jiwa 7 framework - including plugins, stand-alone applications and scripts.

Using the Jiwa Assemblies from a .NET application

Postby Mike.Sheen » Fri Feb 21, 2014 6:50 pm

There is no doubt going to be the occasion where you may need to use our assemblies outside of a plugin - in a completely separate application.

Fortunately, we've made it really easy to login to jiwa and interact with our business logic.

You just need to add references to your Visual Studio solution/project to the Jiwa Assemblies (Jiwa*.dll). If, say for example, you wanted to interact with the sales order business logic then you need to add a references to JiwaSales.dll. How do you know which assembly to reference ? try exploring the relevant reference API documentation for your version.

You should set Copy Local to true for the references to the Jiwa assemblies, otherwise any plugins enabled will produce errors on login.

Ok, so once you have the necessary references, let show a simple example of logging into Jiwa, reading a sales order and processing it :

Code: Select all
Imports JiwaFinancials.Jiwa
  Public Class TestClass

     Private Sub ProcessSalesOrder(ByVal InvoiceNo As String)
         JiwaApplication.Manager.Instance.Logon("JiwaMike", "JiwaDemo", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", "password")

         Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaSales.SalesOrder.SalesOrder)(Nothing)
         salesOrder.Find(JiwaApplication.IJiwaNavigable.ReadModes.Actual, "SO_Main.InvoiceNo", InvoiceNo , "")

         salesOrder.Process()
         Console.WriteLine(String.Format("Invoice No. {0} is now processed.", salesOrder.InvoiceNo))

         JiwaApplication.Manager.Instance.LogOff()
     End Sub
  End Class
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Return to Samples and Examples

Who is online

Users browsing this forum: No registered users and 2 guests