public bool EmployeeDelete(Account account, AccountPerson employee) { if (account == null) { throw new ArgumentNullException(nameof(account)); } if (employee == null) { throw new ArgumentNullException(nameof(employee)); } return(ExecuteFaultHandledOperation(() => { var person = _pers_es.Map(employee); person.PersonKey = employee.PersonKey; EntityPersonData ep_data = new EntityPersonData() { EntityKey = account.AccountKey, EntityTypeKey = 3, // Account PersonKey = employee.PersonKey, PersonTypeKey = employee.PersonTypeData.PersonTypeKey, EntityPersonSeq = 1 // default; not used }; _entity_person_repo.DeleteByObject(ep_data); _person_repo.Delete(person); return true; })); }
public bool DeteteEmployee(Company company, Employee employee) { if (employee == null) { throw new ArgumentNullException(nameof(employee)); } if (company == null) { throw new ArgumentNullException(nameof(company)); } return(ExecuteFaultHandledOperation(() => { var ep_data = new EntityPersonData() { EntityKey = company.CompanyKey, EntityTypeKey = 1, // Company PersonKey = employee.PersonKey, PersonTypeKey = (int)employee.CompanyRoleType, EntityPersonSeq = 1 // default; not used }; _entity_person_repository.DeleteByObject(ep_data); return true; })); }