< Day Day Up > |
To run the code accompanying this chapter, you will need to create a database in Microsoft SQL Server named SalesScheduling. The book's Web site contains a database file named SalesScheduling.mdf that can be attached to a SQL Server installation. To attach the SQL database, execute the following steps:
The database is simple and consists of nine tables, but two of them (Statuses and ZipRegions) are for reference purposes only. Figure 3.2 shows a diagram of the database to illustrate the relationship between tables. Figure 3.2. SQL Server 2000 database used by Slugger Sports. The database is named SalesScheduling. The primary table that drives the sample telephony application is ScheduledItems.Marketing and sales people at the home office utilize an in-house application to add contact opportunities to the Leads table. When a new lead is entered, it is assigned the status value of 'N' to indicate it is new. As the regional salespeople build their schedules, new items are added to the ScheduledItems table. As leads are reviewed, the value of status is changed to either 'S' for scheduled or 'B' for bypassed. Leads become customers only after an order has been placed. For every customer, there is a corresponding lead record, but not all leads become customers. The ZipRegions table is used to group postal codes within a 100-mile radius. This helps regional salespeople identify which leads are in their area. The Statuses table contains all the possible stages that an order can be in. To ensure consistent data access, the application will utilize the Microsoft Data Access Application Block, version 2. Available as a free download from the Microsoft Patterns and Practices Web site at http://www.microsoft.com/resources/practices/code.mspx, the Data Access Block is one of several projects Microsoft offers. Each project contains efficient and well-proven methods for accomplishing common tasks. The application also utilizes the Exception Management Application block to log encountered exceptions to the Web server's event log. |
< Day Day Up > |