public DataContracts.IProject AddProject(DataContracts.IProject project)
        {
            using (var connection = new SqlConnection(base.ConnectionString))
            {
                var adapter = new ProjectAdapter();

                using (var command = new SqlCommand("sp_projectCreate", connection))
                {
                    command.Parameters.AddRange(adapter.ResolveToParameters(project).ToArray());

                    command.CommandType = CommandType.StoredProcedure;

                    connection.Open();
                    var reader = command.ExecuteReader();

                    while (reader.Read())
                    {
                        project = (Project)adapter.Resolve(new Project(), reader);
                    }

                    connection.Close();
                }
            }
            return project;
        }
        public void DeleteProject(int projectId)
        {
            using (var connection = new SqlConnection(base.ConnectionString))
            {
                var adapter = new ProjectAdapter();

                using (var command = new SqlCommand("sp_projectDelete", connection))
                {
                    command.Parameters.AddWithValue("@projectId", projectId);

                    command.CommandType = CommandType.StoredProcedure;

                    connection.Open();
                    var reader = command.ExecuteReader();
                    connection.Close();
                }
            }
        }
        public IEnumerable<IEmployeeProjectAssignment> GetEmployeesAssignedToProject(int projectId)
        {
            var assignments = new List<IEmployeeProjectAssignment>();

            using (var connection = new SqlConnection(base.ConnectionString))
            {
                var adapter = new ProjectAdapter();

                using (var command = new SqlCommand("sp_ProjectRetrieveEmployees", connection))
                {
                    command.Parameters.AddWithValue("@projectId", projectId);

                    command.CommandType = CommandType.StoredProcedure;

                    connection.Open();
                    var reader = command.ExecuteReader();
                    var personAdapter = new PersonAdapter();

                    while (reader.Read())
                    {
                        var assignment = new EmployeeProjectAssignment();
                        assignment.ProjectId = projectId;
                        assignment.EmployeeId = Convert.ToInt32(reader["EmployeeId"]);
                        assignment.Person = personAdapter.Resolve(new Person(), reader);

                        assignments.Add(assignment);
                    }

                    connection.Close();
                }
            }

            return assignments;
        }
        public IEnumerable<DataContracts.IProject> GetProjectsForCompanyId(int companyId)
        {
            var projects = new List<IProject>();

            using (var connection = new SqlConnection(base.ConnectionString))
            {
                var adapter = new ProjectAdapter();

                using (var command = new SqlCommand("sp_projectsRetrieveByCompanyId", connection))
                {
                    command.Parameters.AddWithValue("@companyId", companyId);

                    command.CommandType = CommandType.StoredProcedure;

                    connection.Open();
                    var reader = command.ExecuteReader();

                    while(reader.Read())
                    {
                        projects.Add(adapter.Resolve(new Project(), reader));
                    }

                    connection.Close();
                }
            }

            return projects;
        }