You are on page 1of 113

JOB PORTAL

A Project Report Submitted to T. D. B. COLLEGE, RANIGANJ

By MD ALIM ANSARI REG. NO: 689449 Under the Guidance of

In partial fulfilment for the award of the degree of

DOEACC A LEVEL

8/7/2012

DECLARATION
I hereby declare that the project entitled JOB PORTAL submitted in partial fulfillment of the requirements for the degree of DOEACC SOCIETY A LEVEL, is my original work and not submitted for the award of any other degree, diploma, fellowship or any other similar title or prizes.

Place :

KULTI

Date :

08-07-2012

MD ALIM ANSARI

CERTIFICATE BY GUIDE
This to certify that the report of the project submitted is the outcome of the project work entitled JOB PORTAL carried out by MD ALIM ANSARI bearing Registration No.: 689449 carried by under my guidance and supervision for the award of Degree in DOEACC SOCIETY A LEVEL. To the best of the my knowledge the report Embodies the work of the candidate him/herself, Has duly been completed, Fulfils the requirement of the ordinance relating to the MBA degree of the University and Is up to the desired standard for the purpose of which is submitted.

(Signature of the Guide) Name: Designation: Department: Name & Address of the Institute The project work as mentioned above is hereby being recommended and forwarded for examination and evaluation.

ACKNOWLEDGEMENT

This project has been made possible through the direct and indirect cooperation of various respected persons. First and foremost I would like to acknowledge with deep gratitude the guidance and support of Mr.

My sincere thanks to all the faculty members of my institute for providing us their valuable support and cooperation which were necessary to carry out my project work.

Finally, I would like to express my deepest gratitude and reverence to my parents and friends for their continuous supports.

Table of Contents
1. 2. 3. 4. Introduction.6 Objective Of The Project..7 Scope Of The Project....8 System Analysis.9 4.1 Identification of Need..9 4.2 5. 6. Preliminary Investigations.....9

System Design...10 Feasibility Study....11 6.1 6.2 6.3 Technical Feasibility...11 Operational Feasibility...11 Economic Feasibility..12

7.

Project Planning And Scheduling...13 7.1 7.2 Work Breakdown Structure..13 Pert Chart..14-15

8. 9.

S/E Paradigm....16 E-R Diagram.17 9.1 9.2 ERD of JobSeeker..17 ERD of Employer18

10. 11.

Context Level Or 0-Level DFD..19 Relationship.21

12.

Schema.22 12.1 12.2 12.3 12.4 12.5 Members..22 JobsDb_Companies..23 JobsDb_JobPostings24 JobsDb_Resumes..25 JobsDb_MyJobs.....25

13. 14. 15. 16.

Requirement Specifications26-27 Tools for Hardware and Software...28 Validation Checks..29 Testing...30 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 16.10 Testing Objectives..31 Testing Principle..31 Testability..32 Operatibility..32 Observability32 Controllability..33 Decomposability.33 Simplicity..33 Stability.34 Understandability..34

17. 18. 19. 20.

Sample Output..35-40 Project Code..41-110 Conclusion..111 Reference.112


5

1. Introduction
People often compare the growth of the internet to the historic growth of other technologies, sometimes to suggest that the internet is just the latest technological advancement and may not signify as a revolutionary change. However, there is a difference between the birth of the Internet and the technologies that preceded it. Today the virtual world has all but taken over the real world. Our society is i ncreasi ngly relying on new i nformation technologies and the Internet to conduct business, manage industrial activities, engage i n personal communication and even perform scientific research. E -business and e -commerce are the new mantras and electronic transactions dominate the overall business paradigm.

This project is mainly an effort to continuously shape the Indian Internet revolution by building the largest and the number one online profitable person-toperson trading community in the country. We will try do so in the future by offering, the best consumer experience in an environment driven by high performance, constant innovation, teamwork and opportunity for wealth creation. The main objective and inspiration for this project is to provide a online job search so that the job seeker can apply and do their job hunting from their home with ease. The site (Job Portal) is only a venue where users may meet and interact with the employer for the jobs. Job Portal on the Net is a job searching on the Internet where the company can place their requirement and the user(Student/Professional) can view the company requirement and place their resume. Job Portal on the Net will have numerous registered users who will search for the job listed and place their resume and get message from the company. The register user can also be the employer who can place their requirement of the person and can select the resume posted by the user and can also send them the message as reply .

2. Objective Of The Project


Job Portal shows its members jobs from every employer website. It can fi nd in the India and United States and throughout the world. It is going to be most powerful job -search engi ne i n existence and powers several job boards. Recruiters use Job Portal to track down potential jobs for their clients .

Why Use Job Portal?


Most j ob openi ngs are posted on employer websites and not commercial job boards. Job Portal lists unadvertised job listings from employer websites which receive hardly any applications because people do not know about them. Job Portal does not allow any advertisers and is unfettered by any third party other than employers themselves. W e only list jobs direct from employer websites. As a recruiter, we can get an edge over other co mpetitors by creating Job Portal and dramatically increase our recruiting income. Job Portal is the direct route to career success. Become a member of the world's largest job -search engine now!

3. Scope Of The Project

This software is very useful for mainly for Job Seekers. They can search and collect information about job. List of all existing jobs is also available for candidate. Total information of any employer will be available for candidate. The users can apply all the job which is posted. Even the candidate create his resume. The completed resume will appear on candidates account information page and be available for sending to an employer when he feels a job opportunity matches his interests. Direct messaging on JobBase site allows a candidate to communicate with prospective employer.

This software is also very useful for employer. They can search and collect suitable candidate for his company from applying job. He can post his company profile publicly. He can add some candidate to his favorite list by this utility and contact them when he needs. Direct messaging on JobBase site allows a employer to communicate with prospective candidate. Even he can view the Job product offered by JobBase and he can view his data and his purchasing history.

4. System Analysis
Today more and more people around the world experience the draw of the web.

4.1 Identification of Need


At the outset of any task, it is of importance to determine its objective or the aim behind performing the task. Once the aim or the need is identified half the battle is won. Then, there only remains the task to determine the right approach to achieve the task in the best possible manner. During the development of this project we followed the same mantra. Before beginning to develop the project we did a detailed analysis to have a clear picture of the aim of this project, how this project would benefit others etc. With this as base we started our preliminary investigations

4.2 Preliminary Investigations


Preliminary investigation involves collecting information that helps to evaluate the merits of a project and make an informed judgment about the feasibility of the proposed project. When this project was being conceptualized one of the prime consideration was the capability that technology has to offer to the present day solution designers. What was beyond the realms of possibility even a decade back is today very much within the reach of the solution designers. One of the first things that the designer needs to consider pertains to the target user group and their profile. Some of the questions that need to be considered at this stage are Who will be the possible client for my solution? What will be the target profile of my client? What kind of strategic age group am I looking at? What is my clients expectation vis--vis this kind of service? Some of the other areas, which are looked into, could be The kind of site (whether commercial, educational, entertainment etc.) Cost of failure Sophistication levels User interaction level While planning Job Portal on the Net a lot of consideration was given to all these issues. .

5. System Design
Every stakeholder in a system must be well identified and the relationships between them precisely defined. To design a well behaved and satisfactory system it is of utmost importance that the users requirements be minutely scrutinized. This may even necessitate an iterative effort of questions, clarifications and modeling of the suggested solution space time and again. In the design and conceptualization stages of the Job Portal on the Net system an extensive reliance was made on Data Flow Diagrams which were then exploded into more and more microscopic level designs. Once the design looked reasonably on the mark it was a matter of refining it further to get the optimum results. In the process the Entities also stood out and the relationships between them became easier to define. The design step of Job Portal produces a data design , architectural design , an interface design , and a procedural design. The data design transforms the information domain model created during analysis into the data structures that will be required to implement the software. The architectural design defines the relationship among major structural elements of the program. The interface design describes how the software communicates within itself, to systems that interoperate with it, and with humans who use it. An interface implies a flow of information. The procedural design transforms structural elements of the program architectures into procedural description of software components. During design we make decisions that will ultimately affect the success of the software construction, and the ease with which the software is maintained. Design is the only way that we can accurately translate a customers requirements into finished software product or system.

10

6. Feasibility Study
A feasibility study is made to see whether a project can be successfully developed and deployed within the given time frame and the available resources. It looks for possible areas of risk and whether the risks are acceptable, whether the final outcome of the project would justify the cost involved and makes a study of the function, performance and constraints involved that may affect the ability to achieve an acceptable system.

6.1 Technical Feasibility


This project has been taken up as a Web Based project, which will entail the design and development of an Job site to be hosted on a server available on the Internet. Thus, the technologies and languages involved in developing this project are .NET Sqlserver has been used as the RDBMS, which stores all the required data and ensures support for multiple transactions and concurrent usage, which is a prime requirement for this project.

6.2 Operational Feasibility


This test of feasibility analyses whether a project will work once it is developed and deployed. The main question this test tries to answer is whether there is enough support from the management and users to develop the project and whether the service provided after the deployment of the project will be good enough to draw users. This project aims to provide a digital job search for candidate/job seeker where they can check out the listed job and choices at an extremely competitive environment and do their Job search, all from the comfort of their home at the best possible ease. The project is seen to have all the necessary elements to draw users and provide them with the kind of services, which will be of interest to the users. The project as such meets all the required criteria to declare the project operationally feasible.

11

6.3 Economic Feasibility


