Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Version 7.00.177.00 of Jiwa included some changes that will likely cause plugins to no longer compile, or produce unexpected errors at runtime.

What changed

We removed the JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance singleton property

The Manager class had a property named Instance, which could be used like this:

Old Login Example
JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Logon("MyServer", "JiwaDemo", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", password);
JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder>()null;
var db = JiwaApplication.Manager.Instance.Database;
using (SqlCommand SQLCmd = new SqlCommand(sql, db.SQLConnection, db.SQLTransaction))
{
}

The above example will now fail to compile, giving the error "'Instance' is not a member of 'JiwaFinancials.Jiwa.JiwaApplication.Manager'".

 

To correct this, you can no longer refer to the singleton instance property, but instead use an instance of the Manager class instead:

New Login Example
var manager = new JiwaFinancials.Jiwa.JiwaApplication.Manager();
manager.Logon("MyServer", "JiwaDemo", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", password);
manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder>()null;
var db = manager.Database;
using (SqlCommand SQLCmd = new SqlCommand(sql, db.SQLConnection, db.SQLTransaction))
{
}

As many classes require access the the Manager class instance, removing the singleton instance property meant we now needed to add a Manager property to all our Forms, Dialogs and Business Logic - and provide a way of setting that property.

Our interfaces which are implemented by all our Forms, Dialogs and Business Logic have had a Manager property added:

  1. JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic
  2. JiwaFinancials.Jiwa.JiwaApplication.IJiwaCollection
  3. JiwaFinancials.Jiwa.JiwaApplication.IJiwaCollectionItem
  4. JiwaFinancials.Jiwa.JiwaApplication.IJiwaDialog
  5. JiwaFinancials.Jiwa.JiwaApplication.IJiwaEntity
  6. JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm

So all classes implementing the above interfaces now have a Manager property also. The factories should always be used to create a new instance of any class implementing the above.

The factories are accessible via properties of the Manager class - these are BusinessLogicFactory, CollectionFactory, CollectionItemFactory, DialogFactory, EntityFactory, FormFactory.

An example of using the Entity Factory of the Manager:

Entity Factory Example
var branch = Manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Sales.Branch>();
branch.ReadRecord("ABC123");

 

An example of using the CollectionItem Factory of the Manager:

CollectionItem Factory Example
var debtorPrice = Manager.CollectionItemFactory.CreateCollectionItem<JiwaFinancials.Jiwa.JiwaInventory.DebtorSpecificInventorySpecific>();
debtorPrice.Debtor.Search();
Inventory.DebtorPrices.Add(debtorPrice);

 

 

 

  • No labels