PublicAPI.Portal.Security.OrganizationItemELMA API Documentation
Organizational Structure Element
Access path: PublicAPI.Portal.Security.OrganizationItem
Methods

  NameDescription
Public methodAppoint
Assign user to the selected positions. The existing positions remain.
Public methodCount 
Returns the total number of objects of this type
Public methodCount(IEntityFilter)
Get Total Number of Objects by Filter
Public methodCreate
Create New Entity (without a Database entry)
Public methodDelete
Delete Object
Public methodFind(FetchOptions)
Find objects according to fetch options
Public methodFind(String)
Find objects according to the filter in the EQL language
Public methodFind(IEntityFilter, FetchOptions)
Fing objects according to fetch options and filter
Public methodFindByIdArray
Find All Objects by Array IDs
Public methodGetChiefByUser
Get the user chiefs
Public methodGetSubItems
Get all the subitems of an organizational structure item
Public methodGetSubItemsByLvl
Get all the organizational structure item subitmes by nest level
Public methodGetSubordinateByUser
Get the user subordinates
Public methodGetUserChiefsHierarchy
Get the model of hierarchical display of the user's superiors
Public methodGetUsersByDepartament
Get user by the organizational structure item, if the item is a position, then the user according to the position is returned, if the department, then all the department employees, including the nested positions
Public methodIsDirty
Check, if there are unsaved changes in the object
Public methodIsNew
Check, if the object is new (not saved in the database)
Public methodLoad(Guid)
Load by UID. If not found, an exception is invoked
Public methodLoad(Int64)
Load by ID. If not found, an exception is invoked
Public methodLoadOrCreate(Guid)
Load by ID. If not found, the new object is returned
Public methodLoadOrCreate(Int64)
Load by ID. If not found, the new object is returned
Public methodLoadOrNull(Guid)
Load by UID. If not found, null is returned
Public methodLoadOrNull(Int64)
Load by ID. If not found, null is returned
Public methodRefresh
Refresh (read over) Object from Database
Public methodSave
Save Object to Database
Public methodSetAppointments
Assign user to the selected positions with deleting previous positions.
Back to Top
Properties

  NameDescription
Public propertyTypeUid
Returns the unique object identifier "Organizational Structure Element"
Back to Top
Remarks

Section containing methods for managing organizational structure
Examples

Assign a user created here, to the role of department head

//load the department head 
var orgItem = PublicAPI.Security.OrganizationItem.Load(3);
//assign the use to the position
PublicAPI.Security.OrganizationItem.Appoint(myUser, new OrganizationItem[] {orgItem});

You may get the user’s superiors and subordinates

//getting the user’s superiors 
var chiefList = PublicAPI.Security.OrganizationItem.GetChiefByUser(myUser);
//getting the user’s subordinates 
var subordinateList = PublicAPI.Security.OrganizationItem.GetSubordinateByUser(myUser);

You can get all users of some specific department

//load the department 
var department = PublicAPI.Security.OrganizationItem.Load(2);
//get the department users 
var userList = PublicAPI.Security.OrganizationItem.GetUsersByDepartment(department);

See Also