Ejemplo n.º 1
0
        public void Add(string depositName, decimal minimumAmount, decimal maximumAmount, DepositType depositType,
                        string contractualInterest, Currency currency, InterestPayment interestPayment, DepositFor depositFor,
                        InterestType interestType, IncreasingAmount increasingAmount, OverdraftOpportunity overdraftOpportunity,
                        CreditOpportunity creditOpportunity, InterestCapitalize interestCapitalize, string maximumMonthPeriod,
                        string minimumMonthPeriod, string validDepositDeadlines, ValidForCustomer validForCustomer,
                        MonthlyAccrual monthlyAccrual, string additionalTerms, string bonuses, int bankId,
                        decimal interestForOneMonth, decimal interestForThreeMonths, decimal interestForSixMonths,
                        decimal interestForNineMonths, decimal interestForTwelveMonths, decimal interestForEighteenMonths,
                        decimal interestForTwentyFourMonths, decimal interestForThirtySixMonths, decimal interestForFortyEightMonths,
                        decimal interestForSixtyMonths)
        {
            var bank = this.banksService.GetById <Bank>(bankId);

            var deposit = new Deposit
            {
                Name                        = depositName,
                MinimumAmount               = minimumAmount,
                MaximumAmount               = maximumAmount,
                DepositType                 = depositType,
                ContractualInterest         = contractualInterest,
                Currency                    = currency,
                InterestPayment             = interestPayment,
                InterestType                = interestType,
                IncreasingAmount            = increasingAmount,
                DepositFor                  = depositFor,
                OverdraftOpportunity        = overdraftOpportunity,
                CreditOpportunity           = creditOpportunity,
                InterestCapitalize          = interestCapitalize,
                MaximumMonthPeriod          = maximumMonthPeriod,
                MinimumMonthPeriod          = minimumMonthPeriod,
                ValidDepositDeadlines       = validDepositDeadlines,
                ValidForCustomer            = validForCustomer,
                MonthlyAccrual              = monthlyAccrual,
                AdditionalTerms             = additionalTerms,
                Bonuses                     = bonuses,
                Bank                        = bank,
                InterestForOneMonth         = interestForOneMonth,
                InterestForThreeMonths      = interestForThreeMonths,
                InterestForSixMonths        = interestForSixMonths,
                InterestForNineMonths       = interestForNineMonths,
                InterestForTwelveMonths     = interestForTwelveMonths,
                InterestForEighteenMonths   = interestForEighteenMonths,
                InterestForTwentyFourMonths = interestForTwentyFourMonths,
                InterestForThirtySixMonths  = interestForThirtySixMonths,
                InterestForFortyEightMonths = interestForFortyEightMonths,
                InterestForSixtyMonths      = interestForSixtyMonths
            };

            this.dbContext.Deposits.Add(deposit);
            this.dbContext.SaveChanges();
        }
Ejemplo n.º 2
0
        public void Edit(int depositId, string depositName, decimal minimumAmount, decimal maximumAmount,
                         DepositType depositType, string contractualInterest, Currency currency, InterestPayment interestPayment,
                         DepositFor depositFor, InterestType interestType, IncreasingAmount increasingAmount,
                         OverdraftOpportunity overdraftOpportunity, CreditOpportunity creditOpportunity,
                         InterestCapitalize interestCapitalize, string maximumMonthPeriod, string minimumMonthPeriod,
                         string validDepositDeadlines, ValidForCustomer validForCustomer, MonthlyAccrual monthlyAccrual,
                         string additionalTerms, string bonuses, int bankId,
                         decimal interestForOneMonth, decimal interestForThreeMonths, decimal interestForSixMonths,
                         decimal interestForNineMonths, decimal interestForTwelveMonths, decimal interestForEighteenMonths,
                         decimal interestForTwentyFourMonths, decimal interestForThirtySixMonths, decimal interestForFortyEightMonths,
                         decimal interestForSixtyMonths)
        {
            var deposit = this.dbContext.Deposits.FirstOrDefault(d => d.Id == depositId);

            deposit.Name                        = depositName;
            deposit.MinimumAmount               = minimumAmount;
            deposit.MaximumAmount               = maximumAmount;
            deposit.DepositType                 = depositType;
            deposit.ContractualInterest         = contractualInterest;
            deposit.Currency                    = currency;
            deposit.InterestPayment             = interestPayment;
            deposit.DepositFor                  = depositFor;
            deposit.InterestType                = interestType;
            deposit.IncreasingAmount            = increasingAmount;
            deposit.OverdraftOpportunity        = overdraftOpportunity;
            deposit.CreditOpportunity           = creditOpportunity;
            deposit.InterestCapitalize          = interestCapitalize;
            deposit.MaximumMonthPeriod          = maximumMonthPeriod;
            deposit.MinimumMonthPeriod          = minimumMonthPeriod;
            deposit.ValidDepositDeadlines       = validDepositDeadlines;
            deposit.ValidForCustomer            = validForCustomer;
            deposit.MonthlyAccrual              = monthlyAccrual;
            deposit.AdditionalTerms             = additionalTerms;
            deposit.Bonuses                     = bonuses;
            deposit.BankId                      = bankId;
            deposit.InterestForOneMonth         = interestForOneMonth;
            deposit.InterestForThreeMonths      = interestForThreeMonths;
            deposit.InterestForSixMonths        = interestForSixMonths;
            deposit.InterestForNineMonths       = interestForNineMonths;
            deposit.InterestForTwelveMonths     = interestForTwelveMonths;
            deposit.InterestForTwentyFourMonths = interestForTwentyFourMonths;
            deposit.InterestForThirtySixMonths  = interestForThirtySixMonths;
            deposit.InterestForFortyEightMonths = interestForFortyEightMonths;
            deposit.InterestForSixtyMonths      = interestForSixtyMonths;

            this.dbContext.Update(deposit);
            this.dbContext.SaveChanges();
        }