/** * Remove an existing NPrinting Group */ public void DeleteNpGroup(UserGroup group) { GroupResponse nPrintingGroup = _groupsApi.GroupsGet(group.Name); //Group already in NPrinting if (nPrintingGroup.Data.Items != null && nPrintingGroup.Data.Items.Count > 0) { GroupResponseDataItem npGroup = nPrintingGroup.Data.Items[0]; _groupsApi.GroupsIdDelete(npGroup.Id.ToString()); } }
private string HandleNprintingGroups(UserGroup userGroup) { GroupResponse nPrintingGroup = _groupsApi.GroupsGet(userGroup.Name); //Group already in NPrinting if (nPrintingGroup.Data.Items != null && nPrintingGroup.Data.Items.Count > 0) { GroupResponseDataItem npGroup = nPrintingGroup.Data.Items[0]; _npGroupService.UpdateNpGroup(npGroup, userGroup); return(npGroup.Id.ToString()); } else { return(_npGroupService.AddNewNpGroup(userGroup)); } }
/** * Update an existing NPrinting Group */ public void UpdateNpGroup(GroupResponseDataItem npGroup, UserGroup userGroup) { //there maybe changes to the Group Details _groupsApi.GroupsIdPut(npGroup.Id.ToString(), new GroupUpdateRequest(userGroup.Name, userGroup.Description ?? "", true)); }