Evolution of new web technologies directed enterprises to web based software solutions. New tecnologies and frameworks offer lots features for web based solutions but entreprises still need some sort of rich client back office software to access backend data or perform specialized and complicated business tasks.
Pragma BackOffice (PragmaBO) is an effort to provide extensible rich client framework for enterprise level back office solutions based on Microsoft platform (Windows, .NET , C#, MS SQL Server 2005/Express ). Main features of PragmaBO are
- Provide ability to define and organize backend data in a tree hierarchy.
- Provide business users to search and edit data easly
- Provide extensibility by custom developed AddIns
- Built in User/Role management and security
- Central management and deployment of AddIns
- Role based AddIn authentication
Pragma BackOffice is based on PragmaSQL architecture. All features demonstrated in this blog post are ready for use. If you have any questions or want to use Pragma BackOffice please feel free to send me an e-mail message or send me an instant message.
1. Host Application Features
PragmaBO host application provides some services to enable developers create and deploy custom AddIns. Some features provided are
- Centralized database connection management. You can register database connection parameters and retreive already registered parameters programatically.
- AddIn rendering. You can instruct PragmaBO host application to show your addin form as content.
- Automatically create and render menu items as specified in the addin definition file and provide users access to addin functionality via these menu items
- Built in web browser. If you are a developer you can programatically open new web browser, if you are a user can start new web browser from File menu.
- Register addin specific configuration management to the centralized configuration manager. PragmaBO core provides you special interfaces in order register your custom addin configuration user control to the Tools -> Options dialog under Modules node.
- Managing AddIn security and versioning. You can deploy addin packages to the database server and specify who can use each addin. PragmaBO host application automatically checks for addin updates during each startup and performs role based security checks so that unauthorized users are not allowed to run specified addins.
PragmaBO host application along with PragmaBO Core library provides application developers a foundation on which any kind of custom AddIn can be developed.
Following sections will give you insight to some of the built-in PragmaBO AddIns.
2. User Manager AddIn
PragmaBO comes with buil-in User/Role based security model. You can define users and add each user to any group yoıu desire. Role base security model is utilized by PragmaBO to provide the following functionality
- User login
- AddIn security checks: Who can use which addin
- Data editing related security checks: Who can edit which database table
In the following screenshot you can see the "Users" form of the User Management AddIn. You can add/delete/modify users as well as add/remove users to roles.
Following screenshot is "Roles" form of the User Management AddIn. You can defined roles and add/remove users to each role from this screen.
3. Data Store Manager AddIn
3.1 How to Define And Organize Backend Data
PragmaBO comes with built-in DataManagement AddIn. With this AddIn you can define database tables within a tree hierarchy and design data editing forms published to business user to edit table data.
In the left hand side of the above screenshot you can see the sample backend data store organized as PragmaBO Data Tree. In the right hand side of the screenshot you see the table designer.

After designing the actual (physical) database table you define PragmaBO related metadata such as which fields will be published to business users or which columns will store audit log information. You can see metadata definition screen above.
When you click "Design UI" button in the metdata editor custom form designer is initialized. You can design data editing form associatedto the specified database table. Form designer supports drag and drop and organizing your table columns by using tab pages.

You can define role based access to the specified database table by using Credentials editor.
3.2 How to Defined Search Scripts Step by Step
You can define data search scripts in order to provide business users with entry point to the backend data store. You simply write the data retrieval T-SQL and define the parameters.
Step-1: Define a root folder for your scripts and decide if you want the root folder (and scripts under the folder) to be published to your business users in the main menu as a command and/or under Data Editing main menu Search And Edit Data selector.
If you check "Publish in main menu" your scripts under the specified folder will be published as menu items under tha main menu marked as a red rectangle in the following screen shot.
Step-2: Write the T-SQL script that will be used to query data
Step-3: Define the script parameters so that you provide your business users a way to filter the data they will be working on.
NOTE: You can design a custom form ( in same way you did for data editing forms described above) that defines how parameters will be rendered to your business users.

Step-4: Preview and test your script
3.3 How To Define Queries
You define queries in the same way you defined your scripts. But queries are different than script in two ways
- Queries can render multiple resultsets, thats is you can include two or more SELECTs or stored procedures in the same query.
- Queries are not rendered in the Main Menu of the application, business users access the queries from "Data Editing" main menu.
4. Data Editing AddIn
4.1 Edit Data
Entering orders for specified customers is a simple and pretty common business case for enterprises. Your business user can perform this task with PragmaBO following these simple steps
Step-1: Click "Operations" menu item located in the Main Menu and run "Enter Order" command
Step-2: Associated search script is rendered. The user enters some values to the designed parameters and runs the script by pressing "List" button.
Step-3: User selects the appropriate customer from the list and presses "Edit/View Record" button or simply presses F2 and Data Editor form for the selected record is opened as a seperate tab page.
Step-4: Database tables related to the selected Customer (such as address or orders) are rendered as menu items automatically. User selects the appropriate database table, in our case that is Orders table marked with the red rectangle in the screenshot. If there are any Orders associated with the selected Customer all orders are listed in the bottom of the form.
Step-5: User can edit/delete any record from the list or add new Order for the selected customer.
Step-6: If there exists any other associated database table with the selected order these tables are also rendered as menu items in the Detail Record Editor . In our case we also have Products(marked with red rectangle in the previous screenshot) for each Order.
4.2 Extend Data Editing with custom AddIns
Built-in Data Editing AddIn provides you with the basic record listing and editing functionality by default for each database table. But you can extend Data Editing AddIn by specifying custom extensions for each database table. PragmaBO Data Editing AddIn supports three types of extension.
- You can develop custom user controls inherited from DataRecordModuleBase (this base class implements IDataRecordModule interface) class provided in in Pragma.Bo.Core.dll. Data Editing AddIn renders each custom user control associated with the specified database table as seperate tab pages. See region marked with 1 in the following screenshot.
- You can develop custom commands inherited from AbstractDataRecordCommand class provided inin Pragma.Bo.Core.dll and define these commands in the AddIn definition xml. See region marked with 2 in the following screenshot
- You can develop custom pre/post action commands (you can inherit your commands from AbstractDataRecordPostActionCmd and/or AbstractDataRecordPreActionCmd classes included in Pragma.Bo.Core.dll) in order to intercept to user actions like save, edit or delete and perform custom controls in these commands.
You put all custom extensions inside one or more AddIn and deploy these AddIns using Tools -> AddIn Packages. Then for example if you want to render some custom modules for Orders table or provide some custom commands or intercept to user actions you define the assembly and class names for the specified table using Data Store Manegemnt AddIn.
You can see that in the screenshot we selected SampleManagedAddIn as the assembly where my custom extension classes reside and then we specified class names of the extensions (any type of extension, be it module, command or interceptor, can be defined here) we want to use along with the Orders table.