internal void Update(CreditCard parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidCreditCard = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; CreditCardStatementRecord obj = Session().Get <CreditCardStatementRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public virtual void CopyValues(CreditCardStatementRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_credit_card = source.OidCreditCard; _from = source.From; _till = source.Till; _due_date = source.DueDate; _amount = source.Amount; _comments = source.Comments; }
protected override void DataPortal_Update() { if (IsDirty) { try { CreditCardStatementRecord obj = Session().Get <CreditCardStatementRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); MarkOld(); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } } }