Exemple #1
0
        public bool UpdatePredefinitionData(Guid objectCustomFieldId,
                                            IEnumerable <Guid> refIds,
                                            PredefinitionCustomFieldTypeEnum predefinitionCustomFieldType,
                                            CustomFieldTypeFlag customFieldTypeFlag)
        {
            ObjectCustomFieldDataPreDefinitionBO objectCustomFieldDataPreDefinitionBO =
                new ObjectCustomFieldDataPreDefinitionBO();

            return(objectCustomFieldDataPreDefinitionBO.UpdateCustomFieldData(
                       objectCustomFieldId,
                       refIds,
                       predefinitionCustomFieldType,
                       customFieldTypeFlag));
        }
Exemple #2
0
        public bool UpdatePredefinitionData(Guid cmsObjectId,
                                            Guid objectTypeCustomFieldId,
                                            IEnumerable <Guid> refIds,
                                            PredefinitionCustomFieldTypeEnum predefinitionCustomFieldType,
                                            CustomFieldTypeFlag customFieldTypeFlag)
        {
            Session session = null;

            try
            {
                session = XpoHelper.GetNewSession();
                ObjectCustomFieldDataPreDefinitionBO objectCustomFieldDataPreDefinitionBO =
                    new ObjectCustomFieldDataPreDefinitionBO();

                ObjectCustomFieldBO objectCustomFieldBO = new ObjectCustomFieldBO();
                ObjectCustomField   objectCustomField   =
                    objectCustomFieldBO.GetObjectCustomField(session, cmsObjectId, objectTypeCustomFieldId);
                if (objectCustomField == null)
                {
                    throw new Exception("Could not found ObjectCustomField");
                }

                return(objectCustomFieldDataPreDefinitionBO.UpdateCustomFieldData(
                           objectCustomField.ObjectCustomFieldId,
                           refIds,
                           predefinitionCustomFieldType,
                           customFieldTypeFlag));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (session != null)
                {
                    session.Dispose();
                }
            }
        }