Every project is developed keeping in mind that execution of the project should provide a financial gain of at least equal or above the amount invested in the complete execution of the project. The major advantage of Job Site lies in the fact that the initial investment required is radically less than implementing the same in the Physical environment. This project, which is essentially a web based project using Internet as its primary medium for any interaction, does not involve any huge investment scopes. However, keeping in mind the services being offered through this project and the business model adopted, the project has excellent return on investment scope for its implementer. Thus, if given that the project is technically and operationally feasible the economic feasibility of the project is easily supported.

12

7. Project Planning and Scheduling


Scheduling is an important activity of any project management. Scheduling a software project involves first breaki ng down an entire problem i nto a logical set of tasks which would be assigned to developers. In order to Schedule the project Job Portal we have to do the following: 1. Identify the tasks needed to complete the project. 2. Determine the dependency among different tasks. 3. Establish the most likely estimates for the duration of the identified tasks. 4. Plan the starti ng and endi ng dates for various tasks. 5. Determi ne the critical path i.e. t he chai n of tasks that determine the duration of the project.

7.1 Work Breakdown Structure


Work Breakdown Structure (W BS) provides a notation for representi ng the major tasks needed to be carried out in order to solve a problem. W e represent the major ac tivities needed to solve the problem as nodes of a tree. The root of the tree is labeled by the problem name. Each node of the tree is broken down i nto smaller components that are designated as the children of the node."

13

7.2 PERT CHART


(Program eval uatio n review techni que) : A PERT charts consists of a network of boxes and arrows. It is organi zed by events & activities or tasks. The boxes represent activities and the arrows represent task dependencies. The boxes of PERT charts are usual ly annotated with the pessimistic, likely, and optimistic estimates for every task. It is a scheduling device that showed us graphically which tasks must be completed before others were begun. PERT controlled time and costs during the project and also facilitated us in find ing the right balance between completing our project on time and completing it withi n the budget. PERT recognized that project was complex, that some tasks must be completed before others could be started, and that the appropriate way to manage the project was to define and control each task. Because projects often fall behind schedule, PERT was designed to facilitate getting our project back on schedule. To build a PERT chart for our project, we first listed all the activities required for the completion of the project and estimated how long each will take. Then we determined the dependence of the activities on each other. The PERT chart gave us a graphical representation of this information, This technique did not help in deciding which activities were necessary or how long each would take, but it did force the administrator to take the necessary planni ng steps for answer these questions.

14

Figure below shows a PERT chart of our project. The arrows show the new i nformation that was not available in the work breakdown structure. The chart shows clearly that the project consist of the activities of analysis" design, coding and testi ng phases. The figure shows that the project was started on 1st Jan,2009 . System analysis work will be started on 15th Jan, 2009 followed by system designing work started on 15th Feb,2009. Since the design activity was estimated to take 31 days, any activity that followed the design started on 15th March, 2009 at the earliest. The dependency arrows helped us compute these earliest start dates based on our estimates of the duration of each activity. This dates are shown i n the figure. The chart shows that the path through the project that consist of the analysis, design, codi ng and i ntegration and testi ng activities is the critical path for the project. Any delay in any activity in this path would have caused a delay in the entire project. The admi nistrator monitored the critical path regularly in order to complete the project within the time frame.
Start

Analysis

Design

Coding

Integration & testing

Maintenance / finish

15

8. S/E Paradigm
Software is engineered by applying three distinct phases focusing on definition, development and support To solve actual problems in an industry setting a software or a team engineers must incorporate a development strategy that encompasses the process methods and tool layers and the generic phases. This strategy is often called Software Engineering paradigm. A process model for software engineering is chosen based on nature of the project and application, the methods and tools to be used and controls and deliverables that are required. Software engineering is a layered technology. Any engineering approach must rest on an organizational commitment to quality. Total quality management and similar philosophies faster a continuous process improvement culture, and this culture ultimately leads to the development of increasingly more nature approaches of the software. The foundation of software engineering is a process layer. Software engineering process is the glue that holds technology layers together and enables rational and timely development of computer software. Process defines a framework for a set of key process areas that must be established for effective delivery of software engineering technology. The key process areas forms the basis of management control of software projects and establish the context in which technical methods are applied, work Jobs are produced, milestones are established, quality is ensured and change is properly managed. Software engineering methods provides a technical how-tos for building software. Methods encompass a broad array of tasks that include requirement Analysis, design, program construction, testing and support. Software engineering rely on basic principles that govern each area of technology and include modeling activities and other descriptive techniques. Software engineering tools provide automated and semi-automated support for the process and methods when tools are integrated so that the information created by one tool can be used by the another, a system for the support of software development called computer aided software engineering is established.

16

9. E-R Diagram 9.1 ERD of Job Seeker

Job seeker

1
hav e

Job

pos t
M Resume

hav e M ResumeJob

M
Send

Employer
mesage

1 M Send Job Seeker mesage

17

9.2 ERD of Employer

Employer

1 hav e 1 1

Member

pos t M Job_details M Maintain

hav e
M Job Seeker 1
Post

Company Profile

Resume

Send/r eceive

Job seeker message

18

10. CONTEXT LEVEL OR 0- LEVEL DFD -

MEMBER EMPLOYER

Online HotJob

JOB SEEKER 19

Login verificatio
Verify Authenticate user authenticate user login

Create new member


request for creating new a/c

Post job

post vacancy

EMPLOYER
favourite request for job info return job seeker biodata message for update

4 View job
see job info request job seeker to see favourite job

5 View jobseeker

7 Add to favourite

request to see message or send message

Get report

job seeker resume

post add resume

Job employer favourite

Resume 6

update job

Receive /send message Send message to job seeker Job seeker message Receive message from job seeker

update all job info of employer

Emp message

20

11. Relationship

21

12. Schema 12.1 Members

22

12.2 JobsDb_Companies

23

12.3 JobsDb_JobPostings

24

12.4 JobsDb_Resumes

12.5 JobsDb_MyJobs

25

13. Requirement Specifications


The software requirement specifications is produced at the culmination of the analysis task. The function and performance allocated to software as part of system engineeri ng are refi ned by establishing a complete description, a design detailed functional description, a representation of system behavior, an i ndication of performance requirements and constraints, appropriate validation criteria and other i nformation requirement s. The Introduction of software requirements specification states

the goals and objectives of the software, describe it in context of the computer based system. Actually the i nformation may be nothi ng more than the software sco pe planni ng document. Here in this project the introduction is described as follows : The information description provides a detailed description of the problem that the software must solve. Information content, flow, and structure are documented. Hardware and software and human interfaces are described for external system elements and i nternal software functions.

A description of each function required to solve the problem is present provided justified diagrams structure in functional des cription. A processing constraint are represent among narrative stated or the one other is and more overall software for each performance are of the function, design to

characteristic are stated and graphically and interplay

i ncluded software

inactions and other system elements .

26

The

software

Behavioral the

description of

sections the

of

the a

Specification

examines

operations

software as

consequence of external ev ents and internally generated control characteristics. Validation criteria the most is probably the most important and, ironically selection of software requirement

neglected

specification. Specification of Validation criteria acts as implicit review of all requirements. Finally, the that and relate to specification the The incl udes a Bibliography and

Appendix. The Bibliography contains reference to all documents software. These Appendix i nclude other software that engineeri ng documentation, techni cal references , vendor literature standards. contai ns information supplements the as appendix. In many cases the software or a preliminary the user s requirement specification may user s is manual heavy specification. Tabular data, detailed description

of algorithms, charts, graphs and other material are represented

be accompanied by an executable prototype, a paper prototype manual. The preliminary manual as bla ck presents software box. That

emphasis is placed on user input and the resultant output. The manual can serve as a valuable tool for uncovering problems at the human/machi ne interface .

27

14. Tools/Platform for Hardware And Software Requirement Specification

HARDWARE
PROCESSOR RAM HARD DISK CD ROM DRIVE CACHE MEMORY MONITOR : : : : : : PENTIUM IV 256MB DDR RAM 40GB 52X 512 KB 17 COLOR

SOFTWARE
OPERATING SYSTEM RDBMS SERVER LANGUAGE : :
28

: :

WINDOWS XP/2000 MS-SQL SERVER 2008 IIS SERVER ASP.NET

15. Validation Checks

Validation is an integral part of project development. It includes a wide range of SQL activities that include formal technical reviews, quality and configuration audits, performance monitoring simulation, feasibility study, documentation review, database review, algorithm analysis, development testing, qualification testing and installation testing. Validation was done at various phases during the development of this project to ensure that the project was meeting all the requirements adequately and with in the quality and time specifications decided upon. Another aspect of validation check refers to putting checks on the user search input to ensure that the system receives the expected search item from the user. Implementation of the above kind of checks is done through coding, where in, incase of wrong input, the user is either shown a warning or given an error message. Validation checks is also done when user login in the site. If the username or password is invalid then he will be asked to login again. Unregistered users will not be allowed either for placing the resume for the selected job and other facilities. He will only be allowed to have a view the listed job . Validation checks put checking on the site that a Employer can put his job details into the site after registering himself. A employer with a bad reputation may not be allowed in the future for listing his jobs in the Job Portal on the Net .For that the site provides various customer care and helpdesk services offline. Any grievances regarding user or employer will be registered there. Job Portal will take necessary actions regarding breaking rules and regulations of the site.

29

16. Testing
After development of the system , comes the integration and test ing phase i.e., studyi ng the potential Candidate employer , doing the SRS , designing the system ,designi ng the database,and writing the code for the database access and designing the user interface,now system is to be tested.

