/// <summary>
 /// Create a new CommissionTranche based on a commission tranche row from the DataModel.
 /// </summary>
 /// <param name="commissionTranche">The commission tranche to base this new tranche on.</param>
 public CommissionTranche(CommissionTranche commissionTranche)
 {
     this.commissionScheduleId = commissionTranche.CommissionScheduleId;
     this.commissionTrancheId  = commissionTranche.CommissionTrancheId;
     this.commissionType       = commissionTranche.CommissionType;
     this.commissionUnit       = commissionTranche.CommissionUnit;
     this.rowVersion           = commissionTranche.RowVersion;
     this.startRange           = commissionTranche.StartRange;
     this.endRange             = commissionTranche.EndRange;
     this.value = commissionTranche.Value;
 }
Пример #2
0
        /// <summary>
        /// Update the schedule from another one.
        /// </summary>
        /// <param name="commissionSchedule">The source of updated information.</param>
        public void Update(CommissionScheduleRow commissionSchedule)
        {
            this.Name       = commissionSchedule.IsNameNull()? null : commissionSchedule.Name;
            this.rowVersion = commissionSchedule.RowVersion;

//			foreach (CommissionTranche commissionTranche in this.CommissionTranches)
//				commissionTranche.PropertyChanged -= this.OnCommissionTrancheChanged;
            this.CommissionTranches.Clear();

            foreach (CommissionTrancheRow commissionTrancheRow in commissionSchedule.GetCommissionTrancheRows())
            {
                CommissionTranche commissionTranche = new CommissionTranche(commissionTrancheRow);
//				commissionTranche.PropertyChanged += this.OnCommissionTrancheChanged;
                this.CommissionTranches.Add(commissionTranche);
            }
        }