Initiate UserSession and DBSetting: Difference between revisions

No edit summary
 
Line 20:
{{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.
Suitable for GL, AR and AP.
<syntaxhighlight lang="csharp">
internal UserSession InitiateUserSessionUnattended(string serverName, string dbName, string userLogin, string userPasswd)
{
//for GL, AR and AP
AutoCount.MainEntry.Startup startup = new AutoCount.MainEntry.Startup();
AutoCount.Data.DBSetting dbSetting = new AutoCount.Dadta.DBSetting(
Line 28 ⟶ 30:
AutoCount.Authentication.UserSession userSession = new
AutoCount.Authentication.UserSession(dbSetting);
 
if (userSession.Login(userLogin, userPasswd))
{
Line 38 ⟶ 40:
}
</syntaxhighlight>
 
 
===Unattended connection that load UI components===