Visual C#/Oracle Web-Based Court Docket by Jim Dunne
As the IT administrator of two courts, I recognized the need to develop a fast, highly flexible tool that the clerks could use to get and print the day's court cases for the judges and bailiffs (known as a docket). We had a vendor provided case management system that would create a docket, but it was slow, limited in flexibility, and produced massive reports of 30 or more pages, with a lot of extraneous information the clerks didn't need, but couldn't take out. Below is the user interface to the docket part of the vendor's application:
Vendor Docket Interface Screen
Rather then use the limited docket functionality in the vendor application, the court clerks would enter all the cases in the database as they came up, and then hand-type the dockets each day, even though the data was available in the database. It took one to two hours per clerk to create the docket by hand for each court day.
The vendor application was a 2-tier affair; a Visual Basic front-end app on the client computer that accessed an Oracle database on a Linux server. I decided to write a more robust .NET Visual C# docket report that was independent of the vendor application and pulled the data directly from the database. The new docket needed to be very flexible in terms of report and printing options. Clerks should be able to search by judges, case type, hearing type, time range, and date, or a date range. The report layout would be customizable as far as information displayed, font family and size.
My solution was 3-tier: I set up a Windows 2003 Server with IIS, and used Visual Studio 2005 to code the app in C#. I used Oracle data adapters to connect to the database and retrieve information. From their PCs, users point their browser to the webpage on the Windows server, and it connects to the database to serve the information.
On the database side, I wrote a stored procedure that dynamically constructs a select query based on the user's input, pulls all the data together, and sends it to the data adapter as a cursor. The OracleDataAdapter fills a dataset with the information, and then formats the data as desired and binds it to the GridView for display.
To make the docket more user-friendly, I used Microsoft's AJAX.NET to eliminate post-back flicker. This also allowed me to use some of the cool controls in the .NET AJAX Control Toolkit .
This is the interface:
My .Net Docket Interface Screen
This docket allows selecting cases by multiple judges, case type, 5 different hearing types, prosecutor, time range, and date or date range. The data is displayed in a GridView on the same page. Using the "Show?" box in the upper right lets users customize which columns of the GridView they want to see, and specify whether the alternating row style was visible, and whether the defendant's name appeared in bold. User's can also set the gridview's font type and size.
The docket initially opens on the current date and fills in the default docket for the day. Every mouse click on a docket control updates the GridView instantly, so clerks can see in real time if this was what they needed. The only buttons that need to be pushed are the "Print" or "Edit" buttons. To save space in this article, the example below is of an incomplete, future docket day with only 5 cases entered so far - dockets typically contain over 100 cases:
The Docket Interface and Report
When clerks have the report the way they want it, they can print it straight from Internet Explorer by clicking the "Print Report" button. If they need to make any changes to the report, such as adding notations to cases, they can export the report to Microsoft Word by clicking the "Edit Report (Word)" button. Once open in Word, they can edit the report just like a table in Word, and, when finished, print the docket from Word.
Prior to this project I had never done any serious SQL programming. However, the complexity of this docket, and speed and security concerns necessitated a substantial SQL stored procedure. The stored procedure I wrote does the following:
Accepts input parameters from the OracleDataAdapter. These parameters include date, time, judge, case type, hearing types, and the prosecutor's name, if desired. Based on these parameters an SQL SELECT statement is dynamically generated.
OracleDataAdapter
SELECT
A REF_CURSOR is opened using the generated SELECT statement.
The cursor is fetched into variables in a loop.
If a traffic/criminal case, get prosecutor, violator, and violation information.
If a civil case, get the plaintiff, defendant, attorney, and case information.
Parse the names and format the strings for the docket.
Insert all the variables into a global temporary table.
Open a REF_CURSOR by selecting everything from the global temp table.
REF_CURSOR
Return this cursor to the docket application.
The main part of the application is the web interface. When a user clicks an item on the screen that calls for a docket update:
The report header is filled in and formatted based on the user's selections.
All input fields on the interface, such as judges, prosecutors, options, etc, are gathered and assigned as input parameters for the OracleDataAdapter's Select Command.
OracleDataAdapter's
Select
The report's GridView is dynamically formatted based on the user's input.
GridView
The OracleDataAdapter gets the return data from the stored procedure and fills the dataset.
The returned data is further formatted for display in the GridView.
Click here to See The Code Behind.
I used AJAX .NET in the project to enhance the user experience. Using Update Panels, the flicker of redrawing between postbacks is eliminated - only the portions of the screen that change are updated (called "asynchronous" updating, the "A" in AJAX). So, if a user changes a selection on a control on the web interface, only the report portion of the page with the newly retrieved data is refreshed...the user doesn't notice any screen redraw.
Update Panels
Using the AJAX Control Toolkit , I was able to do some neat things, for instance:
Fly-out "Hint" dialog boxes: Using the toolkit's AnimationExtender, I created "Hint" links next to some of the controls to help users understand their purpose. If a user clicks on a link next to a control, a fly-out dialog gives hints on using that control.
AnimationExtender
Drop-down Calendar: Using the Calendar control in the Toolkit, I was able to put a popup calendar in the "Date To:" textbox. Clicking on the textbox causes the calendar to popup. Clicking on a date in the calendar populates the textbox with that date:
Calendar
TextBoxWatermark Extender: This control attaches to a textbox to get "watermark" behavior, which displays a message to the user when the textbox is empty. When the user types some text in the box, the watermark goes away. This provides more information to the user about the TextBox itself without cluttering up the rest of the page.
ModalPopup: This control creates a "modal" popup, that blocks the user from clicking on the rest of the screen until the user interacts with the popup. I used this control to alert the user if they select a "Date To:" that is less than the "Date From:". A modal popup blocks the screen with the error message until the user presses "OK".
The new docket was much faster than the old. Clerks could create a day's docket in less than 5 minutes, compared with the old method, which took 90 minutes to 2 hours. Compared to the vendor's docket, which spat out dozens of pages of extraneous information, the new docket was only 2 to 3 pages long, and contained only the information the clerks wanted to see there. Hundreds or worker-hours and reams of paper are saved every year by the new docket!
Back
Updated September 16, 2008