Inheritance: RecordModifiedEventArgs
Esempio n. 1
0
        bool UpdateCallback(int recordsAffected, Exception exception)
        {
            AfterRecordUpdatedEventArgs eAfterRecordUpdated = new AfterRecordUpdatedEventArgs(record, recordsAffected, exception, keys, values);

            this.OnAfterRecordUpdated(eAfterRecordUpdated);

            if (this.AutomaticResponseValues)
            {
                if (this.keys.Count > 0)
                {
                    IEnumerator enumerator = this.keys.Keys.GetEnumerator();
                    enumerator.MoveNext();
                    string keyName = (string)enumerator.Current;
                    if (keyName != null)
                    {
                        this.values[keyName] = this.keys[keyName];
                    }
                }

                var mappings = new Dictionary <string, object>();
                var model    = this.ModelInstance;
                foreach (var key in values.Keys)
                {
                    var field = model.Fields.FirstOrDefault <ModelField>(f => f.Name == key.ToString());
                    mappings.Add(field != null ? (field.Mapping.IsNotEmpty() ? field.Mapping : field.Name) : key.ToString(), values[key]);
                }

                this.responseRecords.Add(mappings);
            }
            return(eAfterRecordUpdated.ExceptionHandled);
        }
Esempio n. 2
0
        protected virtual void OnAfterRecordUpdated(AfterRecordUpdatedEventArgs e)
        {
            AfterRecordUpdatedEventHandler handler = (AfterRecordUpdatedEventHandler)Events[EventAfterRecordUpdated];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 3
0
        bool UpdateCallback(int recordsAffected, Exception exception)
        {
            if (confirmation != null && recordsAffected > 0)
            {
                confirmation.ConfirmRecord();
            }
            AfterRecordUpdatedEventArgs eAfterRecordUpdated = new AfterRecordUpdatedEventArgs(record, recordsAffected, exception, keys, values, oldValues, confirmation);

            this.OnAfterRecordUpdated(eAfterRecordUpdated);

            return(eAfterRecordUpdated.ExceptionHandled);
        }
Esempio n. 4
0
        protected virtual void OnAfterRecordUpdated(AfterRecordUpdatedEventArgs e)
        {
            AfterRecordUpdatedEventHandler handler = (AfterRecordUpdatedEventHandler)Events[EventAfterRecordUpdated];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 5
0
        bool UpdateCallback(int recordsAffected, Exception exception)
        {
            AfterRecordUpdatedEventArgs eAfterRecordUpdated = new AfterRecordUpdatedEventArgs(record, recordsAffected, exception, keys, values);
            this.OnAfterRecordUpdated(eAfterRecordUpdated);

            if (this.AutomaticResponseValues)
            {
                if (this.keys.Count > 0)
                {
                    IEnumerator enumerator = this.keys.Keys.GetEnumerator();
                    enumerator.MoveNext();
                    string keyName = (string)enumerator.Current;
                    if (keyName != null)
                    {
                        this.values[keyName] = this.keys[keyName];
                    }
                }

                var mappings = new Dictionary<string, object>();
                var model = this.ModelInstance;
                foreach (var key in values.Keys)
                {
                    var field = model.Fields.FirstOrDefault<ModelField>(f => f.Name == key.ToString());
                    mappings.Add(field != null ? (field.Mapping.IsNotEmpty() ? field.Mapping : field.Name) : key.ToString(), values[key]);
                }

                this.responseRecords.Add(mappings);
            }
            return eAfterRecordUpdated.ExceptionHandled;
        }
Esempio n. 6
0
        bool UpdateCallback(int recordsAffected, Exception exception)
        {
            if (confirmation != null && recordsAffected > 0)
            {
                confirmation.ConfirmRecord();
            }
            AfterRecordUpdatedEventArgs eAfterRecordUpdated = new AfterRecordUpdatedEventArgs(record, recordsAffected, exception, keys, values, oldValues, confirmation);
            this.OnAfterRecordUpdated(eAfterRecordUpdated);

            return eAfterRecordUpdated.ExceptionHandled;
        }