201a.GettingStarted

From AutoCount Resource Center

Go to menu

Go to top
Resources For AutoCount Software Developers


AutoCount Accounting 1.8 Plug-in Tutorial

Getting Started

Introduction

 AutoCount Accounting provides integration solution for Software Developers to build attachable module(s) to enhance or customise AutoCount Accounting for today’s market requirements.

 AutoCount provides this tutorial for software developers to learn to develop AutoCount Accounting Plug-in through exercises.


Objectives

This tutorial is a getting started for software developer to build Plug-in for AutoCount Accounting.

  • Learn the Tools and Applications to build AutoCount Accounting Plug-in
  • Add menu function for the Plug-in
  • Add Form and Dialog Box
  • Load AutoCount Data from Microsoft SQL Server

Requirements in this tutorial

  • Experience in programming, and C# (C Sharp) programming language.
  • AutoCount Accounting version 1.8.25.
  • AutoCount Plug-in Builder with AutoCount Developer ID.
  • Development Tools & Programs
Comparison of AutoCount Accounting Major versions
AutoCount Accounting 1.8.25
or Higher
AutoCount Accounting 2.0
Development Tool Microsoft Visual Studio 2015
or development tool that supports Microsoft .Net Framework 4.0
Database Server Microsoft SQL Server 2008R2 SP2 & higher Microsoft SQL Server 2012 SP3 & higher
Framework Microsoft .Net Framework 4.0 Microsoft .Net Framework 4.5
Assemblies DevExpress WinForms Components 13.1.10 DevExpress WinForms Components 17.1.4



5 Basic Steps to Build AutoCount Accounting Plug-in Package

5 steps to successfully create a plug-in for AutoCount Accounting.





Exercise 1: Build My First Plug-In

Objectives: Create a new Plug-in project for AutoCount Accounting


This exercise is to build an AutoCount Accounting Plug-in Package, and successfully load the Plug-in at AutoCount Accounting Plug-in Manager.
Start Exercise 1




Plug-In Company Info and Properties

Developer's Company Information

Insert Company Information at the constructor of the class that inherits BCE.AutoCount.PlugIn.BasePlugIn.
public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
    "My First Plugin", "1.0.1")
{
    SetManufacturer("Auto Count Sdn. Bhd.");
    SetManufacturerUrl("http://www.autocountsoft.com");
    SetCopyright("Copyright 2015 © Auto Count Sdn. Bhd.");
    SetSalesPhone("1-800-88-7766");
    SetSupportPhone("+60-3-3324-2148");
}

SetMinimumAccountVersionRequired

  • SetMinimumAccountingVersionRequired is to control version compatibility of AutoCount Accounting and the plug-in.
    The string value is the lowest version of AutoCount Accounting that is required to load this plug-in.
public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
    "My First Plugin", "1.0.1")
{
    SetMinimumAccountingVersionRequired("1.8.25");
}

SetMinimumAccountingVersionRequired(“1.8.25”) version control is added, when AutoCount Accounting version must be equal or higher than 1.8.25.


Plug-In License Mode

SetIsFreeLicense

  • SetIsFreeLicense method is to set the license status of this plugin.
    Default value is true, when not specified.
public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
    "My First Plugin", "1.0.1")
{
    SetIsFreeLicense(false);
}

SetSupportLicenseKey

  • SetSupportLicenseKey method enables [Enter License Key] button at Plug-In Manager.
    Default value is false, when not specified.
public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
    "My First Plugin", "1.0.1")
{
    SetManufacturer("Auto Count Sdn. Bhd.");
    SetManufacturerUrl("http://www.autocountsoft.com");
    SetCopyright("Copyright 2015 © Auto Count Sdn. Bhd.");
    SetSalesPhone("1-800-88-7766");
    SetSupportPhone("+60-3-3324-2148");

    SetMinimumAccountingVersionRequired("1.8.25");
    SetIsFreeLicense(false);
    SetSupportLicenseKey(true);
}

Set Custom License Status

  • Beside the existing License Status, such as PermanentLicense, TemporaryLicense, and Unregistered. Custom license status can be defined.
  1. Call the method SetIsFreeLicense, and set it to false.
  2. Set the LicenseStatus properties to LicenseStatus.Custom.
  3. Then, assign string to CustomLicenseStatus.

    License Status is updated to "Beta version.".
