public static int GetVautlValueListItem(this IObjVerEx obj, VL_ValueLists vlId, string item)
        {
            ValueListItems vlItems = obj.objVerEx.Vault.ValueListItemOperations.GetValueListItems((int)vlId);

            foreach (ValueListItem vlItem in vlItems)
            {
                if (item.Equals(vlItem.Name.Trim(), StringComparison.InvariantCultureIgnoreCase))
                {
                    return(vlItem.ID);
                }
            }

            return(-1);
        }
        public static void DeleteValueListItem(this IObjVerEx obj, VL_ValueLists vlId, string vlItemNameToDelete)
        {
            if (string.IsNullOrWhiteSpace(vlItemNameToDelete))
            {
                return;
            }

            ValueListItems vlItems = obj.objVerEx.Vault.ValueListItemOperations.GetValueListItems((int)vlId);

            foreach (ValueListItem vlItem in vlItems)
            {
                if (vlItemNameToDelete.Equals(vlItem.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    obj.objVerEx.Vault.ValueListItemOperations.RemoveValueListItem((int)vlId, vlItem.ID);
                    break;
                }
            }
        }
        public static bool HasValueListItem(this IObjVerEx obj, VL_ValueLists vlId, string vlItemName)
        {
            bool vlItemExists = false;

            if (string.IsNullOrWhiteSpace(vlItemName))
            {
                return(vlItemExists);
            }

            ValueListItems vlItems = obj.objVerEx.Vault.ValueListItemOperations.GetValueListItems((int)vlId);

            foreach (ValueListItem vlItem in vlItems)
            {
                if (vlItemName.Equals(vlItem.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    vlItemExists = true;
                    break;
                }
            }

            return(vlItemExists);
        }
        public static ValueListItem CreateValueListItemAdmin(this IObjVerEx obj, VL_ValueLists vlId, string vlItemNameToAdd)
        {
            if (string.IsNullOrWhiteSpace(vlItemNameToAdd))
            {
                return(null);
            }

            ValueListItems vlItems = obj.objVerEx.Vault.ValueListItemOperations.GetValueListItems((int)vlId);

            foreach (ValueListItem vlItem in vlItems)
            {
                if (vlItemNameToAdd.Equals(vlItem.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(null);
                }
            }

            ValueListItem vlItemToAdd = new ValueListItem()
            {
                Name = vlItemNameToAdd
            };

            return(obj.objVerEx.Vault.ValueListItemOperations.AddValueListItem((int)vlId, vlItemToAdd, true));
        }
 public static void DeleteValueListItem(this IObjVerEx obj, VL_ValueLists vlId, int vlItemId)
 {
     obj.objVerEx.Vault.ValueListItemOperations.RemoveValueListItem((int)vlId, vlItemId);
 }