Esempio n. 1
0
        /// <summary>
        /// Raises the <see cref="ColumnChanged" /> event.
        /// </summary>
        /// <param name="column">The <see cref="DepartmentColumn"/> which has raised the event.</param>
        /// <param name="value">The changed value.</param>
        public virtual void OnColumnChanged(DepartmentColumn column, object value)
        {
            if (!SuppressEntityEvents)
            {
                DepartmentEventHandler handler = ColumnChanged;
                if (handler != null)
                {
                    handler(this, new DepartmentEventArgs(column, value));
                }

                // warn the parent list that i have changed
                OnEntityChanged();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Raises the <see cref="ColumnChanging" /> event.
        /// </summary>
        /// <param name="column">The <see cref="DepartmentColumn"/> which has raised the event.</param>
        /// <param name="value">The changed value.</param>
        public virtual void OnColumnChanging(DepartmentColumn column, object value)
        {
            if (IsEntityTracked && EntityState != EntityState.Added && !EntityManager.TrackChangedEntities)
            {
                EntityManager.StopTracking(entityTrackingKey);
            }

            if (!SuppressEntityEvents)
            {
                DepartmentEventHandler handler = ColumnChanging;
                if (handler != null)
                {
                    handler(this, new DepartmentEventArgs(column, value));
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Determines whether the property value has changed from the original data.
        /// </summary>
        /// <param name="column">The column.</param>
        /// <returns>
        ///     <c>true</c> if the property value has changed; otherwise, <c>false</c>.
        /// </returns>
        public bool IsPropertyChanged(DepartmentColumn column)
        {
            switch (column)
            {
            case DepartmentColumn.DepartmentName:
                return(entityData.DepartmentName != _originalData.DepartmentName);

            case DepartmentColumn.CreatedDate:
                return(entityData.CreatedDate != _originalData.CreatedDate);

            case DepartmentColumn.UpdatedDate:
                return(entityData.UpdatedDate != _originalData.UpdatedDate);

            default:
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Determines whether the property value has changed from the original data.
        /// </summary>
        /// <param name="column">The column.</param>
        /// <returns>
        ///     <c>true</c> if the property value has changed; otherwise, <c>false</c>.
        /// </returns>
        public bool IsPropertyChanged(DepartmentColumn column)
        {
            switch (column)
            {
            case DepartmentColumn.DepartmentId:
                return(entityData.DepartmentId != _originalData.DepartmentId);

            case DepartmentColumn.Name:
                return(entityData.Name != _originalData.Name);

            case DepartmentColumn.GroupName:
                return(entityData.GroupName != _originalData.GroupName);

            case DepartmentColumn.ModifiedDate:
                return(entityData.ModifiedDate != _originalData.ModifiedDate);

            default:
                return(false);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:DepartmentComparer"/> class.
 /// </summary>
 /// <param name="column">The column to sort on.</param>
 public DepartmentComparer(DepartmentColumn column)
 {
     this.whichComparison = column;
 }
Esempio n. 6
0
 ///<summary>
 /// Initalizes a new Instance of the DepartmentEventArgs class.
 ///</summary>
 public DepartmentEventArgs(DepartmentColumn column, object value)
 {
     this.column = column;
     this.value  = value;
 }
Esempio n. 7
0
 ///<summary>
 /// Initalizes a new Instance of the DepartmentEventArgs class.
 ///</summary>
 public DepartmentEventArgs(DepartmentColumn column)
 {
     this.column = column;
 }
Esempio n. 8
0
 /// <summary>
 /// Raises the <see cref="ColumnChanged" /> event.
 /// </summary>
 /// <param name="column">The <see cref="DepartmentColumn"/> which has raised the event.</param>
 public virtual void OnColumnChanged(DepartmentColumn column)
 {
     OnColumnChanged(column, null);
     return;
 }