using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace wispro.sp.entity { public class CaseCoefficientStatistics { public Customer customer { get; set; } public int Totals { get; set; } public int ACount { get; set; } public int SCount { get; set; } public bool isExceedingLimit() { if (customer != null) { Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer)); double dARate = 0.3; double dSRate = 0.05; if (customer.ARate != null) { dARate = Convert.ToDouble(customer.ARate) / 100.00; } if (customer.SRate != null) { dSRate = Convert.ToDouble(customer.SRate) / 100.00; } if (Totals > 0) { if (Convert.ToDouble(ACount) / Convert.ToDouble(Totals) > dARate || Convert.ToDouble(SCount) / Convert.ToDouble(Totals) > dSRate) { return true; } } } return false; } } }