Example #1
0
        public void Update(PaymentVariable other, IModelContext context)
        {
            this.Name             = other.Name;
            this.Variable         = other.Variable;
            this.ValueReference   = other.ValueReference;
            this.Aditional        = other.Aditional;
            this.AdjustmentFactor = other.AdjustmentFactor;
            this.FixedValue       = other.FixedValue;
            this.Operator         = other.Operator;
            this.Indicator        = other.Indicator;

            context.SetModified(this);

            if (!this.PaymentTableEquals(other.PaymentTables))
            {
                if (this.PaymentTables == null)
                {
                    this.PaymentTables = new List <CompensationPaymentVariablePaymentTable>();
                }

                if (other.PaymentTables != null)
                {
                    other.PaymentTables.ForEach(t => t.PaymentVariable = this);
                    context.AddRemoveCollectionItems(this.PaymentTables, other.PaymentTables, table => table.Id);
                }
            }
        }