Human Resources Skills Application
The Human Resources Skills application is a sample application built on the ADO.NET Entity Framework. The application manages information about employee skills. The Visual Studio solution provided for this sample contains projects for both a Windows application and an ASP.NET application. The ASP.NET application uses the EntityDataSource control for data binding.
This sample is available on the Entity Framework Documentation Samples site on MSDN Code Gallery.
A human resources department may need to manage information about employee skills. The Human Resources Skills application helps users find information about the skills of employees or find employees with various skills.
The application specifies employee skills by using entities, and it relates the skills to employees using associations. Skills entities define properties for skill name and description. Another entity contains supplemental information about skills by including the URL for detailed information. An association connects the supplemental information with the skill it describes. References representing people who have worked with employees are also implemented as entities. The references are accessed through an association between employee entities and reference entities.
Conceptual schema definition language (CSDL)
Store schema definition language (SSDL)
Mapping specification language (MSL)
This sample uses the following features of the Entity Framework.
Entity SQL queries
Entity object data binding
Before running this sample, make sure the following software is installed:
Visual Studio 2010 containing the .NET Framework 4
SQL Server 2005 or 2008 Database Engine
- SQL Server Management Studio (optional)
Building the Sample
Use the following procedure to build the sample.
To build the Human Resources Skills sample application
In SQL Server Management Studio, navigate to the Scripts subfolder, open the HRSkillsScriptWithData.sql Transact SQL script file, and press F5 to execute the script.
This creates the HRSkills database.
Open the HRSkillsWinApp solution file in Visual Studio.
(Optional) If you created the HRSkills database in an instance of SQL Server other than the default instance on the local machine, specify the correct SQL Server instance by modifying the Data Source in the HRSkillsEntities connection string in the App.Config file of the HRSkillsWinApp project and the Web.config file of the HRSkillsOnline project.
Build the project.
Running the Sample
Use the following procedure to run the Windows version of the sample.
To run the Human Resources Skills Windows application
Ensure that the HRSkillsWinApp project is set as the startup project for the solution.
Run the application.
Click on one of the names in the Employees data grid. The skills associated with the employee will be displayed in the Skills data grid.
Click on one of the skills in the Skills data grid.
The brief description of the skill, URLs of detailed information, and employee references are displayed in the Skills/References text area.
To display skill information, click on one of the URLs in the Skills/References text area to activate Internet Explorer or the appropriate application, depending on the type of data at the UNC address.
To add a new employee, enter first name, last name, alias, and email address of employee in the New Employee group box, and click Submit Employee.
To add a new skill, click an employee in the Employees data grid; Enter a short name and description of the skill in the text boxes provided for this purpose. Click Submit Skill.
To add skill information corresponding to a skill, click a skill in the Skills data grid. In the URL/UNC text box, add a URL or UNC path to information that describes the skill. Click Submit Info.
To add an employee reference, click an employee in the Employees data grid. In the Add Reference group, enter first name, last name, position, and email address of the reference person. Click Submit Reference.
To find skills related to employees, add skills keywords separated by a space to the text box labeled Search on Skills or Keywords. Click Enter to search. Skills related to the keywords will be displayed in the Skills data grid. Click on a skill in the Skills data grid; the employee will be selected in the Employee data grid and skill information and references displayed in the Skills/References text area.
Searches are case sensitive.
To run the Human Resources Skills Web application
Ensure that the HRSkillsOnline project is set as the startup project for the solution.
Run the application.
When the Web browser opens, a data grid containing a list of all employees is displayed.
Click Select next to one of the names in the Employees data grid. The skills associated with the employee will be displayed in the Skills data grid, and the references will be displayed in a separate data grid.
Click Select next to one of the skills in the Skills data grid. This displays a list of links in the Additional Skills Info data grid.
To display skill information, click on one of the URLs in the Additional Skills Info data grid.
This sample runs in the development server on the local machine. To configure this application in Internet Information Services (IIS), see the IIS documentation.
Removing the Sample
Use the following procedure to remove the Human Resources Skills sample.
To remove the Human Resources Skills sample Web application
Delete the project directory and contents.
Drop the HR Skills database from the instance of SQL Server.