C# Class Rock.Model.GroupService

Data Access/service class for Rock.Model.Group entity type objects that extends the functionality of Rock.Data.Service
Mostra file Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, Location location, bool moveExistingToPrevious = false ) : void

Adds the new group address.

AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, int locationId, bool moveExistingToPrevious = false ) : void

Adds the new group address.

AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, string street1, string street2, string city, string state, string postalCode, string country, bool moveExistingToPrevious = false ) : void

Adds the new group address.

Delete ( Group item ) : bool

Deletes a specified group. Returns a boolean flag indicating if the deletion was successful.

GetAllAncestorIds ( int childGroupId ) : IOrderedEnumerable

Returns an enumerable collection of the Rock.Model.Group Ids that are ancestors of a specified groupId sorted starting with the most immediate parent

GetAllDescendents ( int parentGroupId ) : IEnumerable

Returns an enumerable collection of Groups that are descendants of a specified group.

GetByGroupTypeId ( int groupTypeId ) : IQueryable

Returns an enumerable collection of Rock.Model.Group entities that by their Rock.Model.GroupType Id.

GetByGuid ( System.Guid guid ) : Group

Returns the Rock.Model.Group containing a Guid property that matches the provided value.

GetByIsSecurityRole ( bool isSecurityRole ) : IQueryable

Returns an enumerable collection of Groups by their IsSecurityRole flag.

GetByParentGroupId ( int parentGroupId ) : IQueryable

Returns a collection of Rock.Model.Group">Groups by the Id of its parent

GetByParentGroupIdAndName ( int parentGroupId, string name ) : IQueryable

Returns an enumerable collection of Rock.Model.Group">Groups by the Id of their parent

GetChildren ( int id, int rootGroupId, bool limitToSecurityRoleGroups, List groupTypeIncludedIds, List groupTypeExcludedIds, bool includeInactiveGroups, bool limitToShowInNavigation ) : IQueryable

Gets immediate children of a group (id) or a rootGroupId. Specify 0 for both Id and rootGroupId to get top level groups limited

GetGeofencedFamilies ( System.Guid groupGuid ) : IQueryable

Gets the family groups that are geofenced by any of the selected group's locations

GetGeofencedFamilies ( List geofences ) : IQueryable

Gets the family groups that are geofenced by any of the selected geofences

GetGeofencedFamilies ( int groupId ) : IQueryable

Gets the family groups that are geofenced by any of the selected group's locations

GetGeofencingGroups ( IQueryable points, System.Guid groupTypeGuid ) : IQueryable

Gets the groups of a selected type that have a geofence location that surrounds any of the selected points

GetGeofencingGroups ( IQueryable points, int groupTypeId ) : IQueryable

Gets the groups of a selected type that have a geofence location that surrounds any of the selected points

GetGeofencingGroups ( int personId, System.Guid groupTypeGuid ) : IQueryable

Gets the groups of a particular type that geofence the selected person's mapped location(s)

GetGeofencingGroups ( int personId, int groupTypeId ) : IQueryable

Gets the groups of a particular type that geofence the selected person's mapped location(s)

GetNavigationChildren ( int id, int rootGroupId, bool limitToSecurityRoleGroups, List groupTypeIncludedIds, List groupTypeExcludedIds, bool includeInactiveGroups = true ) : IQueryable

Gets immediate navigation children of a group (id) or a rootGroupId. Specify 0 for both Id and rootGroupId to get top level groups limited

GetNearestGroup ( int personId, int groupTypeId ) : Group

Gets the nearest group.

GroupAncestorPathName ( int groupId ) : string

Groups the name of the ancestor path.

GroupMembersNotMeetingRequirements ( int groupId, bool includeWarnings, bool includeInactive = false ) : Dictionary>

Groups the members not meeting requirements.

SaveNewFamily ( RockContext rockContext, List familyMembers, int campusId, bool savePersonAttributes ) : Group

Saves the new family.

SaveNewGroup ( RockContext rockContext, int groupTypeId, System.Guid parentGroupGuid, string groupName, List groupMembers, int campusId, bool savePersonAttributes ) : Group

Saves the new group.

Private Methods

