Esempio n. 1
0
        }//afterWriteNode()

        private void _runMailReportEvents()
        {
            Collection <CswNbtNodePropWrapper> ModifiedProps = new Collection <CswNbtNodePropWrapper>();

            foreach (CswNbtNodePropWrapper CurrentProp in _CswNbtNode.Properties)
            {
                if (CurrentProp.wasAnySubFieldModified(IncludePendingUpdate: false))
                {
                    ModifiedProps.Add(CurrentProp);
                }
            }
            if (ModifiedProps.Count > 0)
            {
                _CswNbtResources.runMailReportEvents(this.NodeType, CswEnumNbtMailReportEventOption.Edit, _CswNbtNode, ModifiedProps);
            }
        }
        /// <summary>
        /// Executes functions to perform on nodes where pendingevents is true
        /// </summary>
        public void triggerUpdateEvents()
        {
            Collection <CswNbtNodePropWrapper> ModifiedProps = new Collection <CswNbtNodePropWrapper>();

            foreach (CswNbtNodePropWrapper CurrentProp in _CswNbtNode.Properties)
            {
                if (CswTools.IsPrimaryKey(CurrentProp.NodeId) && CurrentProp.wasAnySubFieldModified())
                {
                    _markExternalPropRefsDirty(CurrentProp);
                    _markExternalRelatedPropsDirty(CurrentProp);
                    ModifiedProps.Add(CurrentProp);
                }
            }
            if (ModifiedProps.Count > 0)
            {
                _CswNbtResources.runMailReportEvents(_CswNbtNode.NodeTypeId, CswEnumNbtMailReportEventOption.Edit, _CswNbtNode, ModifiedProps);
            }
        }
Esempio n. 3
0
 public void beforeWriteNode(bool IsCopy, bool OverrideUniqueValidation, bool Creating)
 {
     beforeWriteNodeLogic(Creating, OverrideUniqueValidation);
     if (false == Creating)
     {
         foreach (CswNbtNodePropWrapper CurrentProp in _CswNbtNode.Properties)
         {
             if (CurrentProp.wasAnySubFieldModified())
             {
                 _updateExternalRelatedProps(CurrentProp);
             }
         }
     }
     if (false == OverrideUniqueValidation)
     {
         _validateCompoundUniqueProps(IsCopy);
     }
 } // beforeWriteNode()
Esempio n. 4
0
        }             //PropsTable


        public void update(CswNbtNode Node, bool IsCopy, bool OverrideUniqueValidation, bool Creating, bool AllowAuditing, bool SkipEvents)
        {
            // Do BeforeUpdateNodePropRow on each row
            //Case 29857 - we have to use a traditional for-loop here. onBeforeUpdateNodePropRow() can cause new rows in PropCollData.PropsTable to be created
            // see Document.ArchivedDate
            for (int i = 0; i < PropsTable.Rows.Count; i++)
            {
                DataRow CurrentRow = PropsTable.Rows[i];
                if (CurrentRow.IsNull("nodetypepropid"))
                {
                    throw (new CswDniException("A node prop row is missing its nodetypepropid"));
                }
                if (false == SkipEvents)
                {
                    this[CswConvert.ToInt32(CurrentRow["nodetypepropid"])].onBeforeUpdateNodePropRow(Node, IsCopy, OverrideUniqueValidation, Creating);
                }
            }

            // Sync GestaltSearch (this has to be done after -- see case 31586)
            foreach (CswNbtNodePropWrapper CurrentProp in _Props)
            {
                if (CurrentProp.wasAnySubFieldModified())
                {
                    CurrentProp.SyncGestaltSearch();
                }
            }

            // Do the Update
            if (null != _CswNbtNode)
            {
                _PropsUpdate.update(PropsTable, (AllowAuditing && false == _CswNbtNode.IsTemp));

                if (CswTools.IsPrimaryKey(_CswNbtNode.RelationalId) && "nodes" != _CswNbtNode.RelationalId.TableName.ToLower())
                {
                    _propCollRelational.update(_CswNbtNode.NodeTypeId, _CswNbtNode.RelationalId, PropsTable);
                }
            }
        }