public MaterialBase() { this.inTxn = false; this._site = null; this.entityData = new MaterialEntityData(); this.backupData = null; }
void IEditableObject.BeginEdit() { if (!this.inTxn) { this.backupData = this.entityData.Clone() as MaterialEntityData; this.inTxn = true; } }
void IEditableObject.CancelEdit() { if (this.inTxn) { this.entityData = this.backupData; this.backupData = null; this.inTxn = false; if (base.bindingIsNew && (this.parentCollection != null)) { this.parentCollection.Remove((Material)this); } } }
public MaterialBase(int materialMaterialCode, string materialMaterialName, string materialGroupCode, string materialSpec, string materialUnit, decimal?materialStandardPrice, string materialInputPerson, DateTime?materialInputDate, string materialRemark) { this.inTxn = false; this._site = null; this.entityData = new MaterialEntityData(); this.backupData = null; this.MaterialCode = materialMaterialCode; this.MaterialName = materialMaterialName; this.GroupCode = materialGroupCode; this.Spec = materialSpec; this.Unit = materialUnit; this.StandardPrice = materialStandardPrice; this.InputPerson = materialInputPerson; this.InputDate = materialInputDate; this.Remark = materialRemark; }
void IEditableObject.EndEdit() { if (this.inTxn) { this.backupData = null; if (base.IsDirty) { if (base.bindingIsNew) { this.EntityState = EntityState.Added; base.bindingIsNew = false; } else if (this.EntityState == EntityState.Unchanged) { this.EntityState = EntityState.Changed; } } base.bindingIsNew = false; this.inTxn = false; } }