Programmer:Simple program to test connection to AutoCount Accounting v2: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 117: Line 117:
<br />
<br />
{{Warn|For inter-billing and integration, if '''StartupPlugInOption.LoadStandardPlugIn''' is not stated in SubProjectStartup, the target account book will not load plug-in that has/have installed.}}
{{Warn|For inter-billing and integration, if '''StartupPlugInOption.LoadStandardPlugIn''' is not stated in SubProjectStartup, the target account book will not load plug-in that has/have installed.}}


==Error: InvalidLCPFileException==
'''Invalid LCP File Exception''' is common error when calling SubProjectStartup or SubProjectStartupWithLogin when loading from a ''standalone program'' or ''web application''.

Exception Namespace: BCE.LCP.InvalidLCPDecryptFileException
[[File:ProgramInvalidLCP.png|link=]]

===Solution===
Include LCP files together with your exe or dll which is calling SubProjectStartup.<br /><br />
*To let Visual Studio copy these files to output folder for debugging, follow steps below:
# Find these files in AutoCount Accounting folder.
#* LCPDecrypt.wdl
#* LCPDecrypt2.exe
#* LCPDecrypt2.wdl
#* LCPDecryptApp.exe
#Add these files to your Project as existing items.
#* Set Build Action = none (empty)
#* Copy to Output = Copy if newer
:So that these files will be copied to project output folder.
:Refer to [[Invalid LCPDecryptFileException was unhandled]]


<br />
<br />
==Login to AutoCount Accounting==
==Login to AutoCount Accounting==
In order to create transaction and document, Login to AutoCount Accounting is required.
In order to create transaction and document, Login to AutoCount Accounting is required.
To login to AutoCount Accounting, use object of '''AutoCount.Authentication.UserSession''' to login.


<syntaxhighlight lang="csharp">
<syntaxhighlight lang="csharp">
bool loginSuccess = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbset).Login(userID, password);
bool loginSuccess = userSession.Login(userID, password);


if (loginSuccess)
if (loginSuccess)