First the database is load ed on the server. The .net sqldbclient connections are set. Then the various pages are loaded the server. The server machine has W indows 2000 O/S wit h sqlserver and .net framework 3.5. The pages are then connected with the databases through the .NET connec tions . Junk data are then entered through the pages . Then the databases are tested to fi nd out if the data is entered properly .The data are then accessed through the pages .The search queries are run to fi nd out if they are bei ng generated properly .The corrections are made as and when necessary. It is also tested if the simultaneous access of the database by more than one user, cause any ki nd of error in the database. The locking procedure worked right.

Initially few arbitrary listing was created to test if the system was working from the front end as it was supposed to. Then the same HTML page was being running on different browsers. Some small flaws was being corrected while testing at the client side . Initially there was some flaws while connecting to the database but it was rectified gradually. In the server side there is our analyst constantly monitoring the server side working. Since the project is in its initial phase of launching it may have many hidden bugs which is not possible to uncover at this time. But in the future it will definitely provide the user better service and will have ample choice to the candidate to search job around in the Job Portal on the Net .

30

16.1 Testing objectives


Testing is a process of executing a program with the intent of finding an error. A good test is one that has a high probability of finding an as-yet-undiscovered error .A successful test is one that uncovers an as-yet-undiscovered error. These objectives imply a dramatic changes in view point. They move counter to the commonly held view that a successful test is one in which no errors found. Our objectives is to design test that systematically covers different class of errors and to do so with a minimum amount of time and effort. If testing

is conducted software.

successfully

it

will

uncovers all the

errors

in

the

16.2 Testing principles


All tests should be traceable to customers requirements. Tests should be planned long before test begins. The parreto principle applies to software testing. Testing should begin in small and progress toward testing in the large. Exhaustive testing is not possible. To be most effective testing should be conducted by an independent third party.

16.3 Testability
31

Software testability is simply how easily a computer program can be tested.

16.4 Operability
The better it works, the more efficiently it can be tested . The system has few bugs (bugs add analysis and reporting overhead to the test process). No bugs block the execution of tests.

16.5 Observability
What we see is what you test. Distinct output is generated for each input. System states and variables are visible or querible during execution. Past system states and variables are visible or querable. All factors affecting outputs are visible. Incorrect output is easily identified. Internal errors are automatically detected through self-testing mechanisms. Internal errors are automatically reported. Source code is accessible.

32

16.6 Controllability
All possible outputs can be generated through the combination of input. All code is executable through some combination of input. Software and hardware states and variables can be directly controlled by test engineer. Input and output formats are consistent and structured. Tests can be conveniently specified and reviewed.

16.7 Decomposability
The software system is built from independent modules. The software modules can be tested independently.

16.8 Simplicity
The less is there to test the more quickly we can test it. Functional simplicity : The requirements in this project for post office management system is account number, amounts, date of deposits, date of withdrawl, which we can get from recurring table. Stuctural simplicity : This project architecture is modularized to limit the propogation of faults. Code simplicity : Coding structure is adopted for ease of inspection and maintanence.
33

16.9 Stability
The fewer the changes the fewer the disruptions to testing. Changes to the software are infrequent. Changes to the software are controlled. Changes to the software do not invalidiate existing tests. The software recovers well from failures.

16.10 Understandability
The more information we have the smarter we will test. The design is well understood. Dependencies between internal, external and shared components are well understood. Changes to the design are communicated. Technical documentations is instantly accessible. Technical documentations are well organized. Technical documentation is specific and detailed. Technical documentation is accurate.

34

17. Sample Output

Fig:17.1 :Welcome Page

35

Fig: 17.2 :Register Page

Fig: 17.3 :Sign Up For New Account In Case Of Job Seekers

36

Fig: 17.4 :Register As Job Seeker

Fig: 17.5 :Page For Post Resume

37

Fig: 17.6: Page For Search Jobs

Fig: 17.7 : Page for My Favourites

38

Fig:17.8 : View Job Posting

Fig: 17.9 :ADD/EDIT Job Posting

39

Fig:17.10 :Modify Company Profile

Fig: 17.11 :Search Resume Database

40

Fig: 17.12 :View Resume

18. Project Code

18.1 Example of jobsearch.aspx (UI Code) for Jobseekers


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="jobsearch.aspx.cs" Inherits="jobsearch_aspx" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="Search Jobs!!!" SkinID="FormHeading"></asp:Label> <br />

41

<asp:Label ID="lblJobCount" runat="server" SkinID="Slogan"></asp:Label><br /> <br /> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table style="width: 100%"> <tr> <td align="right" valign="top"> <asp:Label ID="Label1" runat="server" Text="Skills :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtSkills" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSkills" Display="Dynamic" ErrorMessage="Please enter skills to search for"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label3" runat="server" Text="Country :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label4" runat="server" Text="State :" SkinID="FormLabel"></asp:Label> </td> <td align="left">

42

<asp:DropDownList ID="ddlState" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlState_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label2" runat="server" Text="City :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtCity" runat="server" Enabled="False"></asp:TextBox> </td> </tr> <tr> <td align="center" colspan="2" valign="top"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/SearchButton.gif" OnClick="ImageButton1_Click" /> &nbsp;<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/Images/MyFavorite.gif" OnClick="ImageButton3_Click" /> </td> </tr> <tr> <td align="center" colspan="2" valign="top"> <asp:Label ID="lblMsg" runat="server" SkinID="FormLabel"></asp:Label> </td> </tr> <tr> <td align="left" colspan="2" valign="top"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </td> </tr> </table>

43

</ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <center> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/progress.gif" /> </center> </ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="PostingID" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" PageSize="3" Width="100%"> <Columns> <asp:TemplateField HeaderText="Date"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PostingDate") %>'> </asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("PostingDate", "{0:MM/dd/yyyy}") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="title"></asp:BoundField> <asp:BoundField DataField="City" HeaderText="Location" SortExpression="city"></asp:BoundField>

44

<asp:BoundField DataField="companyname" HeaderText="Company" ShowHeader="False" SortExpression="companyname"> </asp:BoundField> <asp:ButtonField CommandName="viewdetails" ButtonType="Image" ImageUrl="~/Images/ShowDetails.gif"> <ItemStyle Wrap="False" /> </asp:ButtonField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> <br /> </asp:Content>

18.2 Example of jobsearch.aspx (Code Behind) for Jobseekers

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; public partial class jobsearch_aspx : Page { protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton b = (ImageButton)e.Row.Cells[4].Controls[0]; b.CommandName = "viewdetails";

45

b.CommandArgument = GridView1.DataKeys[e.Row.RowIndex].Value.ToString(); } } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "viewdetails") { Response.Redirect("~/jobseeker/viewjobposting.aspx?id=" + e.CommandArgument); } } protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { FillCountries(); FillStates(); lblJobCount.Text = "(Currently we have " + JobPosting.GetJobPostingCount() + " jobs!!!)"; if (Request.QueryString["mysearchid"] != null) { MySearch s = MySearch.GetMySearch(int.Parse(Request.QueryString["mysearchid"])); txtSkills.Text = s.Criteria; txtCity.Text = s.City; ddlCountry.SelectedIndex = s.CountryID; FillStates();

46

ListItem li = ddlState.Items.FindByValue(s.StateID.ToString()); if (li != null) { ddlState.ClearSelection(); li.Selected = true; } } } } private void FillCountries() { ddlCountry.DataSource = Country.GetCountries(); ddlCountry.DataTextField = "CountryName"; ddlCountry.DataValueField = "CountryID"; ddlCountry.DataBind(); } private void FillStates() { ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue)); ddlState.DataTextField = "StateName"; ddlState.DataValueField = "StateID"; ddlState.DataBind(); } protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { FillStates(); txtCity.Enabled = false; } private void BindGrid() {

47

int countryid = -1, stateid = -1; if (ddlCountry.SelectedItem != null) countryid = int.Parse(ddlCountry.SelectedValue); if (ddlState.SelectedItem != null) stateid = int.Parse(ddlState.SelectedValue); DataSet ds = JobPosting.SearchJobs(txtSkills.Text, countryid, stateid, txtCity.Text); GridView1.DataSource = ds; GridView1.DataBind(); if (GridView1.Rows.Count <= 0) { lblMsg.Text = "No records found!"; } else { lblMsg.Text = ""; } UpdatePanel2.Update(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; BindGrid(); } protected void ddlState_SelectedIndexChanged(object sender, EventArgs e) { if (ddlState.SelectedIndex > 0) { txtCity.Enabled = true; } else { txtCity.Enabled = false;

48

} } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { BindGrid(); } protected void ImageButton3_Click(object sender, ImageClickEventArgs e) { MySearch s = new MySearch(); s.Criteria = txtSkills.Text; s.CountryID = int.Parse(ddlCountry.SelectedValue); s.StateID = int.Parse(ddlState.SelectedValue); s.City = txtCity.Text; s.UserName = Profile.UserName; MySearch.Insert(s); } }

18.3 Example of MyFavorites.aspx (UI Code) for Jobseekers

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MyFavorites.aspx.cs" Inherits="MyFavorites_aspx" Title="Untitled Page" %> <%@ Register Src="../UserControls/DisplayModeController.ascx" TagName="DisplayModeController" TagPrefix="uc3" %> <%@ Register Src="../UserControls/MyJobs.ascx" TagName="MyJobs" TagPrefix="uc1" %>

49

