CaseCoefficientStatistics.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net.Http;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace wispro.sp.entity
  8. {
  9. public class CaseCoefficientStatistics
  10. {
  11. public Customer customer { get; set; }
  12. public int Totals { get; set; }
  13. public int ACount { get; set; }
  14. public int SCount { get; set; }
  15. public bool isExceedingLimit()
  16. {
  17. if (customer != null)
  18. {
  19. Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer));
  20. double dARate = 0.3;
  21. double dSRate = 0.05;
  22. if (customer.ARate != null)
  23. {
  24. dARate = Convert.ToDouble(customer.ARate) / 100.00;
  25. }
  26. if (customer.SRate != null)
  27. {
  28. dSRate = Convert.ToDouble(customer.SRate) / 100.00;
  29. }
  30. if (Totals > 0)
  31. {
  32. if (Convert.ToDouble(ACount) / Convert.ToDouble(Totals) > dARate ||
  33. Convert.ToDouble(SCount) / Convert.ToDouble(Totals) > dSRate)
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. }
  42. }