public int Save(BaseDat olddat) { try { HDWrapper <HD> old = (HDWrapper <HD>)olddat; this.DataAccessor.TransactionBegin(); int ret = 0; if (!old.Header.EqualDat(this.Header)) { ret = Header.Save(); } foreach (Type key in _details.Keys) { Details[key].SaveSet(old.Details[key].DetSet); } this.DataAccessor.TransactionCommit(); return(ret); } catch { this.DataAccessor.TransactionRollback(); throw; } }
public override bool EqualDat(BaseDat dat) { if (dat != null) { HDWrapper <HD> x = (HDWrapper <HD>)dat; return(CompareDat(Header, x.Header)); } else { return(false); } }
public override void CopyTo(BaseDat dat) { HDWrapper <HD> to = (HDWrapper <HD>)dat; this.Header.CopyTo(to.Header); to.Details = new Dictionary <Type, IDetailsWrapper>(); foreach (Type key in _details.Keys) { to.Details.Add(key, (IDetailsWrapper)_details[key].Clone()); } }