<%@ Register Src="../UserControls/MySearches.ascx" TagName="MySearches" TagPrefix="uc2" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="My Favorites" SkinID="FormHeading"></asp:Label> <br /> <br /> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> <uc3:DisplayModeController ID="DisplayModeController1" runat="server" /> <br /> <asp:CatalogZone ID="CatalogZone1" runat="server" HeaderText="" VerbButtonType="Link"> <ZoneTemplate> <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" Title="Available Web Parts" /> </ZoneTemplate> </asp:CatalogZone> </div> <br /> <table style="width: 100%" align="center"> <tr> <td style="width: 100%"> <asp:WebPartZone ID="WebPartZone1" runat="server" BorderStyle="NotSet" WebPartVerbRenderMode="TitleBar" Width="100%"> <MinimizeVerb Text="Collapse" ImageUrl="~/Images/CollapseButton.gif" /> <RestoreVerb Text="Expand" ImageUrl="~/Images/ExpandButton.gif" /> <CloseVerb ImageUrl="~/Images/CloseButton.gif" /> <ZoneTemplate> <uc1:MyJobs ID="MyJobs1" runat="server" Title="My Jobs" /> </ZoneTemplate>

50

</asp:WebPartZone> </td> </tr> <tr> <td style="width: 100%"> <asp:WebPartZone ID="WebPartZone2" runat="server" BorderStyle="NotSet" WebPartVerbRenderMode="TitleBar" Width="100%"> <MinimizeVerb Text="Collapse" ImageUrl="~/Images/CollapseButton.gif" /> <RestoreVerb Text="Expand" ImageUrl="~/Images/ExpandButton.gif" /> <CloseVerb ImageUrl="~/Images/CloseButton.gif" /> <ZoneTemplate> <uc2:MySearches ID="MySearches1" runat="server" Title="My Searches" width="100%" /> </ZoneTemplate> </asp:WebPartZone> </td> </tr> </table> </asp:Content>

51

18.4 Example of MyFavorites.aspx.cs (Code Behind) for Jobseekers


using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class MyFavorites_aspx : System.Web.UI.Page { // Page events are wired up automatically to methods // with the following names: // Page_Load, Page_AbortTransaction, Page_CommitTransaction, // Page_DataBinding, Page_Disposed, Page_Error, Page_Init, // Page_Init Complete, Page_Load, Page_LoadComplete, Page_PreInit // Page_PreLoad, Page_PreRender, Page_PreRenderComplete, // Page_SaveStateComplete, Page_Unload protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } } }

52

18.5 Example of postresume.aspx (UI Code) for Jobseekers

<%@ Page Language="C#" CodeFile="postresume.aspx.cs" Inherits="postresume_aspx" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="Post Your Resume" SkinID="FormHeading"></asp:Label> </div> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table width="100%" cellpadding="3"> <tr> <td align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label15" runat="server" SkinID="FormGroupLabel" Text="Job Details"></asp:Label> </td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label1" runat="server" Text="Job Title :"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtJobTitle" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtJobTitle" Display="Dynamic" ErrorMessage="Please enter job title"> *</asp:RequiredFieldValidator> </td>

53

</tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label6" runat="server" Text="Desired Job Type :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlJobType" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label16" runat="server" SkinID="FormGroupLabel" Text="Location"></asp:Label> </td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label2" runat="server" Text="Target City :"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtCity" runat="server"></asp:TextBox> </td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label3" runat="server" Text="Target Country :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"> </asp:DropDownList> </td>

54

</tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label4" runat="server" Text="Target State :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlState" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label5" runat="server" Text="Acceptable Relocation :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlRelocationCountry" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label17" runat="server" SkinID="FormGroupLabel" Text="Education and Experience"></asp:Label> &nbsp;&nbsp; </td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label7" runat="server" Text="Education Level :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlEduLevel" runat="server"> </asp:DropDownList>

55

</td> </tr> <tr> <td align="right" nowrap width="10%"> <asp:Label ID="Label8" runat="server" Text="Experience Level :"></asp:Label> </td> <td align="left"> <asp:DropDownList ID="ddlExpLevel" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label9" runat="server" SkinID="FormGroupLabel" Text="Resume :"></asp:Label> </td> </tr> <tr> <td align="right" colspan="2" valign="top"> &nbsp;<asp:TextBox ID="txtResume" runat="server" Rows="15" TextMode="MultiLine" Width="98%"></asp:TextBox> <br /> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtResume" Display="Dynamic" ErrorMessage="Please enter resume"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="left" colspan="2" valign="top" class="dataentryformlabelbig"> <asp:Label ID="Label10" runat="server" SkinID="FormGroupLabel" Text="Covering Letter Template :"></asp:Label> </td> </tr> <tr>

56

<td align="right" colspan="2" valign="top"> &nbsp;<asp:TextBox ID="txtCoveringLetter" runat="server" Rows="15" TextMode="MultiLine" Width="98%"></asp:TextBox> </td> </tr> <tr> <td align="center" colspan="2" width="10%"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/SaveButton.gif" OnClick="ImageButton1_Click" /> &nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/CancelButton.gif" OnClick="ImageButton2_Click" /> &nbsp; </td> </tr> <tr> <td align="center" colspan="2" width="10%"> <asp:Label ID="lblMsg" runat="server" SkinID="FormLabel"></asp:Label> </td> </tr> <tr> <td align="center" colspan="2" width="10%"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <center> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/progress.gif" />

57

</center> </ProgressTemplate> </asp:UpdateProgress> <br /> &nbsp;<br /> &nbsp;</asp:Content>

58

18.6 Example of postresume.aspx.cs (Code Behind) for Jobseekers

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; public partial class postresume_aspx : Page { private Resume r; protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { if (Profile.JobSeeker.ResumeID != -1) { r = Resume.GetResume(Profile.UserName); txtJobTitle.Text = r.JobTitle; txtCity.Text = r.City; txtResume.Text = r.ResumeText; txtCoveringLetter.Text = r.CoveringLetterText; }

59

FillCountries(); FillEduLevels(); FillExpLevels(); FillJobTypes(); FillStates(); } } private void FillCountries() { ddlCountry.DataSource = Country.GetCountries(); ddlCountry.DataTextField = "CountryName"; ddlCountry.DataValueField = "CountryID"; ddlCountry.DataBind(); ddlRelocationCountry.DataSource = Country.GetCountries(); ddlRelocationCountry.DataTextField = "CountryName"; ddlRelocationCountry.DataValueField = "CountryID"; ddlRelocationCountry.DataBind(); if (Profile.JobSeeker.ResumeID != -1) { ListItem li; li = ddlCountry.Items.FindByValue(r.CountryID.ToString()); if (li != null) { ddlCountry.ClearSelection(); li.Selected = true; } li = ddlRelocationCountry.Items.FindByValue(r.RelocationCountryID.ToString()); if (li != null) { ddlRelocationCountry.ClearSelection(); li.Selected = true; } }

60

} private void FillStates() { r = Resume.GetResume(Profile.UserName); ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue)); ddlState.DataTextField = "StateName"; ddlState.DataValueField = "StateID"; ddlState.DataBind(); if (Profile.JobSeeker.ResumeID != -1) { ListItem li; li = ddlState.Items.FindByValue(r.StateID.ToString()); if (li != null) { ddlState.ClearSelection(); li.Selected = true; } } } private void FillJobTypes() { ddlJobType.DataSource = JobType.GetJobTypes(); ddlJobType.DataTextField = "JobTypeName"; ddlJobType.DataValueField = "JobTypeID"; ddlJobType.DataBind(); if (Profile.JobSeeker.ResumeID != -1) { ListItem li; li = ddlJobType.Items.FindByValue(r.JobTypeID.ToString()); if (li != null) {

61

ddlJobType.ClearSelection(); li.Selected = true; } } } private void FillEduLevels() { ddlEduLevel.DataSource = EducationLevel.GetEducationLevels(); ddlEduLevel.DataTextField = "EducationLevelName"; ddlEduLevel.DataValueField = "EducationLevelID"; ddlEduLevel.DataBind(); if (Profile.JobSeeker.ResumeID != -1) { ListItem li; li = ddlEduLevel.Items.FindByValue(r.EducationLevelID.ToString()); if (li != null) { ddlEduLevel.ClearSelection(); li.Selected = true; } } } private void FillExpLevels() { ddlExpLevel.DataSource = ExperienceLevel.GetExperienceLevels(); ddlExpLevel.DataTextField = "ExperienceLevelName"; ddlExpLevel.DataValueField = "ExperienceLevelID"; ddlExpLevel.DataBind(); if (Profile.JobSeeker.ResumeID != -1) { ListItem li; li = ddlExpLevel.Items.FindByValue(r.ExperienceLevelID.ToString());

62

if (li != null) { ddlExpLevel.ClearSelection(); li.Selected = true; } } }

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { FillStates(); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Resume r = new Resume(); r.City = txtCity.Text; r.CountryID = int.Parse(ddlCountry.SelectedValue); r.CoveringLetterText = txtCoveringLetter.Text; r.EducationLevelID = int.Parse(ddlEduLevel.SelectedValue); r.ExperienceLevelID = int.Parse(ddlExpLevel.SelectedValue); r.JobTitle = txtJobTitle.Text; r.JobTypeID = int.Parse(ddlJobType.SelectedValue); r.RelocationCountryID = int.Parse(ddlRelocationCountry.SelectedValue); r.ResumeText = txtResume.Text; r.StateID = int.Parse(ddlState.SelectedValue); r.UserName = Profile.UserName; r.PostedDate = DateTime.Now; if (Profile.JobSeeker.ResumeID != -1) { r.ResumeID = Profile.JobSeeker.ResumeID; Resume.Update(r); } else {

63

int retval = Resume.Insert(r); Profile.JobSeeker.ResumeID = retval; } lblMsg.Text = "Your resume is successfully updated!"; } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { Response.Redirect("~/default.aspx"); } }

