tailieunhanh - ASP.NET at Work: Building 10 Enterprise Projects PHẦN 10

Timecard mỗi, chúng tôi tiếp tục theo dõi bao nhiêu giờ đã được chi tiêu, những gì ngày chúng được sử dụng, và mức lương giờ của cá nhân. Bằng cách này, chúng ta có thể tạo ra projectstatus thông tin được hiển thị ở cấp nhiệm vụ và dự án. | Teamwork Network Project Tracking 559 For each timecard we keep track of how many hours were spent what date they were used and what the individual s hourly rate is. This way we can generate projectstatus information to be shown at the task and project levels. We also require that a description of the member s work be stored in the timecard. This enables you to keep a running history of what has been accomplished by your team. Creating the Views We have two views that will help us aggregate billing and budget information for the task and project views. We do this to remove some of the more complex SQL code that would otherwise be required to get summary information in addition to join to other tables. The first view we create sums up the hours and dollars for timecards grouped by task number. The code for this view is shown in Listing . CREATE VIEW vw_SummarizeTimecardsByTask AS SELECT fkTaskID SUM HourCount As HoursByTask SUM HourCount HourlyRate As TotalByTask FROM tblTimecards GROUP BY fkTaskID Listing vw_SummarizeTimecardsByTask The second view we need is one step above this one and provides the total of hours and dollars by project. The code is shown in Listing . CREATE VIEW AS SELECT SUM AS HoursByProject SUM AS TotalByProject FROM T INNER JOIN V ON GROUP BY Listing vw_SummarizeTasksByProject You ll be seeing these views in a number of different places in the application as you work through the project. 560 Project 10 Creating the Stored Procedures As usual we are making extensive use of stored procedures for this portion of the application. The primary reason we re doing this is to help remove some of the need to build grids manually. If we can get all the information from the database in the proper format we can just feed it into the various Repeater controls instead of having to manually

TỪ KHÓA LIÊN QUAN