Method Description
AddNewFamilyAddress ( RockContext rockContext, Group family, string locationTypeGuid, Location location, bool moveExistingToPrevious = false ) : void
AddNewFamilyAddress ( RockContext rockContext, Group family, string locationTypeGuid, int locationId, bool moveExistingToPrevious = false ) : void
AddNewFamilyAddress ( RockContext rockContext, Group family, string locationTypeGuid, string street1, string street2, string city, string state, string postalCode, string country, bool moveExistingToPrevious = false ) : void

Method Details

AddNewGroupAddress() public static method

Adds the new group address.
public static AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, Location location, bool moveExistingToPrevious = false ) : void
rockContext Rock.Data.RockContext The rock context.
group Group The group.
locationTypeGuid string The location type unique identifier.
location Location The location.
moveExistingToPrevious bool if set to true [move existing to previous].
return void

AddNewGroupAddress() public static method

Adds the new group address.
public static AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, int locationId, bool moveExistingToPrevious = false ) : void
rockContext Rock.Data.RockContext The rock context.
group Group The group.
locationTypeGuid string The location type unique identifier.
locationId int The location identifier.
moveExistingToPrevious bool if set to true [move existing to previous].
return void

AddNewGroupAddress() public static method

Adds the new group address.
public static AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, string street1, string street2, string city, string state, string postalCode, string country, bool moveExistingToPrevious = false ) : void
rockContext Rock.Data.RockContext The rock context.
group Group The group.
locationTypeGuid string The location type unique identifier.
street1 string The street1.
street2 string The street2.
city string The city.
state string The state.
postalCode string The postal code.
country string The country.
moveExistingToPrevious bool if set to true [move existing to previous].
return void

Delete() public method

Deletes a specified group. Returns a boolean flag indicating if the deletion was successful.
public Delete ( Group item ) : bool
item Group The to delete.
return bool

GetAllAncestorIds() public method

Returns an enumerable collection of the Rock.Model.Group Ids that are ancestors of a specified groupId sorted starting with the most immediate parent
public GetAllAncestorIds ( int childGroupId ) : IOrderedEnumerable
childGroupId int The child group identifier.
return IOrderedEnumerable

GetAllDescendents() public method

Returns an enumerable collection of Groups that are descendants of a specified group.
public GetAllDescendents ( int parentGroupId ) : IEnumerable
parentGroupId int An representing the Id of the to retrieve descendants for.
return IEnumerable

GetByGroupTypeId() public method

Returns an enumerable collection of Rock.Model.Group entities that by their Rock.Model.GroupType Id.
public GetByGroupTypeId ( int groupTypeId ) : IQueryable
groupTypeId int An representing the Id of the that they belong to.
return IQueryable

GetByGuid() public method

Returns the Rock.Model.Group containing a Guid property that matches the provided value.
public GetByGuid ( System.Guid guid ) : Group
guid System.Guid A to find a by.
return Group

GetByIsSecurityRole() public method

Returns an enumerable collection of Groups by their IsSecurityRole flag.
public GetByIsSecurityRole ( bool isSecurityRole ) : IQueryable
isSecurityRole bool A representing the IsSecurityRole flag value to search by.
return IQueryable

GetByParentGroupId() public method

Returns a collection of Rock.Model.Group">Groups by the Id of its parent
public GetByParentGroupId ( int parentGroupId ) : IQueryable
parentGroupId int A representing the Id of the parent to search by. This value /// is nullable and a null value will search for Groups that do not inherit from other groups.
return IQueryable

GetByParentGroupIdAndName() public method

Returns an enumerable collection of Rock.Model.Group">Groups by the Id of their parent
public GetByParentGroupIdAndName ( int parentGroupId, string name ) : IQueryable
parentGroupId int An representing the Id of the parent to search by.
name string A containing the Name of the to search by.
return IQueryable

GetChildren() public method

Gets immediate children of a group (id) or a rootGroupId. Specify 0 for both Id and rootGroupId to get top level groups limited
public GetChildren ( int id, int rootGroupId, bool limitToSecurityRoleGroups, List groupTypeIncludedIds, List groupTypeExcludedIds, bool includeInactiveGroups, bool limitToShowInNavigation ) : IQueryable
id int The ID of the Group to get the children of (or 0 to use rootGroupId)
rootGroupId int The root group ID
limitToSecurityRoleGroups bool if set to true [limit to security role groups].
groupTypeIncludedIds List The group type included ids.
groupTypeExcludedIds List The group type excluded ids.
includeInactiveGroups bool if set to true [include inactive groups].
limitToShowInNavigation bool if set to true [limit to show in navigation].
return IQueryable

