Initiate UserSession and DBSetting: Difference between revisions

no edit summary
(Created page with " ==Initiate UserSession and Connect to AutoCount Accounting 2.1== There are 3 methods to establish connection to AutoCount Accounting 2.1. # Unattended connection without loading UI components # Unattended connection that load UI components # User login to establish connection (needs UI components) UI Components require System.Windows.Forms and DevExpress winForm components. ===Unattended Connection without loading UI components=== {{NugetPackages|AutoCount2.Accounti...")
 
No edit summary
(8 intermediate revisions by the same user not shown)
Line 1:
 
==Initiate UserSession and Connect to AutoCount Accounting 2.1==
This document shows how programmer can create a new connection to AutoCount Accounting and initiate the system.
 
There are 3 methods to establish connection to AutoCount Accounting 2.1.
# Unattended connection without loading UI components
# Unattended connection that load UI components (needs UI components)
# User login to establish connection (needs UI components)
 
UI Components require System.Windows.Forms and {{DevExpress}} winForm components.
 
{{Warn|UserSession must only initiate once in the application.
Do not create more than one instance in a running application. As it may consume system resource and has an impact on your application performance.<br/>
After obtained the object of UserSession, pass it as argument to constructor or method.
}}
{{Note|Plug-in development does not require to create new connection to AutoCount Accounting.
Because, user has already login to the account book.<br>Programmer can access the UserSession that is sent as argument "e" at plug-in initiate, and as parameter in constructor.
}}
===Unattended Connection without loading UI components===
{{NugetPackages|AutoCount2.Accounting}}
This MainEntry is commonly used for integration, or when no user login is required to access and initiate AutoCount Accounting, and it does not load UI components.
 
<syntaxhighlight lang="csharp">
internal UserSession InitiateUserSessionUnattended(string serverName, string dbName, string userLogin, string userPasswd)
Line 33 ⟶ 42:
===Unattended connection that load UI components===
{{NugetPackages|AutoCount2.Accounting.UI}}
This MainEntry.UIStartup is similar to the MainEntry.Startup, except that it loads UI components. When MainEntry.UIStartup is used, AutoCount images and {{DevExpress}} are required.
<syntaxhighlight lang="csharp">
internal UserSession InitiateUserSessionUnattendedWithUI(string serverName, string dbName, string userLogin, string userPasswd)
Line 55 ⟶ 65:
 
{{NugetPackages|AutoCount2.MainEntry}}
This MainEntry opens the AutoCount Accounting user login form, and with successful login, it returns the object of the UserSession.<br>
If user clicked [Cancel], the object of UserSession is null.
<syntaxhighlight lang="csharp">
internal AutoCount.Authentication.UserSession InitiateUserSessionWithLogin()
Line 61 ⟶ 73:
}
</syntaxhighlight>
 
{{NavigateDeveloper}}
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]