Exemple #1
0
        /// <summary>
        /// Pushes changes since the last <c>BeginEdit</c> or <c>IBindingList.AddNew</c> call into the underlying object.
        /// </summary>
        void IEditableObject.EndEdit()
        {
            //Console.WriteLine("Start EndEdit" + this.custData.id + this.custData.lastName);
            if (this.inTxn)
            {
                this.backupData = null;
                if (this.IsDirty)
                {
                    if (this.bindingIsNew)
                    {
                        this.EntityState  = EntityState.Added;
                        this.bindingIsNew = false;
                    }
                    else
                    if (this.EntityState == EntityState.Unchanged)
                    {
                        this.EntityState = EntityState.Changed;
                    }
                }

                this.bindingIsNew = false;
                this.inTxn        = false;
            }
            //Console.WriteLine("End EndEdit");
        }
Exemple #2
0
            /// <summary>
            /// Creates a new object that is a copy of the current instance.
            /// </summary>
            /// <returns>A new object that is a copy of this instance.</returns>
            public object Clone(IDictionary existingCopies)
            {
                if (existingCopies == null)
                {
                    existingCopies = new Hashtable();
                }

                AwBuildVersionEntityData _tmp = new AwBuildVersionEntityData();

                _tmp.SystemInformationId = this.SystemInformationId;

                _tmp.DatabaseVersion = this.DatabaseVersion;
                _tmp.VersionDate     = this.VersionDate;
                _tmp.ModifiedDate    = this.ModifiedDate;

                #region Source Parent Composite Entities
                #endregion

                #region Child Collections
                #endregion Child Collections

                //EntityState
                _tmp.EntityState = this.EntityState;

                return(_tmp);
            }
Exemple #3
0
        /// <summary>
        /// Accepts the changes made to this object.
        /// </summary>
        /// <remarks>
        /// After calling this method, properties: IsDirty, IsNew are false. IsDeleted flag remains unchanged as it is handled by the parent List.
        /// </remarks>
        public override void AcceptChanges()
        {
            base.AcceptChanges();

            // we keep of the original version of the data
            this._originalData = null;
            this._originalData = this.entityData.Clone() as AwBuildVersionEntityData;
        }
Exemple #4
0
        ///<summary>
        /// Creates a new <see cref="AwBuildVersionBase"/> instance.
        ///</summary>
        ///<param name="_databaseVersion">Version number of the database in 9.yy.mm.dd.00 format.</param>
        ///<param name="_versionDate">Date and time the record was last updated.</param>
        ///<param name="_modifiedDate">Date and time the record was last updated.</param>
        public AwBuildVersionBase(System.String _databaseVersion, System.DateTime _versionDate,
                                  System.DateTime _modifiedDate)
        {
            this.entityData = new AwBuildVersionEntityData();
            this.backupData = null;

            this.DatabaseVersion = _databaseVersion;
            this.VersionDate     = _versionDate;
            this.ModifiedDate    = _modifiedDate;
        }
Exemple #5
0
 /// <summary>
 /// Begins an edit on an object.
 /// </summary>
 void IEditableObject.BeginEdit()
 {
     //Console.WriteLine("Start BeginEdit");
     if (!inTxn)
     {
         this.backupData = this.entityData.Clone() as AwBuildVersionEntityData;
         inTxn           = true;
         //Console.WriteLine("BeginEdit");
     }
     //Console.WriteLine("End BeginEdit");
 }
Exemple #6
0
        ///<summary>
        /// Revert all changes and restore original values.
        ///</summary>
        public override void CancelChanges()
        {
            IEditableObject obj = (IEditableObject)this;

            obj.CancelEdit();

            this.entityData = null;
            if (this._originalData != null)
            {
                this.entityData = this._originalData.Clone() as AwBuildVersionEntityData;
            }
            else
            {
                //Since this had no _originalData, then just reset the entityData with a new one.  entityData cannot be null.
                this.entityData = new AwBuildVersionEntityData();
            }
        }
Exemple #7
0
        /// <summary>
        /// Discards changes since the last <c>BeginEdit</c> call.
        /// </summary>
        void IEditableObject.CancelEdit()
        {
            //Console.WriteLine("Start CancelEdit");
            if (this.inTxn)
            {
                this.entityData = this.backupData;
                this.backupData = null;
                this.inTxn      = false;

                if (this.bindingIsNew)
                //if (this.EntityState == EntityState.Added)
                {
                    if (this.parentCollection != null)
                    {
                        this.parentCollection.Remove((AwBuildVersion)this);
                    }
                }
            }
            //Console.WriteLine("End CancelEdit");
        }
Exemple #8
0
            /// <summary>
            /// Creates a new object that is a copy of the current instance.
            /// </summary>
            /// <returns>A new object that is a copy of this instance.</returns>
            public Object Clone()
            {
                AwBuildVersionEntityData _tmp = new AwBuildVersionEntityData();

                _tmp.SystemInformationId = this.SystemInformationId;

                _tmp.DatabaseVersion = this.DatabaseVersion;
                _tmp.VersionDate     = this.VersionDate;
                _tmp.ModifiedDate    = this.ModifiedDate;

                #region Source Parent Composite Entities
                #endregion

                #region Child Collections
                #endregion Child Collections

                //EntityState
                _tmp.EntityState = this.EntityState;

                return(_tmp);
            }
Exemple #9
0
 ///<summary>
 /// Creates a new <see cref="AwBuildVersionBase"/> instance.
 ///</summary>
 public AwBuildVersionBase()
 {
     this.entityData = new AwBuildVersionEntityData();
     this.backupData = null;
 }