상속: RecordModifiedEventArgs
예제 #1
0
        bool InsertCallback(int recordsAffected, Exception exception)
        {
            AfterRecordInsertedEventArgs eAfterRecordInserted = new AfterRecordInsertedEventArgs(record, recordsAffected, exception, keys, values);

            this.OnAfterRecordInserted(eAfterRecordInserted);

            if (this.AutomaticResponseValues)
            {
                if (this.keys.Count > 0)
                {
                    IEnumerator enumerator = this.keys.Keys.GetEnumerator();
                    enumerator.MoveNext();
                    string keyName = enumerator.Current as string;
                    this.values[keyName] = this.keys[keyName];
                }
                else
                {
                    throw new Exception("Key value is not defined for inserted record");
                }

                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(eAfterRecordInserted.ExceptionHandled);
        }
예제 #2
0
파일: Store.cs 프로젝트: RabbWhite/ExtNet
        protected virtual void OnAfterRecordInserted(AfterRecordInsertedEventArgs e)
        {
            AfterRecordInsertedEventHandler handler = (AfterRecordInsertedEventHandler)Events[EventAfterRecordInserted];

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #3
0
파일: Store.cs 프로젝트: RabbWhite/ExtNet
        bool InsertCallback(int recordsAffected, Exception exception)
        {
            if (confirmation != null && recordsAffected > 0)
            {
                confirmation.ConfirmRecord();
            }

            AfterRecordInsertedEventArgs eAfterRecordInserted = new AfterRecordInsertedEventArgs(record, recordsAffected, exception, keys, values, confirmation);

            this.OnAfterRecordInserted(eAfterRecordInserted);

            return(eAfterRecordInserted.ExceptionHandled);
        }
예제 #4
0
파일: Store.cs 프로젝트: emayk/Ext.NET.Pro
        protected virtual void OnAfterRecordInserted(AfterRecordInsertedEventArgs e)
        {
            AfterRecordInsertedEventHandler handler = (AfterRecordInsertedEventHandler)Events[EventAfterRecordInserted];

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #5
0
파일: Store.cs 프로젝트: emayk/Ext.NET.Pro
        bool InsertCallback(int recordsAffected, Exception exception)
        {
            AfterRecordInsertedEventArgs eAfterRecordInserted = new AfterRecordInsertedEventArgs(record, recordsAffected, exception, keys, values);
            this.OnAfterRecordInserted(eAfterRecordInserted);

            if (this.AutomaticResponseValues)
            {
                if (this.keys.Count > 0)
                {
                    IEnumerator enumerator = this.keys.Keys.GetEnumerator();
                    enumerator.MoveNext();
                    string keyName = enumerator.Current as string;
                    this.values[keyName] = this.keys[keyName];
                }
                else
                {
                    throw new Exception("Key value is not defined for inserted record");
                }

                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 eAfterRecordInserted.ExceptionHandled;
        }
예제 #6
0
파일: Store.cs 프로젝트: pgodwin/Ext.net
        bool InsertCallback(int recordsAffected, Exception exception)
        {
            if (confirmation != null && recordsAffected > 0)
            {
                confirmation.ConfirmRecord();
            }

            AfterRecordInsertedEventArgs eAfterRecordInserted = new AfterRecordInsertedEventArgs(record, recordsAffected, exception, keys, values, confirmation);
            this.OnAfterRecordInserted(eAfterRecordInserted);

            return eAfterRecordInserted.ExceptionHandled;
        }