Exemple #1
0
        public bool AddCommercial(Commercial commercial)
        {
            if (this.PostStatus == LedgerPostStatus.Posted)
            {
                throw new Exception("Transaction Posted");
            }

            if (commercial.CommercialPaymentId != null)
            {
                return(false);
            }

            if (this.Commercials == null)
            {
                this.Commercials = new HashSet <Commercial>();
            }

            this.Commercials.Add(commercial);

            commercial.CommercialPaymentId = this.Id;
            commercial.CommercialPayment   = this;
            commercial.UpdatePayment();
            this.UpdateBalance();
            return(true);
        }
Exemple #2
0
        public void RemoveCommercial(Commercial commercial)
        {
            if (commercial == null)
            {
                return;
            }

            this.Commercials.Remove(commercial);
            commercial.CommercialPayment   = null;
            commercial.CommercialPaymentId = null;
            commercial.UpdatePayment();

            this.UpdateBalance();
        }