Пример #1
0
        public decimal CalculatePremium(int occupIationID, int age, int deathcoveramount)
        {
            decimal premium = 0;

            try
            {
                Occupation ocup = repoOccupation.FindSingle(x => x.ID == occupIationID);
                if (ocup != null)
                {
                    decimal factor = ocup.OccupationRating.Factor;
                    premium = (deathcoveramount * factor * age) / (1000 * 12);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message + "\n" + e.StackTrace);
            }
            return(premium);
        }