import ABSL;
import AP.PC.IdentityManagement.Global;
var managerExists = this.CurrentEmployeeResponsible.Where(x=>x.PartyRoleCode.Contains("ZJE"));
if( managerExists.Count() <= 0){
var queryByIdentityUUID = Identity.QueryByElements;
var queryByIdentityUUIDParameter = queryByIdentityUUID.CreateSelectionParams();
var queryByEmployeeBPUUID = Employee.QueryByIdentification;
var queryByEmployeeBPUUIDParameter = queryByEmployeeBPUUID.CreateSelectionParams();
var id = Context.GetCurrentIdentityUUID().content;
queryByIdentityUUIDParameter.Add( queryByIdentityUUID.UUID.content, "I", "EQ", id.ToString() );
var result = queryByIdentityUUID.Execute(queryByIdentityUUIDParameter);
var first = result.GetFirst(); // points to identity instance
var person = first.Person;
var bpUUId = person.UUID.content;
queryByEmployeeBPUUIDParameter.Add( queryByEmployeeBPUUID.UUID.content, "I", "EQ", bpUUId.ToString());
var employeeQueryResult = queryByEmployeeBPUUID.Execute(queryByEmployeeBPUUIDParameter);
var EmployeeQueryResultCurrent = employeeQueryResult.GetFirst();
var assignedOrg = EmployeeQueryResultCurrent.OrganisationalUnitAssignment.GetFirst();
var org = assignedOrg.ToRoot;
var manager = org.Manager.GetFirst();
firstCommon.CustomExtension = manager.EmployeeUUID.content;
var newNode: elementsof Customer.CurrentEmployeeResponsible;
newNode.EmployeeUUID.content = manager.EmployeeUUID.content;
newNode.PartyRoleCode = "ZJE";
this.CurrentEmployeeResponsible.Create(newNode);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |