public static decimal CalcInterest(LoanAccount account, DateTime startDate)
        {
            int months = (int)(DateTime.Now.Date - account.StartDate).TotalDays / 30;
            if (account.Owner is PersonCustomer)
            {
                if (months < 3)
                {
                    return 0m;
                }
            }
            else if (account.Owner is OrganizationCustomer)
            {
                if (months < 2)
                {
                    return 0m;
                }
            }

            return months * account.InterestRate;
        }
Beispiel #2
0
        public static decimal CalcInterest(LoanAccount account, DateTime startDate)
        {
            int months = (int)(DateTime.Now.Date - account.StartDate).TotalDays / 30;

            if (account.Owner is PersonCustomer)
            {
                if (months < 3)
                {
                    return(0m);
                }
            }
            else if (account.Owner is OrganizationCustomer)
            {
                if (months < 2)
                {
                    return(0m);
                }
            }

            return(months * account.InterestRate);
        }