Engage.Dnn.Publish.Category.Save C# (CSharp) Method

Save() public method

public Save ( int authorId ) : void
authorId int
return void
        public override void Save(int authorId)
        {
            IDbConnection newConnection = DataProvider.Instance().GetConnection();
            IDbTransaction trans = newConnection.BeginTransaction();

            // int relationTypeId = RelationshipType.ItemToParentCategory.GetId();

            // create a transaction
            // get a connection
            try
            {
                this.SaveInfo(trans, authorId);
                UpdateItem(trans, this.ItemId, this.ModuleId);

                // TODO: only do the following if admin
                this.UpdateApprovalStatus(trans);

                // update category version now
                AddCategoryVersion(trans, this.ItemVersionId, this.ItemId, this.SortOrder, this.ChildDisplayTabId);
                this.SaveRelationships(trans);
                trans.Commit();
            }
            catch
            {
                trans.Rollback();

                // rollback and throw an error
                this.ItemVersionId = this.OriginalItemVersionId;
                throw;
            }
            finally
            {
                // clean up connection stuff
                newConnection.Close();
            }

            // Save Tags
            this.SaveTags();
            this.SaveItemVersionSettings();

            Utility.ClearPublishCache(this.PortalId);
        }