public void TestFindGroup(String parentGroupName, String groupName) { IStaffService staffService = DvConnection.ObjectContext.GetService <IStaffService>(); var group = staffService.FindGroupByName(null, "parentGroupName"); if (group == null) { return; } var groupLevel = group.Groups.Where(s => s.Name == parentGroupName).FirstOrDefault(); if (groupLevel == null) { return; } var groupCurrent = staffService.FindGroupByName(groupLevel, groupName); IEnumerable <StaffEmployee> employees = staffService.GetGroupEmployees(groupCurrent, true, true, true); }
//Получить сотрудников из группы private IEnumerable <StaffEmployee> GetEmployeesFromGroup(String parentGroupName, String groupName) { IStaffService staffService = DvConnection.ObjectContext.GetService <IStaffService>(); var group = staffService.FindGroupByName(null, parentGroupName); if (group == null) { return(null); } var groupCurrent = staffService.FindGroupByName(group, groupName); if (groupCurrent == null) { return(null); } IEnumerable <StaffEmployee> employees = staffService.GetGroupEmployees(groupCurrent, true, true, true); return(employees); }