64

18.7 Example of viewjobposting.aspx (UI Code) for Jobseekers

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="viewjobposting.aspx.cs" Inherits="viewjobposting_aspx" Title="Untitled Page" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div style="text-align: center"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="View Job Posting" SkinID="FormHeading"></asp:Label> </div> <br /> <table style="width: 100%" cellpadding="3"> <tr> <td align="left" width="20%" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label16" runat="server" Text="Contact Details" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label1" runat="server" Text="Company :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblCompany" runat="server" Text="Label"></asp:Label> <asp:LinkButton ID="btnViewProfile" runat="server">[View Profile]</asp:LinkButton> </td>

65

</tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label2" runat="server" Text="Contact Person :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblContactPerson" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="left" width="20%" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label17" runat="server" Text="Job Details" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label3" runat="server" Text="Job Title :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblTitle" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap valign="top"> <asp:Label ID="Label13" runat="server" Text="Description :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblDesc" runat="server" Text="Label"></asp:Label> </td> </tr>

66

<tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label9" runat="server" Text="Job Type :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblJobType" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label4" runat="server" Text="Department :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblDept" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label5" runat="server" Text="Job Code :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblJobCode" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label10" runat="server" Text="Education Level :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblEduLevel" runat="server" Text="Label"></asp:Label>

67

</td> </tr> <tr> <td align="left" width="20%" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label18" runat="server" Text="Location" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label6" runat="server" Text="City :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblCity" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label7" runat="server" Text="State :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblState" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label8" runat="server" Text="Country :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblCountry" runat="server" Text="Label"></asp:Label> </td>

68

</tr> <tr> <td align="left" width="20%" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label19" runat="server" Text="Salary Details" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label11" runat="server" Text="Min. Salary :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblMinSal" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label12" runat="server" Text="Max. Salary :" SkinID="FormLabel"></asp:Label> </td> <td align="left"> <asp:Label ID="lblMaxSal" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="right" width="20%"> </td> <td align="left"> </td> </tr> <tr> <td align="right" width="20%" nowrap> <asp:Label ID="Label15" runat="server" Text="Posting Date :" SkinID="FormLabel"></asp:Label>

69

</td> <td align="left"> <asp:Label ID="lblPostDt" runat="server" Text="Label"></asp:Label> </td> </tr> <tr> <td align="center" width="20%" nowrap colspan="2"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/BackButton.gif" OnClick="ImageButton1_Click" /> &nbsp;&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/MyFavorite.gif" OnClick="ImageButton2_Click" /> </td> </tr> </table> <br /> <br /> <br /> <div align="left"> <asp:Panel ID="Panel1" runat="server" SkinID="CompanyProfilePanel"> <asp:Label ID="Label20" runat="server" Text=""></asp:Label> <br /> <div align="right" width="100%"> <asp:LinkButton ID="LinkButton1" runat="server" FontBold="True">Close</asp:LinkButton> </div> </asp:Panel> </div> <br /> <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnViewProfile" PopupControlID="Panel1" DynamicControlID="Label20" DynamicServicePath='<%# Page.ResolveClientUrl("~/WebService.asmx") %>' DynamicServiceMethod="GetCompanyProfile" OkControlID="LinkButton1">

70

</cc1:ModalPopupExtender> <br /> <br /> </div> </asp:Content>

71

18.8 Example of viewjobposting.aspx.cs (Code Behind) for Jobseekers

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; public partial class viewjobposting_aspx : Page { protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { int postingid; postingid = int.Parse(Request.QueryString["id"]); JobPosting p = JobPosting.GetPosting(postingid); lblCity.Text = p.City; lblCompany.Text = Company.GetCompanyName(p.CompanyID); btnViewProfile.CommandArgument = p.CompanyID.ToString(); ModalPopupExtender1.DynamicContextKey = p.CompanyID.ToString(); lblContactPerson.Text = p.ContactPerson;

72

lblCountry.Text = Country.GetCountryName(p.CountryID); lblDept.Text = p.Department; lblDesc.Text = p.Description.Replace("\r\n", "<br>"); lblEduLevel.Text = EducationLevel.GetEducationLevelName(p.EducationLevelID); lblJobCode.Text = p.JobCode; lblJobType.Text = JobType.GetJobTypeName(p.JobTypeID); lblMaxSal.Text = p.MaxSalary.ToString("C"); lblMinSal.Text = p.MinSalary.ToString("C"); lblPostDt.Text = p.PostingDate.ToShortDateString(); lblState.Text = State.GetStateName(p.StateID); lblTitle.Text = p.Title; } Page.DataBind(); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.Redirect("~/jobseeker/jobsearch.aspx"); } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { MyJob j = new MyJob(); j.PostingID = int.Parse(Request.QueryString["id"]); j.UserName = Profile.UserName; MyJob.Insert(j); } }

18.9

Example of AddEditPosting.aspx (UI Code) for Employer

<%@ Page Language="C#" CodeFile="AddEditPosting.aspx.cs" Inherits="AddEditPosting_aspx"

73

MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div style="text-align: center"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="Add / Edit Job Posting" SkinID="FormHeading"></asp:Label> </div> <br /> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/employer/jobpostings.aspx" ImageUrl="~/Images/JobPostings.gif"></asp:HyperLink><br /> <asp:Label ID="Label6" runat="server" Text="(All the fields are mandatory)"></asp:Label> <br /> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="5" DataKeyNames="JobPostingID" DataSourceID="ObjectDataSource1" GridLines="None" HorizontalAlign="Center" OnDataBound="DetailsView1_DataBound" OnItemDeleted="DetailsView1_ItemDeleted" OnItemInserting="DetailsView1_ItemInserting" OnItemUpdating="DetailsView1_ItemUpdating" Width="100%"> <RowStyle HorizontalAlign="Left" /> <FieldHeaderStyle HorizontalAlign="Right" Wrap="false" /> <Fields> <asp:BoundField DataField="JobPostingID" HeaderText="Job Posting ID :" InsertVisible="False" ReadOnly="True" SortExpression="JobPostingID"> <HeaderStyle CssClass="dataentryformlabel" Wrap="False" /> <ItemStyle CssClass="dataentryformlabel" Wrap="False" />

74

</asp:BoundField> <asp:BoundField DataField="Title" HeaderText="Title :" SortExpression="Title"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:TemplateField HeaderText="Contact Person :" SortExpression="ContactPerson"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ContactPerson") %>'> </asp:TextBox></EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ContactPerson") %>'> </asp:TextBox></InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label6" runat="server" Text='<%# Bind("ContactPerson") %>'></asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" Wrap="False" /> <ItemStyle Wrap="False" /> </asp:TemplateField> <asp:BoundField DataField="Department" HeaderText="Department :" SortExpression="Department"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:BoundField DataField="JobCode" HeaderText="Job Code :" SortExpression="JobCode"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:TemplateField HeaderText="Country :" SortExpression="CountryID"> <EditItemTemplate> &nbsp;<asp:DropDownList ID="ddlCountryUpdate" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource3" DataTextField="CountryName" DataValueField="CountryID" OnSelectedIndexChanged="ddlCountryUpdate_SelectedIndexChanged" SelectedValue='<%# Bind("CountryID") %>'>

75

</asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> &nbsp;<asp:DropDownList ID="ddlCountryInsert" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource3" DataTextField="CountryName" DataValueField="CountryID" OnSelectedIndexChanged="ddlCountryInsert_SelectedIndexChanged" SelectedValue='<%# Bind("CountryID") %>'> </asp:DropDownList> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# JobSiteStarterKit.BOL.Country.GetCountryName((int)Eval("CountryID")) %>'> </asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" /> </asp:TemplateField> <asp:TemplateField HeaderText="State :" SortExpression="StateID"> <EditItemTemplate> <asp:DropDownList ID="ddlStateUpdate" runat="server" DataSourceID="ObjectDataSource2" DataTextField="StateName" DataValueField="StateID"> </asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> <asp:DropDownList ID="ddlStateInsert" runat="server" DataSourceID="ObjectDataSource2" DataTextField="StateName" DataValueField="StateID"> </asp:DropDownList> </InsertItemTemplate> <ItemTemplate>

76

<asp:Label ID="Label1" runat="server" Text='<%# JobSiteStarterKit.BOL.State.GetStateName((int)Eval("StateID")) %>'> </asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" /> </asp:TemplateField> <asp:BoundField DataField="City" HeaderText="City :" SortExpression="City"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:TemplateField HeaderText="Education Level :" SortExpression="EducationLevelID"> <EditItemTemplate> &nbsp;<asp:DropDownList ID="ddlEduLevelUpdate" runat="server" DataSourceID="ObjectDataSource4" DataTextField="EducationLevelName" DataValueField="EducationLevelID" SelectedValue='<%# Bind("EducationLevelID") %>'> </asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> &nbsp;<asp:DropDownList ID="ddlEduLevelInsert" runat="server" DataSourceID="ObjectDataSource4" DataTextField="EducationLevelName" DataValueField="EducationLevelID" SelectedValue='<%# Bind("EducationLevelID") %>'> </asp:DropDownList> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# JobSiteStarterKit.BOL.EducationLevel.GetEducationLevelName((int)Eval("Educati onLevelID")) %>'> </asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" Wrap="False" /> <ItemStyle Wrap="False" /> </asp:TemplateField> <asp:TemplateField HeaderText="Job Type :" SortExpression="JobTypeID">

