Export (0) Print
Expand All

Human Resources Skills Application

.NET Framework 4

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.

Scenario

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.

Languages

  • Conceptual schema definition language (CSDL)

  • Store schema definition language (SSDL)

  • Mapping specification language (MSL)

  • C#

  • Entity SQL

Features

This sample uses the following features of the Entity Framework.

  • Entity SQL queries

  • Entity object data binding

  • EntityDataSource control

Prerequisites

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

  1. 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.

  2. Open the HRSkillsWinApp solution file in Visual Studio.

  3. (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.

  4. 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

  1. Ensure that the HRSkillsWinApp project is set as the startup project for the solution.

  2. Run the application.

  3. 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.

  4. Click on one of the skills in the Skills data grid.

  5. The brief description of the skill, URLs of detailed information, and employee references are displayed in the Skills/References text area.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. 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.

    Ee620621.note(en-us,VS.100).gifNote:
    Searches are case sensitive.

To run the Human Resources Skills Web application

  1. Ensure that the HRSkillsOnline project is set as the startup project for the solution.

  2. Run the application.

  3. When the Web browser opens, a data grid containing a list of all employees is displayed.

  4. 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.

  5. 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.

  6. To display skill information, click on one of the URLs in the Additional Skills Info data grid.

Ee620621.note(en-us,VS.100).gifNote:
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

  1. Delete the project directory and contents.

  2. Drop the HR Skills database from the instance of SQL Server.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft