This SDK example illustrates the use of the SDK example in the context of the billing view on OnTime Management Suite. The example initializes a billing extension and demonstrates a simple CSV (comma separated value) export operation from the Invoices table of an OnTime account. A ribbon button and a context menu button are instantiated and both are assigned to the same method named ExportInvoices(). The ExportInvoices() method starts by opening a save file dialog window and asks the user where the CSV file should be created. Once the user chooses a destination for the CSV file, the method creates headers for the columns of the CSV file. The method then writes all of the invoices that are selected in the invoice view of OnTime Management Suite by iterating through the property SelectedInvoices. On each iteration, the current invoice is marked as transferred by calling the method Data.MarkInvoiceTransferred(invoice.ID, True). Finally, the extension displays a message box indicating that the export operation was successful.
Each example project is available with source code in C# and VB.NET. Locate the source code under the folder to which the OnTime Extension SDK was extracted.
Source code for this sample in Visual Basic can be found under:
Samples\Example Project 2\OnTime SDK Example 2 VB.sln
Source code for this sample in C# can be found under:
Samples\Example Project 2\OnTime SDK Example 2 CS.sln