77

<EditItemTemplate> &nbsp;<asp:DropDownList ID="ddlJobTypeUpdate" runat="server" DataSourceID="ObjectDataSource5" DataTextField="JobTypeName" DataValueField="JobTypeID" SelectedValue='<%# Bind("JobTypeID") %>'> </asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> &nbsp;<asp:DropDownList ID="ddlJobTypeInsert" runat="server" DataSourceID="ObjectDataSource5" DataTextField="JobTypeName" DataValueField="JobTypeID" SelectedValue='<%# Bind("JobTypeID") %>'> </asp:DropDownList> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label4" runat="server" Text='<%# JobSiteStarterKit.BOL.JobType.GetJobTypeName((int)Eval("JobTypeID")) %>'> </asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" /> </asp:TemplateField> <asp:BoundField DataField="MinSalary" HeaderText="Min Salary :" SortExpression="MinSalary"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:BoundField DataField="MaxSalary" HeaderText="Max Salary :" SortExpression="MaxSalary"> <HeaderStyle CssClass="dataentryformlabel" /> </asp:BoundField> <asp:TemplateField HeaderText="Description :" SortExpression="Description"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Rows="5" Text='<%# Bind("Description") %>' TextMode="MultiLine" Width="98%"> </asp:TextBox></EditItemTemplate> <InsertItemTemplate>

78

<asp:TextBox ID="TextBox1" runat="server" Rows="5" Text='<%# Bind("Description") %>' TextMode="MultiLine"> </asp:TextBox></InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label5" runat="server" Text='<%# (Server.HtmlEncode(Eval("Description").ToString())).Replace("\r\n","<br>") %>'></asp:Label></ItemTemplate> <HeaderStyle CssClass="dataentryformlabel" VerticalAlign="Top" /> </asp:TemplateField> <asp:CommandField ButtonType="Image" ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" CancelImageUrl="~/Images/CancelButton.gif" DeleteImageUrl="~/Images/DeleteButton.gif" EditImageUrl="~/Images/EditButton.gif" InsertImageUrl="~/Images/SaveButton.gif" NewImageUrl="~/Images/AddButton.gif" UpdateImageUrl="~/Images/SaveButton.gif"> <ControlStyle CssClass="dataentryformbutton" /> <FooterStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </asp:CommandField> </Fields> <HeaderStyle HorizontalAlign="Right" /> <InsertRowStyle HorizontalAlign="Left" /> <EditRowStyle HorizontalAlign="Left" /> </asp:DetailsView> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/progress.gif" /> </ProgressTemplate>

79

</asp:UpdateProgress> <br /> <br /> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/employer/jobpostings.aspx">Go to Listing Page</asp:HyperLink> <br /> <br /> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="JobSiteStarterKit.BOL.JobPosting" DeleteMethod="Delete" InsertMethod="Insert" SelectMethod="GetPosting" UpdateMethod="Update" DataObjectTypeName="JobSiteStarterKit.BOL.JobPosting"> <DeleteParameters> <asp:Parameter Name="original_JobPostingID" Type="Int32" /> </DeleteParameters> <SelectParameters> <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32"></asp:QueryStringParameter> </SelectParameters> </asp:ObjectDataSource> <br /> <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="JobSiteStarterKit.BOL.State" SelectMethod="GetStates"> <SelectParameters> <asp:Parameter Type="Int32" Name="countryid"></asp:Parameter> </SelectParameters> </asp:ObjectDataSource> <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" TypeName="JobSiteStarterKit.BOL.Country" SelectMethod="SelectCountries"></asp:ObjectDataSource> <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" SelectMethod="GetEducationLevels" TypeName="JobSiteStarterKit.BOL.EducationLevel"></asp:ObjectDataSource> <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" SelectMethod="GetJobTypes" TypeName="JobSiteStarterKit.BOL.JobType"></asp:ObjectDataSource>

80

</div> </asp:Content>

18.10 Example of AddEditPosting.aspx.cs (Code Behind) for Employer


using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; public partial class AddEditPosting_aspx : Page { protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { if (Company.GetCompany(User.Identity.Name) == null) { Response.Redirect("~/customerrorpages/profilenotfound.aspx"); } if (Request.QueryString["id"] == null) { DetailsView1.DefaultMode = DetailsViewMode.Insert; } else

81

{ DetailsView1.DefaultMode = DetailsViewMode.ReadOnly; } } } protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e) { DropDownList ddl; ddl = (DropDownList)DetailsView1.FindControl("ddlStateInsert"); e.Values["StateID"] = ddl.SelectedValue; ddl = (DropDownList)DetailsView1.FindControl("ddlCountryInsert"); e.Values["CountryID"] = ddl.SelectedValue; ddl = (DropDownList)DetailsView1.FindControl("ddlEduLevelInsert"); e.Values["EducationLevelID"] = ddl.SelectedValue; ddl = (DropDownList)DetailsView1.FindControl("ddlJobTypeInsert"); e.Values["JobTypeID"] = ddl.SelectedValue; e.Values["PostedBy"] = Profile.UserName; e.Values["CompanyID"] = Profile.Employer.CompanyID.ToString(); e.Values["PostingDate"] = DateTime.Today.ToString("MM/dd/yyyy"); } protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e) { DropDownList ddl; ddl = (DropDownList)DetailsView1.FindControl("ddlStateUpdate"); e.NewValues["StateID"] = ddl.SelectedValue; ddl = (DropDownList)DetailsView1.FindControl("ddlCountryUpdate"); e.NewValues["CountryID"] = ddl.SelectedValue;

82

ddl = (DropDownList)DetailsView1.FindControl("ddlEduLevelUpdate"); e.NewValues["EducationLevelID"] = ddl.SelectedValue; ddl = (DropDownList)DetailsView1.FindControl("ddlJobTypeUpdate"); e.NewValues["JobTypeID"] = ddl.SelectedValue; e.NewValues["PostedBy"] = Profile.UserName; e.NewValues["CompanyID"] = Profile.Employer.CompanyID.ToString(); e.NewValues["PostingDate"] = DateTime.Today.ToString("MM/dd/yyyy"); } protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e) { Response.Redirect("~/employer/jobpostings.aspx"); } protected void ddlCountryUpdate_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl; ddl = (DropDownList)sender; ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; ObjectDataSource2.Select(); } protected void ddlCountryInsert_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl; ddl = (DropDownList)sender; ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; ObjectDataSource2.Select(); }

83

protected void DetailsView1_DataBound(object sender, EventArgs e) { DropDownList ddl; ddl = (DropDownList)DetailsView1.FindControl("ddlCountryUpdate"); if (ddl != null) { ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; ObjectDataSource2.Select(); } }

18.11

Example of companyprofile.aspx (UI Code) for Employer

<%@ Page Language="C#" CodeFile="companyprofile.aspx.cs" Inherits="companyprofile_aspx" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label13" runat="server" Text="Modify Your Company Profile" SkinID="formheading"></asp:Label> </div> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table style="width: 100%"> <tr> <td valign="top" align="left" colspan="2" class="dataentryformlabelbig">

84

<asp:Label ID="Label14" runat="server" Text="Introduce Your Company" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label1" runat="server" Text="Company Name :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtCompanyName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter company name" ControlToValidate="txtCompanyName" Display="Dynamic"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label12" runat="server" Text="Brief Profile :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtProfile" runat="server" Width="100%" Rows="5" TextMode="MultiLine"></asp:TextBox> </td> </tr> <tr> <td valign="top" align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label15" runat="server" Text="Location" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr>

85

<td valign="top" align="right" width="40%"> <asp:Label ID="Label2" runat="server" Text="Address 1 :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtAddress1" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please enter address" ControlToValidate="txtAddress1" Display="Dynamic"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label3" runat="server" Text="Address 2 :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtAddress2" runat="server"></asp:TextBox> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label4" runat="server" Text="City :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtCity" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please enter city" ControlToValidate="txtCity" Display="Dynamic"> *</asp:RequiredFieldValidator> </td>

86

</tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label6" runat="server" Text="Country :"></asp:Label> </td> <td align="left" width="60%"> &nbsp;<asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label5" runat="server" Text="State :"></asp:Label> </td> <td align="left" width="60%"> &nbsp;<asp:DropDownList ID="ddlState" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label7" runat="server" Text="ZIP :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtZIP" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please enter ZIP code" ControlToValidate="txtZIP" Display="Dynamic"> *</asp:RequiredFieldValidator>

87

<%-- <asp:RegularExpressionValidator ID="RegularExpressionValidator1" Runat="server" ErrorMessage="Please enter valid ZIP code" ValidationExpression="\d{5}(-\d{4})?" ControlToValidate="txtZIP" Display="Dynamic"> *</asp:RegularExpressionValidator>--%> </td> </tr> <tr> <td valign="top" align="left" colspan="2" class="dataentryformlabelbig"> <asp:Label ID="Label16" runat="server" Text="Contact Details" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label8" runat="server" Text="Phone :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox><br /> <asp:Label ID="Label17" runat="server" Text="(e.g. 111-111-1111)"></asp:Label> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Please enter valid phone number" ValidationExpression="((\(\d{3}\) ?)|(\d{3}))?\d{3}-\d{4}" ControlToValidate="txtPhone" Display="Dynamic"> *</asp:RegularExpressionValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Please enter phone number" ControlToValidate="txtProfile" Display="Dynamic"> *</asp:RequiredFieldValidator> </td>