public class Plugin : BCE.AutoCount.PlugIn.BasePlugIn
{
    public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
        "My First Plugin", "1.0.1")
    {
        SetIsFreeLicense(false);
    }

    public override void TestLicenseKey(LicenseStatusArgs e, string licenseKey)
    {
        e.LicenseStatus = LicenseStatus.Custom;
        e.CustomLicenseStatus = "Beta version.";
    }
}


Plug-In Menu and Function

Main Menu Caption

  • Set Main Menu Caption in BeforeLoad override method
    Default menu caption is "Plug-Ins".
public class Plugin : BCE.AutoCount.PlugIn.BasePlugIn
{
    public Plugin() : base(new Guid("37125E27-65B4-4B1D-9E1D-6FA67838E2BE"),
        "My First Plugin", "1.0.1")
    {
    }

    public override bool BeforeLoad(BeforeLoadArgs e)
    {
        e.MainMenuCaption = "MyFirstPlugin";

        return base.BeforeLoad(e);
    }
}

Sub Menu and Functions

Add Sub Menu that uses MenuItemAttribute (Attribute Class)

Attribute Class is a declarative method that is declared before a class,
where the class properties can be defined.
The method of the attribute has overloading methods which it supports Optional Parameter.
Method: BCE.AutoCount.PlugIn.MenuItem

Examples of defining Attribute:

//Simple MenuItemAttribute
[BCE.AutoCount.PlugIn.MenuItem("Greetings", 1)]
//Overload methods with addition parameters [BCE.AutoCount.PlugIn.MenuItem("Greetings", 1, false, "CMD_VIEW_FORM1", "CMD_OPEN_FORM1")]
//Attribute contains Optional Parameter [BCE.AutoCount.PlugIn.MenuItem("Greetings", MenuOrder=1)]
//Attribute contain Optional Parameter [BCE.AutoCount.PlugIn.MenuItem("Greetings", 1, OpenAccessRight="CMD_OPEN_FORM1", VisibleAccessRight="CMD_VIEW_FORM1")]
//Attribute contains Optional Parameter [BCE.AutoCount.PlugIn.MenuItem("Greetings", MenuOrder=1, BeginNewGroup=true, ParentMenuCaption="Group Menu", ParentMenuOrder=1, OpenAccessRight="CMD_OPEN_FORM1", VisibleAccessRight="CMD_VIEW_FORM1")]

This sample code shows where to use the attribute.

[BCE.AutoCount.PlugIn.MenuItem("Greetings", 1)]
class FormAbout : Form
{
    public FormAbout(BCE.Data.DBSetting dbSetting)
    {
    }
}



Add Sub Menu that inherits BCE.AutoCount.PlugIn.BaseMenuItem

  • Create a class that inherits from BCE.AutoCount.PlugIn.BaseMenuItem
class SubMenuAbout : BCE.AutoCount.PlugIn.BaseMenuItem
{
    public SubMenuAbout(BCE.Data.DBSetting dbSetting) : base("BaseMenuItem Sample", 90, true, "", "")
    {
    }

    public override void MenuItemClick(
             ISimpleThreadFormLauncher threadFormLauncher, DBSetting dbSetting)
    {
        threadFormLauncher.LaunchAppForm(typeof(AboutBox1).AssemblyQualifiedName);
        base.MenuItemClick(threadFormLauncher, dbSetting);
    }
}


Exercise 2: Create Dialog Box

Objectives: Create "About" Dialog Box to display information of this plug-in.


This exercise shows the steps to create Dialog Box using Class Attribute.
Start Exercise 2


Exercise 3: Create Form

Objectives: Create a windows form to load A/R Invoice, A/R Debit Note, A/R Credit Note and A/R Payment.


An example to load data and display on the Form.
Start Exercise 3



Summary

In this tutorial, you have learned;

  1. Apply Plug-In Entry Point
  2. Create Menu Item
  3. Create and build AutoCount Accounting plug-in.
  4. Access to MS SQL Server instance with DBSetting.
    You will learn more on BCE.Data.DBSetting as we progress.
  5. Load AutoCount Accounting data to a System.Data.DataTable.

Next tutorial, we look at the presentation of user interface, and design the UI that look and feel like AutoCount Accounting.

See Also