2,754
edits
mNo edit summary |
No edit summary |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1:
==Version Applicable==
AutoCount Accounting '''1.8.30'''.136 and higher
==Introduction==
In order to connect to one of the account book in AutoCount Accounting, there are few steps to start with.
To understand each of the
STEP 1. Create DBSetting
STEP 2. Call (Create) SubProjectStartup
STEP 3. Login to AutoCount Accounting
Line 11 ⟶ 14:
==DBSetting==
'''DBSetting''' is one of the most frequently
Even when writing scripting for report script or application script, you may find the
DBSetting is required by all transactions and documents when accessing to database server.<br />
<br />▼
Moreover, it provides methods such as GetDataTable(...), ExecuteScalar(...), ExecuteNonQuery(...) and more for programmer to easily access to currently connected account book.<br />
During its creation, two pieces of information is important, they are the '''server name''' and '''database name'''.
Line 31 ⟶ 35:
::[[File:ProgramLoginForm.png|450px|link=]]
<br />
===Create DBSetting while specifying SQL Server sa password===
<syntaxhighlight lang="csharp">
BCE.Data.DBSetting dbSetting = new BCE.Data.DBSetting(DBServerType.SQL2000, serverName, "sa", "mYsApAsSwOrD", dbName);
</syntaxhighlight>
* sa login password can be omitted when the password is using AutoCount default sa login password.
* Specify the sa password only when
<br />
{{Warn|Success of created '''DBSetting''' does not justify whether the provided information connecting to SQL Server is correct.<br />'''DBSetting''' merely
<br />
==SubProjectStartupWithLogin==▼
▲==SubProjectStartupWithLogin==
*When using '''SubProjectStartupWithLogin''' it does the following tasks:
*#Return DBSetting upon success login. Whereas, return null when user '''clicks cancel'''.
*#Initiate AutoCount Accounting system
*#Login to AutoCount Accounting
<syntaxhighlight lang="csharp">
BCE.Data.DBSetting dbSetting = BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartupWithLogin("", "");
//dbSetting is null when user did not login by pressing 'Cancel'
if (dbSetting != null)
{
Line 60 ⟶ 70:
{{Note|When calling '''SubProjectStartupWithLogin''', it prompts login form for user to input.<br />Upon successful login, it returns DBSetting, initialized AutoCount Accounting system and Login to AutoCount Accounting.<br />If user cancel login, the return value of DBSetting is null.}}
<br />
==SubProjectStartup==
When call SubProjectStartup, DBSetting object must be created before '''SubProjectStartup''' can be used.<br />
It does not return any result.
It throws exception, when error is encountered.
'''SubProjectStartup''' is to initialize AutoCount Accounting system, while it also perform below two important tasks:-
#Whether to load plug-in<br />Some plug-in may contain script that calculate the subtotal which may require to be loaded.
Line 69 ⟶ 83:
===Four overloading methods of '''SubProjectStartup'''===
<syntaxhighlight lang="csharp">
//Does not load Plug-In
//Load license control by license code
void BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(DBSetting dbSetting);
//Programmer define whether plug-in will be loaded
//Load license control by license code
void BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(DBSetting dbSetting, BCE.AutoCount.MainEntry.StartupPlugInOption loadPlugInOption);
//Programmer define whether plug-in will be loaded
Line 81 ⟶ 98:
void BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(DBSetting dbSetting, BCE.AutoCount.MainEntry.StartupPlugInOption loadPlugInOption,
BCE.AutoCount.MainEntry.StartupLicenseControlType slcType);
//Programmer define whether plug-in will be loaded
Line 87 ⟶ 105:
void BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(DBSetting dbSetting, BCE.AutoCount.MainEntry.StartupPlugInOption loadPlugInOption,
BCE.AutoCount.MainEntry.StartupLicenseControlType slcType, string dgServerName, int dgServerPort);
</syntaxhighlight>
*There are 4 overloading methods when calling '''SubProjectStartup''' (Reference of version 1.8.30.186)
**Prior to version 1.8.30.186, '''SubProjectStatup''' does not include the parameter of '''StartupPlugInOption''';
**'''StartupPlugInOption''' allows programmer to set whether to load plug-in, when AutoCount Accounting is initialized.
*Dongle server name is the IP address of the computer where '''USB Key Server''' (windows service) is installed.
*The dongle's default server port is 9560.
Line 94 ⟶ 115:
**Default value is used when port is not defined in SubProjectStartup.
<br />
{{Warn|For inter-billing
Line 115 ⟶ 136:
#* Copy to Output = Copy if newer
:So that these files will be copied to project output folder.
:Refer to [[Invalid LCPDecryptFileException was unhandled]]
<br />
Line 135 ⟶ 157:
<br/>
==See Also==
*[[Programmer:
*[[Programmer:Simple program to test connection to AutoCount Accounting|A simple program to test connection to AutoCount Accounting 1.8/1.9]]
*[[Programmer:Create BCE.Data.DBSetting with Database Info|Create BCE.Data.DBSetting with Database Info in AutoCount Accounting 1.8/1.9]]
*[[Invalid LCPDecryptFileException was unhandled]]
<br />
[[Category:Programmer]]
|