88

</tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label9" runat="server" Text="Fax :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtFax" runat="server"></asp:TextBox> <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="Please enter valid Fax number" ValidationExpression="((\(\d{3}\) ?)|(\d{3}))?\d{3}-\d{4}" ControlToValidate="txtFax" Display="Dynamic"> *</asp:RegularExpressionValidator> </td> </tr> <tr> <td valign="top" align="right" width="40%"> <asp:Label ID="Label10" runat="server" Text="Email :"></asp:Label> </td> <td align="left" width="60%"> <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Please enter email address" ControlToValidate="txtEmail" Display="Dynamic"> *</asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="Please enter valid email address" ValidationExpression="\w+([-+.']\w+)*@\w+([.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtEmail" Display="Dynamic"> *</asp:RegularExpressionValidator>

89

</td> </tr> <tr> <td style="height: 26px;" valign="top" align="right" width="40%"> <asp:Label ID="Label11" runat="server" Text="Web Site :"></asp:Label> </td> <td style="height: 26px;" align="left" width="60%"> <asp:TextBox ID="txtWebSiteUrl" runat="server"></asp:TextBox><br /> <asp:Label ID="Label18" runat="server" Text="(e.g. http://www.somedomain.com)"></asp:Label> <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ErrorMessage="Please enter valid web site URL" ValidationExpression="http(s)?://([\w-]+\.)+[\w]+(/[\w- ./?%&amp;=]*)?" ControlToValidate="txtWebSiteUrl" Display="Dynamic"> *</asp:RegularExpressionValidator> </td> </tr> <tr> <td valign="top" align="right" width="40%"> </td> <td align="left" width="60%"> &nbsp; </td> </tr> <tr> <td valign="top" align="center" colspan="2" width="40%"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/SaveButton.gif" OnClick="ImageButton1_Click" /> &nbsp; <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/CancelButton.gif" OnClick="ImageButton2_Click" />

90

</td> </tr> <tr> <td align="center" colspan="2" valign="top" width="40%"> <asp:Label ID="lblMsg" runat="server" SkinID="FormLabel"></asp:Label> </td> </tr> <tr> <td valign="top" align="center" width="40%" colspan="2"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> <br /> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <center> <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Progress.gif" /> </center> </ProgressTemplate> </asp:UpdateProgress> </asp:Content>

18.12

Example of companyprofile.aspx.cs (Code Behind) for Employer

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI;

91

using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL;

public partial class companyprofile_aspx : Page { protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { ddlCountry.DataSource = Country.GetCountries(); ddlCountry.DataTextField = "CountryName"; ddlCountry.DataValueField = "CountryID"; ddlCountry.DataBind();

Company objCompany = Company.GetCompany(Profile.UserName); if (objCompany != null) { ListItem li; txtCompanyName.Text = objCompany.CompanyName; txtAddress1.Text = objCompany.Address1; txtAddress2.Text = objCompany.Address2; txtCity.Text = objCompany.City; li = ddlState.Items.FindByValue(objCompany.StateID.ToString()); if (li != null) { ddlState.ClearSelection(); li.Selected = true;

92

} li = ddlCountry.Items.FindByValue(objCompany.CountryID.ToString()); if (li != null) { ddlCountry.ClearSelection(); li.Selected = true; ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue)); ddlState.DataTextField = "StateName"; ddlState.DataValueField = "StateID"; ddlState.DataBind(); li = ddlState.Items.FindByValue(objCompany.StateID.ToString()); if (li != null) { ddlState.ClearSelection(); li.Selected = true; } } txtZIP.Text = objCompany.ZIP; txtPhone.Text = objCompany.Phone; txtFax.Text = objCompany.Fax; txtEmail.Text = objCompany.Email; txtWebSiteUrl.Text = objCompany.WebSiteUrl; txtProfile.Text = objCompany.BriefProfile; } } } protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue)); ddlState.DataTextField = "StateName"; ddlState.DataValueField = "StateID";

93

ddlState.DataBind(); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Company objCompany = new Company(); objCompany.CompanyName = txtCompanyName.Text; objCompany.Address1 = txtAddress1.Text; objCompany.Address2 = txtAddress2.Text; objCompany.City = txtCity.Text; objCompany.StateID = int.Parse(ddlState.SelectedValue); objCompany.CountryID = int.Parse(ddlCountry.SelectedValue); objCompany.ZIP = txtZIP.Text; objCompany.Phone = txtPhone.Text; objCompany.Fax = txtFax.Text; objCompany.Email = txtEmail.Text; objCompany.WebSiteUrl = txtWebSiteUrl.Text; objCompany.BriefProfile = txtProfile.Text; objCompany.UserName = Profile.UserName; if (Profile.Employer.CompanyID != -1) { objCompany.CompanyID = (int)Profile.Employer.CompanyID; Company.Update(objCompany); } else { int i = Company.Insert(objCompany); Profile.Employer.CompanyID = i; } lblMsg.Text = "Your company profile is updated!"; } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { Response.Redirect("~/default.aspx"); } }

94

18.13

Example of jobpostings.aspx (UI Code) for Employer

<%@ Page Language="C#" CodeFile="jobpostings.aspx.cs" Inherits="postinglist_aspx" MasterPageFile="~/MasterPage.master" %> <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="List of Job Postings" SkinID="FormHeading"></asp:Label> <br /> <br /> <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/Images/AddJobPosting.gif" NavigateUrl="~/employer/AddEditPosting.aspx">HyperLink</asp:HyperLink> <br /> </div> <br /> <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="PostingID" Width="100%"> <Columns> <asp:BoundField HeaderText="Title" DataField="Title"></asp:BoundField> <asp:BoundField HeaderText="Job Code" DataField="JobCode"></asp:BoundField> <asp:BoundField HeaderText="Location" DataField="City"></asp:BoundField>

95

<asp:BoundField HeaderText="Posted On" DataField="PostingDate" DataFormatString="{0:MM/dd/yyyy}"> </asp:BoundField> <asp:ButtonField ButtonType="Image" ImageUrl="~/Images/ShowDetails.gif"> <ItemStyle Wrap="False"></ItemStyle> </asp:ButtonField> </Columns> </asp:GridView> <br /> &nbsp;<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="JobSiteStarterKit.BOL.JobPosting" DeleteMethod="Delete" InsertMethod="Insert" SelectMethod="GetPostings" UpdateMethod="Update" DataObjectTypeName="JobSiteStarterKit.BOL.JobPosting"> <DeleteParameters> <asp:Parameter Type="Int32" Name="id"></asp:Parameter> </DeleteParameters> <UpdateParameters> <asp:Parameter Type="Int32" Name="JobPostingID"></asp:Parameter> <asp:Parameter Type="Int32" Name="CompanyID"></asp:Parameter> <asp:Parameter Type="String" Name="ContactPerson"></asp:Parameter> <asp:Parameter Type="String" Name="Title"></asp:Parameter> <asp:Parameter Type="String" Name="Department"></asp:Parameter> <asp:Parameter Type="String" Name="JobCode"></asp:Parameter> <asp:Parameter Type="String" Name="City"></asp:Parameter> <asp:Parameter Type="Int32" Name="StateID"></asp:Parameter> <asp:Parameter Type="Int32" Name="CountryID"></asp:Parameter> <asp:Parameter Type="Int32" Name="EducationLevelID"></asp:Parameter> <asp:Parameter Type="Int32" Name="JobTypeID"></asp:Parameter> <asp:Parameter Type="Decimal" Name="MinSalary"></asp:Parameter> <asp:Parameter Type="Decimal" Name="MaxSalary"></asp:Parameter> <asp:Parameter Type="String" Name="Description"></asp:Parameter> <asp:Parameter Type="DateTime" Name="PostingDate"></asp:Parameter> <asp:Parameter Type="String" Name="PostedBy"></asp:Parameter>

96

</UpdateParameters> <SelectParameters> <asp:ProfileParameter Name="username" Type="String" PropertyName="UserName"></asp:ProfileParameter> </SelectParameters> <InsertParameters> <asp:Parameter Type="Int32" Name="JobPostingID"></asp:Parameter> <asp:Parameter Type="Int32" Name="CompanyID"></asp:Parameter> <asp:Parameter Type="String" Name="ContactPerson"></asp:Parameter> <asp:Parameter Type="String" Name="Title"></asp:Parameter> <asp:Parameter Type="String" Name="Department"></asp:Parameter> <asp:Parameter Type="String" Name="JobCode"></asp:Parameter> <asp:Parameter Type="String" Name="City"></asp:Parameter> <asp:Parameter Type="Int32" Name="StateID"></asp:Parameter> <asp:Parameter Type="Int32" Name="CountryID"></asp:Parameter> <asp:Parameter Type="Int32" Name="EducationLevelID"></asp:Parameter> <asp:Parameter Type="Int32" Name="JobTypeID"></asp:Parameter> <asp:Parameter Type="Decimal" Name="MinSalary"></asp:Parameter> <asp:Parameter Type="Decimal" Name="MaxSalary"></asp:Parameter> <asp:Parameter Type="String" Name="Description"></asp:Parameter> <asp:Parameter Type="DateTime" Name="PostingDate"></asp:Parameter> <asp:Parameter Type="String" Name="PostedBy"></asp:Parameter> </InsertParameters> </asp:ObjectDataSource> </asp:Content>

18.14

Example of jobpostings.aspx.cs (Code Behind) for Employer

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI;

97

