/// <summary>
 /// Updates employee with data from the web form
 /// </summary>
 /// <param name="employeeToUpdate">employee entity from db</param>
 /// <param name="employeeForm">data entered on web form</param>
 public void UpdateEmployee(Employee employeeToUpdate, EmployeeForm employeeForm)
 {
     employeeToUpdate.FirstName = employeeForm.FirstName;
     employeeToUpdate.LastName = employeeForm.LastName;
     employeeToUpdate.BirthDate = employeeForm.BirthDate;
     employeeToUpdate.Address.City = employeeForm.City;
     employeeToUpdate.Address.Country = employeeForm.County;
     employeeToUpdate.Sex = employeeForm.Sex;
     employeeToUpdate.Address.Street = employeeForm.Street;
     employeeToUpdate.Address.ZipCode = employeeForm.ZipCode;
 }
        /// <summary>
        /// Construct new employee out of form data
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public Employee ConstructEmployee(EmployeeForm form)
        {
            var e = new Employee
            {
                FirstName = form.FirstName,
                LastName = form.LastName,
                BirthDate = form.BirthDate,
                Sex = form.Sex,
                Id = form.EmployeeId,
            };
            e.Address.City = form.City;
            e.Address.Country = form.City;
            e.Address.Street = form.Street;
            e.Address.ZipCode = form.ZipCode;
            e.Managers = form.ManagerId;

            return e;
        }
 /// <summary>
 /// Returs true if employee number is unique
 /// </summary>
 /// <param name="employee">employee to check</param>
 /// <returns>true if empoyee number is unique</returns>
 public bool IsEmployeeNumberUnique(Employee employee)
 {
     var employeeWithTheSameNumber =
         Session.QueryOver<Employee>().Where(e => e.Id == employee.Id).SingleOrDefault();
     return employeeWithTheSameNumber == null || employeeWithTheSameNumber.Id == employee.Id;
 }