| 123456789101112131415161718192021222324252627282930313233 | using System.ComponentModel;using InABox.Core;namespace Comal.Classes{    [UserTracking(typeof(Invoice))]    public class InvoiceReceipt : Entity, IPersistent, IRemotable, IManyToMany<Invoice, Receipt>, IManyToMany<Receipt, Invoice>, ILicense<AccountsReceivableLicense>    {        [EntityRelationship(DeleteAction.SetNull)]        public InvoiceLink InvoiceLink { get; set; }        [EntityRelationship(DeleteAction.Cascade)]        public ReceiptLink ReceiptLink { get; set; }        [TextBoxEditor]        public string Notes { get; set; }        [CurrencyEditor(Summary = Summary.Sum)]        public double Amount { get; set; }        protected override void Init()        {            base.Init();            InvoiceLink.PropertyChanged += InvoiceLinkChanged;        }        private void InvoiceLinkChanged(object sender, PropertyChangedEventArgs e)        {            if (e.PropertyName.Equals("Balance"))                Amount = InvoiceLink.Balance;        }    }}
 |