Ejemplo n.º 1
0
        public bool UpdateBasicData(Guid objectCustomFieldId,
                                    object value,
                                    BasicCustomFieldTypeEnum basicCustomFieldType,
                                    CustomFieldTypeFlag customFieldTypeFlag)
        {
            BasicCustomFieldTypeBOBase basicCustomFieldTypeBO = null;

            switch (basicCustomFieldType)
            {
            case BasicCustomFieldTypeEnum.STRING:
                basicCustomFieldTypeBO = new CustomFieldDataStringBO();
                break;

            case BasicCustomFieldTypeEnum.DATETIME:
                basicCustomFieldTypeBO = new CustomFieldDataDateTimeBO();
                break;

            case BasicCustomFieldTypeEnum.FLOAT:
                basicCustomFieldTypeBO = new ObjectCustomFieldDataFloatBO();
                break;

            case BasicCustomFieldTypeEnum.INTEGER:
                basicCustomFieldTypeBO = new ObjectCustomFieldDataIntegerBO();
                break;

            default:
                break;
            }
            return(basicCustomFieldTypeBO.UpdateCustomFieldData(objectCustomFieldId,
                                                                value,
                                                                customFieldTypeFlag));
        }
Ejemplo n.º 2
0
        public bool UpdateBasicData(Guid cmsObjectId,
                                    Guid objectTypeCustomFieldId,
                                    object value,
                                    BasicCustomFieldTypeEnum basicCustomFieldType,
                                    CustomFieldTypeFlag customFieldTypeFlag)
        {
            Session session = null;

            try
            {
                session = XpoHelper.GetNewSession();
                ObjectCustomFieldBO objectCustomFieldBO = new ObjectCustomFieldBO();
                ObjectCustomField   objectCustomField   =
                    objectCustomFieldBO.GetObjectCustomField(session, cmsObjectId, objectTypeCustomFieldId);
                if (objectCustomField == null)
                {
                    throw new Exception("Could not found ObjectCustomField");
                }
                BasicCustomFieldTypeBOBase basicCustomFieldTypeBO = null;
                switch (basicCustomFieldType)
                {
                case BasicCustomFieldTypeEnum.STRING:
                    basicCustomFieldTypeBO = new CustomFieldDataStringBO();
                    break;

                case BasicCustomFieldTypeEnum.DATETIME:
                    basicCustomFieldTypeBO = new CustomFieldDataDateTimeBO();
                    break;

                case BasicCustomFieldTypeEnum.FLOAT:
                    basicCustomFieldTypeBO = new ObjectCustomFieldDataFloatBO();
                    break;

                case BasicCustomFieldTypeEnum.INTEGER:
                    basicCustomFieldTypeBO = new ObjectCustomFieldDataIntegerBO();
                    break;

                default:
                    break;
                }
                return(basicCustomFieldTypeBO.UpdateCustomFieldData(objectCustomField.ObjectCustomFieldId,
                                                                    value,
                                                                    customFieldTypeFlag));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (session != null)
                {
                    session.Dispose();
                }
            }
        }