internal void DeleteSelf(RevisionMaterial parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } // if we're new then don't update the database if (this.IsNew) { return; } try { parent.Session().Delete(parent.Session().Get <Material_PlanRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
internal void Update(RevisionMaterial parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidRevision = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } Material_PlanRecord obj = parent.Session().Get <Material_PlanRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }