Beispiel #1
0
        public Employee GetEmployeeByCredentials(string user_name)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                Log.Debug($"GetEmployeeByCredentials user_name: {user_name}");
                var emp_data = _person_repo.GetByUserName(user_name);

                var ep_data = _entity_person_repo.GetByID(emp_data.PersonKey);

                var employee = _pers_es.Map(ep_data);
                employee.PersonAttributes = _entity_attrib_be.GetAttributeByEntity(employee.PersonKey, QIQOEntityType.Person);
                employee.Addresses = _address_be.GetAddressesByEntityID(employee.PersonKey, QIQOEntityType.Person);
                employee.Companies = _company_be.GetCompaniesByEmployee(employee);
                //GetEmployeeSupervisor(employee);
                _pers_es.InitPersonData(employee, emp_data);
                return employee;
            }));
        }
        public string GetEmployeeRoleInCompany(Employee employee)
        {
            if (employee == null)
            {
                throw new ArgumentNullException(nameof(employee));
            }

            return(ExecuteFaultHandledOperation(() =>
            {
                var ep_data = _entity_person_repository.GetByID(employee.EntityPersonKey);
                return ep_data.PersonRole;
            }));
        }