using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class postinglist_aspx : Page { protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "edit") { Response.Redirect("~/employer/addeditposting.aspx?id=" + e.CommandArgument); } } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton b = (ImageButton)e.Row.Cells[4].Controls[0]; b.CommandName = "edit"; b.CommandArgument = GridView1.DataKeys[e.Row.RowIndex].Value.ToString(); } }

98

18.15

Example of MyFavorites.aspx (UI Code) for Employer

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="MyFavorites.aspx.cs" Inherits="MyFavorites_aspx" Title="Untitled Page" %> <%@ Register Src="../UserControls/DisplayModeController.ascx" TagName="DisplayModeController" TagPrefix="uc4" %> <%@ Register Src="../UserControls/MyJobs.ascx" TagName="MyJobs" TagPrefix="uc3" %> <%@ Register Src="../UserControls/MySearches.ascx" TagName="MySearches" TagPrefix="uc2" %> <%@ Register TagPrefix="uc1" TagName="MyResumes" Src="../UserControls/MyResumes.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" SkinID="FormHeading" Text="My Favorites"></asp:Label> <br /> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> <br /> <uc4:DisplayModeController ID="DisplayModeController1" runat="server" /> <br /> <asp:CatalogZone ID="CatalogZone1" runat="server" HeaderText="" VerbButtonType="Link"> <ZoneTemplate> <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" Title="Available Web Parts" /> </ZoneTemplate> </asp:CatalogZone> </div>

99

<br /> <table style="width: 100%"> <tr> <td style="width: 100%"> <asp:WebPartZone HeaderText="My Resumes" ID="WebPartZone1" runat="server" WebPartVerbRenderMode="TitleBar" ShowTitleIcons="False" Width="100%"> <MinimizeVerb Text="Collapse" ImageUrl="~/Images/CollapseButton.gif" /> <RestoreVerb Text="Expand" ImageUrl="~/Images/ExpandButton.gif" /> <CloseVerb ImageUrl="~/Images/CloseButton.gif" /> <ZoneTemplate> <uc1:MyResumes ID="MyResumes1" runat="server" title="My Resumes" /> </ZoneTemplate> </asp:WebPartZone> </td> </tr> </table> <br /> <br /> </asp:Content>

18.16

Example of MyFavorites.aspx.cs (Code Behind) for Employer

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class MyFavorites_aspx : Page

100

{ protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } } }

18.17

Example of resumesearch.aspx (UI Code) for Employer

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="resumesearch.aspx.cs" Inherits="resumesearch_aspx" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="Search Resume Database" SkinID="FormHeading"></asp:Label> <br /> <asp:Label ID="lblResumeCount" runat="server" SkinID="Slogan"></asp:Label> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table style="width: 100%"> <tr> <td align="right" valign="top" width="40%"> <asp:Label ID="Label1" runat="server" Text="Skills :"></asp:Label> </td> <td align="left" style="width: 100px"> <asp:TextBox ID="txtSkills" runat="server"></asp:TextBox>

101

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSkills" Display="Dynamic" ErrorMessage="Please enter skills to search for"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label3" runat="server" Text="Country :"></asp:Label> </td> <td align="left" style="width: 100px"> <asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label4" runat="server" Text="State :"></asp:Label> </td> <td align="left" style="width: 100px"> <asp:DropDownList ID="ddlState" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlState_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td align="right" valign="top"> <asp:Label ID="Label2" runat="server" Text="City :"></asp:Label> </td> <td align="left" style="width: 100px"> <asp:TextBox ID="txtCity" runat="server" Enabled="False"></asp:TextBox> </td> </tr>

102

<tr> <td align="center" colspan="2" valign="top"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/SearchButton.gif" OnClick="ImageButton1_Click" /> </td> </tr> <tr> <td align="center" colspan="2" valign="top"> <asp:Label ID="lblMsg" runat="server" SkinID="FormLabel"></asp:Label> </td> </tr> <tr> <td align="left" colspan="2" valign="top"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/progress.gif" /></ProgressTemplate> </asp:UpdateProgress> <br /> </div> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="ResumeID" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCommand="GridView1_RowCommand"

103

OnRowDataBound="GridView1_RowDataBound" Width="100%"> <Columns> <asp:BoundField DataField="JobTitle" HeaderText="Title"></asp:BoundField> <asp:BoundField DataField="educationlevelid" HeaderText="Education" ShowHeader="False"> </asp:BoundField> <asp:BoundField DataField="experiencelevelid" HeaderText="Experience"></asp:BoundField> <asp:BoundField DataField="TargetCity" HeaderText="Location"></asp:BoundField> <asp:ButtonField CommandName="viewdetails" ButtonType="Image" ImageUrl="~/Images/ShowDetails.gif"> </asp:ButtonField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> <br /> <br /> </asp:Content>

18.18

Example of resumesearch.aspx.cs (Code Behind) for Employer

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; public partial class resumesearch_aspx : Page {

104

private void BindGrid() { int countryid = -1, stateid = -1; if (ddlCountry.SelectedItem != null) countryid = int.Parse(ddlCountry.SelectedValue); if (ddlState.SelectedItem != null) stateid = int.Parse(ddlState.SelectedValue); DataSet ds = Resume.SearchResumes(txtSkills.Text, countryid, stateid, txtCity.Text); GridView1.DataSource = ds; GridView1.DataBind(); if (GridView1.Rows.Count <= 0) { lblMsg.Text = "No records found!"; } else { lblMsg.Text = ""; }

UpdatePanel2.Update(); } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton b = (ImageButton)e.Row.Cells[4].Controls[0]; b.CommandName = "viewdetails"; b.CommandArgument = GridView1.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Cells[1].Text = EducationLevel.GetEducationLevelName(int.Parse(e.Row.Cells[1].Text));

105

e.Row.Cells[2].Text = ExperienceLevel.GetExperienceLevelName(int.Parse(e.Row.Cells[2].Text)); } } protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } if (!Page.IsPostBack) { FillCountries(); FillStates(); lblResumeCount.Text = "(Currently we have " + Resume.GetResumeCount() + " resumes !!!)"; } } private void FillCountries() { ddlCountry.DataSource = Country.GetCountries(); ddlCountry.DataTextField = "CountryName"; ddlCountry.DataValueField = "CountryID"; ddlCountry.DataBind(); } private void FillStates() { ddlState.DataSource = State.GetStates(int.Parse(ddlCountry.SelectedValue)); ddlState.DataTextField = "StateName"; ddlState.DataValueField = "StateID"; ddlState.DataBind(); }

106

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { FillStates(); txtCity.Enabled = false; } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "viewdetails") { Response.Redirect("~/employer/viewresume.aspx?id=" + e.CommandArgument); } } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; BindGrid(); } protected void ddlState_SelectedIndexChanged(object sender, EventArgs e) { if (ddlState.SelectedIndex > 0) { txtCity.Enabled = true; } else { txtCity.Enabled = false; } } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { BindGrid();

107

} }

18.19

Example of viewresume.aspx (UI Code) for Employer

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="viewresume.aspx.cs" Inherits="viewresume_aspx" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div align="center"> <asp:Label ID="Label14" runat="server" Text="View Resume" SkinID="FormHeading"></asp:Label><br /> &nbsp;</div> <table width="100%"> <tr> <td> <asp:Label ID="lblName" runat="server" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="lblEducation" runat="server" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="lblExperience" runat="server" SkinID="FormGroupLabel"></asp:Label> </td> </tr> <tr> <td>

108

<asp:Label ID="lblCoveringLetter" runat="server" Width="100%"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="lblResume" runat="server" Width="100%"></asp:Label> </td> </tr> <tr> <td align="center"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/BackButton.gif" OnClick="ImageButton1_Click" /> &nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/MyFavorite.gif" OnClick="ImageButton2_Click" /> </td> </tr> </table> </asp:Content>

18.20

Example of viewresume.aspx.cs (Code Behind) for Employer

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using JobSiteStarterKit.BOL; using ASP;

109

public partial class viewresume_aspx : Page { protected void Page_Load(object sender, EventArgs e) { if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) { Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); } Resume r = Resume.GetResume(int.Parse(Request.QueryString["id"])); ProfileCommon p = Profile.GetProfile(r.UserName); lblName.Text = "Full Name : " + p.FirstName + " " + p.LastName; lblEducation.Text = "Education Level : " + EducationLevel.GetEducationLevelName(r.EducationLevelID); lblExperience.Text = "Experience Level : " + ExperienceLevel.GetExperienceLevelName(r.ExperienceLevelID); lblCoveringLetter.Text = r.CoveringLetterText.Replace("\r\n", "<br>"); lblResume.Text = r.ResumeText.Replace("\r\n", "<br>"); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.Redirect("~/employer/resumesearch.aspx"); } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { MyResume r = new MyResume(); r.ResumeID = int.Parse(Request.QueryString["id"]); r.UserName = Profile.UserName; MyResume.Insert(r); } }

110

19. Conclusion

In order to make the internal processes smooth and day to day jobs hassle free Jobs on the Net will have several report generation facilities.

Following are the proposed reports in Job Portal on the Net : List of Jobs. List of Resume. Add Resume to favourite.

Besides these several other reports may also get incorporated at a latter date.

111

20. Reference

During the analysis, design and development of the project the following books were required: Software Engineering A Practioners Approach By Roger S.Pressman An Introduction To Database Systems By Bipin C. Desai Beginning .NET 2005 By Thearon Willis, Jonathan Crossland, Richard D. Blair Beginning .NET Databases By Thearon Willis Visual Basic.NET Programming Black Book By Steven Holzner

112

You might also like