This SDK example illustrates the use of the SDK example in the context of the tracking view on OnTime Management Suite or OnTime Dispatch. The example initializes a tracking extension and demonstrates a simple CSV (comma separated value) export operation from the Tracking table of an OnTime account. A ribbon button and a context menu button are instantiated and both are assigned to the same method named ExportOrders(). The ExportOrders() method initiates a windows form and instantly prompts the user with a save file dialog window. Once the user chooses a destination for the CSV file, the method runs a background worker that will write the orders to the CSV file. The background worker queries the Tracking table for all orders that have a weight between 0 and 50. Headers are then written to the CSV file. The method then writes all of the orders that were returned by the query to the CSV file. After each order is written to the file, the background worker reports its progress to the UI thread and updates a progress bar. 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 3\OnTime SDK Example 3 VB.sln
Source code for this sample in C# can be found under:
Samples\Example Project 3\OnTime SDK Example 3 CS.sln