Пример #1
0
        protected override void RowChanged(object sender, RowChangedEventArgs e)
        {
            if (this.logger == null)
            {
                return;
            }

            logger.RowChanged(sender, e);
        }
Пример #2
0
        private bool OnRowChanged(ObjectState state, bool saved)
        {
            if (RowChanged != null)
            {
                RowChangedEventArgs args = new RowChangedEventArgs(this, state, saved);
                RowChanged(this, args);
                return(args.confirmed);
            }

            return(true);
        }
Пример #3
0
        private bool OnRowChanged(ObjectState state, bool saved)
        {
            if (RowChanged != null)
            {
                RowChangedEventArgs args = new RowChangedEventArgs(this, state, saved);
                RowChanged(this, args);
                return args.confirmed;
            }

            return true;
        }
Пример #4
0
 protected virtual void RowChanged(object sender, RowChangedEventArgs e)
 {
 }
Пример #5
0
        /// <summary>
        /// fire RowChanged event when row changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void RowChanged(object sender, RowChangedEventArgs e)
        {
            if (this.logger == null) return;

            logger.RowChanged(sender, e);
        }
Пример #6
0
        public void RowChanged(object sender, RowChangedEventArgs e)
        {
            if (e.state == ObjectState.Added || e.state == ObjectState.Deleted || e.state == ObjectState.Modified)
            {

                if (!log_transaction)
                    throw new MessageException("TransactionID is not assgined yet.");

                if (this.rowID == 0)
                {
                    if (e.saved)      //log after save with identity value created
                    {
                        if (dpoType != null)
                        {
                            DPObject dpo = (DPObject)Activator.CreateInstance(dpoType, new object[] { e.adapter.Row });
                            this.rowID = dpo.RowId;
                        }
                        else if (this.rowIdColumnName != null)
                        {
                            this.rowID = (int)e.adapter.Row[this.rowIdColumnName];
                        }
                        else
                            throw new MessageException("DPO Type is not defined");
                    }
                    else
                        return;
                }

                modified = e.state == ObjectState.Modified;

                if (e.state == ObjectState.Modified || e.state == ObjectState.Added || e.state == ObjectState.Deleted)
                {
                    log_row_id = this.logee.LogRow(log_transaction, this.tableName, this.tableId,  this.rowID, e.state, e.adapter.Row1, e.adapter.Row);

                    logged = log_row_id > 0 ;
                }

            }
        }