Ejemplo n.º 1
0
        public void Create(WorkerDTO item)
        {
            var employeeEntity = Database.Employees.Find(item.Employee.Id);
            var projectEntity  = Database.Projects.Find(item.Project.Id);

            var worker = new ProjectWorkerEntity
            {
                EmployeeId = employeeEntity.Id,
                ProjectId  = projectEntity.Id
            };

            worker.FillFieldsOnCreate();
            Database.Workers.Create(worker);
        }
Ejemplo n.º 2
0
        private WorkerDTO CreateWorkerDTO(ProjectWorkerEntity entity)
        {
            var employeeEntity = Database.Employees.Find(entity.EmployeeId);
            //var employeeDTO = EService.CreateEmployeeDTO(employeeEntity);

            var projectEntity = Database.Projects.Find(entity.ProjectId);
            //var projectDTO = PService.CreateProjectDTO(projectEntity);

            var worker = new WorkerDTO
            {
                Id = entity.Id,
                //Employee = employeeDTO,
                //Project = projectDTO
            };

            return(worker);
        }