/// <summary> /// Добавить сотрудника /// </summary> /// <param name="addedEmployee">DTO добавляемого сотрудника</param> /// <returns>Сотрудник</returns> public Employee Add(EmployeeDto addedEmployee) { Contract.Argument.IsNotNull(addedEmployee, nameof(addedEmployee)); var userId = _userContextPrtovider.GetUserId(); var contact = _contactService.Add(addedEmployee.Contact); var passport = _passportService.Add(addedEmployee.Passport); var organization = _organizationService.Add(addedEmployee.Organization); var stateRegistration = _stateRegistrationService.Add(addedEmployee.StateRegistration); var newEmployee = _employeeRepository.Create( userId: userId, managerId: addedEmployee.ManagerId, contactId: contact.Id, passportId: passport.Id, invitationId: null, organizationId: organization.Id, stateRegistrationId: stateRegistration.Id, academicDegree: addedEmployee.AcademicDegree, academicRank: addedEmployee.AcademicRank, education: addedEmployee.Education, position: addedEmployee.Position, workPlace: addedEmployee.WorkPlace); return(newEmployee); }