You can list a new job at the ASP.NET job site by clicking the list job link that appears at the top of most pages. When you click the list job link, you are brought to the ListJob.aspx page (see Figure 30.5).
Figure 30.5. The List Job page.
This page contains a form for entering a brief and long description of the job. When you submit the form, the job information is added to the database with the stored procedure in Listing 30.8.
Listing 30.8 AddJob
CREATE Procedure addJob ( @username Varchar( 20 ), @briefdesc Varchar( 50 ), @fulldesc Text ) AS Insert Jobs ( job_username, job_briefdesc, job_fulldesc ) Values ( @username, @briefdesc, @fulldesc ) UPDATE Userlist SET ul_isresume = 0 WHERE ul_username = @username
The C# version of this code can be found on the CD-ROM.
The stored procedure in Listing 30.8 adds a new job listing to a database table named Jobs . The stored procedure also updates the UserList table to identify the person who listed the job as an employer, rather than an employee.
After a new job has been listed, a link to the job appears on the home page of the company at the job site. If you click the link to the job listing, you are brought to the Job.aspx page.
The Job.aspx page satisfies a dual function. For the public, the Job.aspx page displays the job listing. However, if you are the person who listed the job, the Job.aspx page also enables you to update the job listing.
If you are identified as the person who listed the job, a panel appears that gives you the option of updating the job listing (see Figure 30.6). If you decide to update the job listing, the listing is converted into a form. When you save any changes to the form, the updated job listing appears immediately.
Figure 30.6. Updating a job listing.
The Job.aspx page uses Panel and Placeholder controls to display either the job listing itself, or a form for updating the job. By setting the Visible property of the various Panels and Placeholders in the page, either the job listing or form for updating the job listing is displayed.
To learn more about using Panel and Placeholder controls, see Chapter 4, "Advanced Control Programming."