| 1234567891011121314151617181920212223242526272829303132 | using System.ComponentModel;using InABox.Core;namespace Comal.Classes{    [UserTracking(typeof(Bill))]    public class BillPayment : Entity, IPersistent, IRemotable, IManyToMany<Bill, Payment>, ILicense<AccountsPayableLicense>    {        [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 = new BillLink();            BillLink.PropertyChanged += BillLinkChanged;            PaymentLink = new PaymentLink();        }        private void BillLinkChanged(object sender, PropertyChangedEventArgs e)        {            if (e.PropertyName.Equals("Balance"))                Amount = BillLink.Balance;        }    }}
 |