GetGeofencedFamilies() public method

Gets the family groups that are geofenced by any of the selected group's locations
public GetGeofencedFamilies ( System.Guid groupGuid ) : IQueryable
groupGuid System.Guid The group unique identifier.
return IQueryable

GetGeofencedFamilies() public method

Gets the family groups that are geofenced by any of the selected geofences
public GetGeofencedFamilies ( List geofences ) : IQueryable
geofences List The geofences.
return IQueryable

GetGeofencedFamilies() public method

Gets the family groups that are geofenced by any of the selected group's locations
public GetGeofencedFamilies ( int groupId ) : IQueryable
groupId int The group identifier.
return IQueryable

GetGeofencingGroups() public method

Gets the groups of a selected type that have a geofence location that surrounds any of the selected points
public GetGeofencingGroups ( IQueryable points, System.Guid groupTypeGuid ) : IQueryable
points IQueryable The points.
groupTypeGuid System.Guid The group type unique identifier.
return IQueryable

GetGeofencingGroups() public method

Gets the groups of a selected type that have a geofence location that surrounds any of the selected points
public GetGeofencingGroups ( IQueryable points, int groupTypeId ) : IQueryable
points IQueryable The points.
groupTypeId int The group type identifier.
return IQueryable

GetGeofencingGroups() public method

Gets the groups of a particular type that geofence the selected person's mapped location(s)
public GetGeofencingGroups ( int personId, System.Guid groupTypeGuid ) : IQueryable
personId int The person identifier.
groupTypeGuid System.Guid The group type unique identifier.
return IQueryable

GetGeofencingGroups() public method

Gets the groups of a particular type that geofence the selected person's mapped location(s)
public GetGeofencingGroups ( int personId, int groupTypeId ) : IQueryable
personId int The person identifier.
groupTypeId int The group type identifier.
return IQueryable

GetNavigationChildren() public method

Gets immediate navigation children of a group (id) or a rootGroupId. Specify 0 for both Id and rootGroupId to get top level groups limited
public GetNavigationChildren ( int id, int rootGroupId, bool limitToSecurityRoleGroups, List groupTypeIncludedIds, List groupTypeExcludedIds, bool includeInactiveGroups = true ) : IQueryable
id int The identifier.
rootGroupId int The root group identifier.
limitToSecurityRoleGroups bool if set to true [limit to security role groups].
groupTypeIncludedIds List The group type included ids.
groupTypeExcludedIds List The group type excluded ids.
includeInactiveGroups bool if set to true [include inactive groups].
return IQueryable

GetNearestGroup() public method

Gets the nearest group.
public GetNearestGroup ( int personId, int groupTypeId ) : Group
personId int The person identifier.
groupTypeId int The group type identifier.
return Group

GroupAncestorPathName() public method

Groups the name of the ancestor path.
public GroupAncestorPathName ( int groupId ) : string
groupId int The group identifier.
return string

GroupMembersNotMeetingRequirements() public method

Groups the members not meeting requirements.
public GroupMembersNotMeetingRequirements ( int groupId, bool includeWarnings, bool includeInactive = false ) : Dictionary>
groupId int The group identifier.
includeWarnings bool if set to true [include warnings].
includeInactive bool if set to true [include inactive].
return Dictionary>

SaveNewFamily() public static method

Saves the new family.
public static SaveNewFamily ( RockContext rockContext, List familyMembers, int campusId, bool savePersonAttributes ) : Group
rockContext Rock.Data.RockContext The rock context.
familyMembers List The family members.
campusId int The campus identifier.
savePersonAttributes bool if set to true [save person attributes].
return Group

SaveNewGroup() public static method

Saves the new group.
public static SaveNewGroup ( RockContext rockContext, int groupTypeId, System.Guid parentGroupGuid, string groupName, List groupMembers, int campusId, bool savePersonAttributes ) : Group
rockContext Rock.Data.RockContext The rock context.
groupTypeId int The group type identifier.
parentGroupGuid System.Guid The parent group unique identifier.
groupName string Name of the group.
groupMembers List The group members.
campusId int The campus identifier.
savePersonAttributes bool if set to true [save person attributes].
return Group