Search website

Archive | Sample Code

How to batch preview and print

The following code sample shows how to write code to do a batch preview and print. Code Snippet // The following code direct access to a local AutoCount database called AED_MOBILE_0, there is no login window to prompt out to allow users to select a database. BCE.Data.DBSetting dbSetting = new BCE.Data.DBSetting(BCE.Data.DBServerType.SQL2000, @”(local)\A2006″, “sa”, BCE.AutoCount.Const.AppConst.DefaultPassword, “AED_MOBILE_0″); BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(dbSetting); if (BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).Login(“ADMIN”, “ADMIN”)) {     BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceListingReport report = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceListingReport.Create(dbSetting);     // Uncomment the below code to pass by document keys     //long[] […]

How to add a new tab to Instant Info

Introduction To add a new tab into a Instant Info would require a programmer to do 2 things. First would be to create a separate .dll file that will contain the UI class for the information to be displayed. The second would be to add some codes to call the UI class in the AutoCount Accounting system. Creating the UI The UI class The following codes is for the UI design and control: Code Snippet […]

How to send a notification

The following code sample will show how to send a notification to the Notification system in AutoCount Accounting. Code Snippet // The following code direct access to a local AutoCount database called AED_MOBILE, there is no login window to prompt out to allow users to select a database. BCE.Data.DBSetting dbSetting = new BCE.Data.DBSetting(BCE.Data.DBServerType.SQL2000, @”(local)\A2006″, “sa”, BCE.AutoCount.Const.AppConst.DefaultPassword, “AED_MOBILE”); BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(dbSetting); if (BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).Login(“ADMIN”, “ADMIN”)) {     string poNo = “PO-000001″;     SendNotificationWithViewPOHyperlink(dbSetting, poNo); } The following is the supplementary code […]

How to attach a comboedit to grid column

The following sample code illustrates how to attach a comboedit to a grid column. The following code is written to work in the Invoice Entry window. As this sample shows more on how to use the DevExpress UI component, please navigate to the DevExpress documentation website for more information. Code Snippet private DevExpress.XtraEditors.Repository.RepositoryItemComboBox myDescComboBox; ///<summary> /// Use this event to do form initialization ///</summary> ///<param name=”e”>The event argument</param> public void OnFormInitialize(BCE.AutoCount.Invoicing.Sales.Invoice.FormInvoiceEntry.FormInitializeEventArgs e) {     myDescComboBox = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();     e.GridControl.RepositoryItems.Add(myDescComboBox); […]

How to Print to another Printer

The following code allows developer to make the system to print another copy of the report on another printer. Please place the script in the Report Tool script under the Application Category in Script Maintenance (as shown below) Code Snippet const string PrinterName = “Microsoft XPS Document Writer”; ///<summary> /// Occurs after a report is printed ///</summary> ///<param name=”e”>The event argument</param> public void AfterPrint(BCE.AutoCount.Report.ReportTool.AfterPrintEventArgs e) {     if (e.ReportType == “Invoice Document”)     {         if (e.PrintFix.PrinterSettings != null)             e.PrintFix.PrinterSettings.PrinterName […]

How to add UDF and UDL

Introduction The following code sample shows how a developer could add both User Defined Fields (UDF) and User Defined Lists (UDL) UDF Code Snippet // The following code direct access to a local AutoCount database called AED_MOBILE_0, there is no login window to prompt out to allow users to select a database. BCE.Data.DBSetting dbSetting = new BCE.Data.DBSetting(BCE.Data.DBServerType.SQL2000, @”(local)\A2006″, “sa”, BCE.AutoCount.Const.AppConst.DefaultPassword, “AED_MOBILE_0″); BCE.AutoCount.MainEntry.Startup.Default.SubProjectStartup(dbSetting); if (BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).Login(“ADMIN”, “ADMIN”)) {     BCE.AutoCount.UDF.UDFTable udfTable = new BCE.AutoCount.UDF.UDFTable(“SalesAgent”, dbSetting);     BCE.AutoCount.UDF.Field afield;     // […]