Integration with AutoCount Accounting ver 1.8
Posted on November 3, 2014 | By autocount_dev
The following article as well as other posts linked to this post is applicable only to AutoCount Accounting version 1.8.8 and above. The information covered in these articles will be of interest to any third-party application developer that directly call the assembly files of AutoCount Accounting version 1.8.8 for their application (non-plugin type) especially due to the fact that there is major differences between version 1.8.8 and earlier versions.
In version 1.8.8, several classes has been restructured and renamed. One such class is the BCE.AutoCount.MainEntry.MainEntry. Now known as BCE.AutoCount.MainEntry.Startup, this class implements the Startup and Shutdown procedure of AutoCount Accounting. As such any program developed to access AutoCount Accounting must call the startup methods in this class first before attempting to access to AutoCount Accounting.
Before explaining the startup method themselves, an explanation on an important object must be done first. The object meant here is the DBSetting object. A DBSetting object is important as it is the object used by the AutoCount Accounting program to handle the connection between the database layer and application layer of its implementation. As such, most if not all classes in the AutoCount Accounting assemblies require that this object be pass into them during initialization. Below are the constructors for the DBSetting object:
An example on how to create a DBSetting object is shown below:
Certain startup methods requires a DBSetting object as a parameter while there is one startup method that will return a DBSetting object when called. This particular method will be discussed later in this post.
This is one of the startup method available for use to begin the startup procedure for any AutoCount related project. You should call this method once only and be aware that this method will not prompt any user log-in UI. As such, if you wish to allow user to enter their login information, you will have to develop a Windows form that will allow the user to enter their login information.
For your information, the StartupLicenseControlType parameter contains 3 choices which are:
- Default: The default license control information stored in the database
- License Code
After calling the method above, you will need to call the Login method in the UserAuthentication class to facilitate the AutoCount user login. The following code snippet will show how to do so:
This method of startup is formerly called CustomProjectStartup in its previous incarnation. Similar to its cousin, the SubProjectStartup method, you should call this method once only in your application. The difference between this method and its cousin is instead of having to create a DBSetting object before calling the method, this method will generate the DBSetting object for you instead.
Another difference is that this method will prompt the user to enter their login details via the standard AutoCount Accounting login window, which allows the user to choose which account book he wishes to login into.
The dmfPath parameter denotes the Database Management File path. If you are using a custom Database Management File, please enter the path into the parameter. Leaving an empty string will denote that the default file path is to be used. The loginTitle parameter denotes the string you wish to show on top of the login window screen.
Consuming AutoCount Accounting Assemblies
The following section is written in different posts to help ensure an easier time to read as they may contain a lot of code sample as well as explanation. This section will serve as a place to hold the links to each posts for ease of navigation.
- Access AR Tutorial
- Access GL Tutorial
- Access Purchase Tutorial
- Access Sales Tutorial
- Access Stock Tutorial
The Shutdown method is a method that will cleanly end a users session within a program that was using the AutoCount Accounting assembly. Hence please call the Shutdown method once in your code when you wish to end such sessions. Call this method especially when you have used the two Startup methods discussed previously. Below is an example on how to call the method: