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);
                }
            }
        }
 /// <summary>
 /// The update.
 /// </summary>
 /// <param name="other">
 /// The other.
 /// </param>
 /// <param name="context">
 /// The context.
 /// </param>
 public void Update(PaymentTableIndicator other, IModelContext context)
 {
     if ((this.GoalPayment is null && !(other.GoalPayment is null)) ||
         !this.GoalPayment.Equals(other.GoalPayment))
     {
         if (this.GoalPayment is null || other.GoalPayment is null)
         {
             this.GoalPayment = other.GoalPayment;
             context.SetModified(this);
         }