Beispiel #1
0
 public MaterialBase()
 {
     this.inTxn      = false;
     this._site      = null;
     this.entityData = new MaterialEntityData();
     this.backupData = null;
 }
Beispiel #2
0
 void IEditableObject.BeginEdit()
 {
     if (!this.inTxn)
     {
         this.backupData = this.entityData.Clone() as MaterialEntityData;
         this.inTxn      = true;
     }
 }
Beispiel #3
0
 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);
         }
     }
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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;
     }
 }