Beispiel #1
0
        public void InvokeTypeEndTemplateEdit(Authentication authentication, Type type, CremaDataType dataType)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeEndTemplateEdit), type);

            var dataTypes  = new DataTypeCollection(dataType.DataSet, this.DataBase);
            var dataTables = new DataTableCollection(dataType.DataSet, this.DataBase);

            try
            {
                dataTypes.Modify(this.Repository, item => item == type);
                dataTables.Modify(this.Repository);
                this.Context.InvokeTypeItemChange(authentication, type);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.Repository.Revert();
                throw e;
            }
        }
Beispiel #2
0
        public void InvokeTypeSetTags(Authentication authentication, Type type, TagInfo tags, CremaDataSet dataSet)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeSetTags), type, tags);

            var dataTypes = new DataTypeCollection(dataSet, this.DataBase);
            var dataType  = dataSet.Types[type.Name, type.Category.Path];

            dataType.Tags = tags;

            try
            {
                dataTypes.Modify(this.Repository, item => item == type);
                this.Context.InvokeTypeItemChange(authentication, type);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.Repository.Revert();
                throw e;
            }
        }
Beispiel #3
0
        public void InvokeTypeRename(Authentication authentication, Type type, string newName, CremaDataSet dataSet)
        {
            this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeRename), type, newName);
            var dataTypes  = new DataTypeCollection(dataSet, this.DataBase);
            var dataTables = new DataTableCollection(dataSet, this.DataBase);
            var dataType   = dataSet.Types[type.Name, type.Category.Path];

            dataType.TypeName = newName;

            try
            {
                dataTypes.Modify(this.Repository, item => item == type);
                dataTables.Modify(this.Repository);
                this.Context.InvokeTypeItemRename(authentication, type, newName);
            }
            catch (Exception e)
            {
                this.CremaHost.Error(e);
                this.Repository.Revert();
                throw e;
            }
        }