public void MigrateDependenciesTo(Payout migrationTarget) { if (Identity > 0 && migrationTarget.Identity > 0) { // Persisted payout migration SwarmDb.GetDatabaseForWriting().MovePayoutDependencies(Identity, migrationTarget.Identity); } else { // In-memory migration: this payout isn't in database yet this.DependentCashAdvancesPayback.ForEach(item => migrationTarget.DependentCashAdvancesPayback.Add(item)); this.DependentCashAdvancesPayout.ForEach(item => migrationTarget.DependentCashAdvancesPayout.Add(item)); this.DependentExpenseClaims.ForEach(item => migrationTarget.DependentExpenseClaims.Add(item)); this.DependentInvoices.ForEach(item => migrationTarget.DependentInvoices.Add(item)); this.DependentSalariesNet.ForEach(item => migrationTarget.DependentSalariesNet.Add(item)); this.DependentSalariesTax.ForEach(item => migrationTarget.DependentSalariesTax.Add(item)); this.DependentCashAdvancesPayback = new CashAdvances(); this.DependentCashAdvancesPayout = new CashAdvances(); this.DependentExpenseClaims = new ExpenseClaims(); this.DependentInvoices = new InboundInvoices(); this.DependentSalariesNet = new Salaries(); this.DependentSalariesTax = new Salaries(); } migrationTarget.RecalculateAmount(); RecalculateAmount(); }
public void MigrateDependenciesTo(Payout migrationTarget) { SwarmDb.GetDatabaseForWriting().MovePayoutDependencies(Identity, migrationTarget.Identity); migrationTarget.RecalculateAmount(); RecalculateAmount(); }
public void MigrateDependenciesTo (Payout migrationTarget) { SwarmDb.GetDatabaseForWriting().MovePayoutDependencies(this.Identity, migrationTarget.Identity); migrationTarget.RecalculateAmount(); this.RecalculateAmount(); }