using System.ComponentModel; using InABox.Core; namespace Comal.Classes { [UserTracking(typeof(Bill))] public class BillPayment : Entity, IPersistent, IRemotable, IManyToMany, ILicense { [EntityRelationship(DeleteAction.SetNull)] public BillLink BillLink { get; set; } [EntityRelationship(DeleteAction.Cascade)] public PaymentLink PaymentLink { get; set; } [CurrencyEditor] public double Amount { get; set; } protected override void Init() { base.Init(); BillLink.PropertyChanged += BillLinkChanged; } private void BillLinkChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName.Equals("Balance")) Amount = BillLink.Balance; } } }