Пример #1
0
        public static decimal CalcInterest(MortgageAccount account, DateTime startDate)
        {
            int months = (int)(DateTime.Now.Date - account.StartDate).TotalDays / 30;
            if (account.Owner is PersonCustomer)
            {
                if (months < 6)
                {
                    return 0m;
                }
            }
            else if (account.Owner is OrganizationCustomer)
            {
                if (months < 12)
                {
                    return months * account.InterestRate / 2m;
                }
            }

            return months * account.InterestRate;
        }
Пример #2
0
        public static decimal CalcInterest(MortgageAccount account, DateTime startDate)
        {
            int months = (int)(DateTime.Now.Date - account.StartDate).TotalDays / 30;

            if (account.Owner is PersonCustomer)
            {
                if (months < 6)
                {
                    return(0m);
                }
            }
            else if (account.Owner is OrganizationCustomer)
            {
                if (months < 12)
                {
                    return(months * account.InterestRate / 2m);
                }
            }

            return(months * account.InterestRate);
        }