示例#1
0
        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();
        }
示例#2
0
 public void MigrateDependenciesTo(Payout migrationTarget)
 {
     SwarmDb.GetDatabaseForWriting().MovePayoutDependencies(Identity, migrationTarget.Identity);
     migrationTarget.RecalculateAmount();
     RecalculateAmount();
 }
示例#3
0
 public void MigrateDependenciesTo (Payout migrationTarget)
 {
     SwarmDb.GetDatabaseForWriting().MovePayoutDependencies(this.Identity, migrationTarget.Identity);
     migrationTarget.RecalculateAmount();
     this.RecalculateAmount();
 }