CaseCoefficientStatistics.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 ExceedingSLimit()
  16. {
  17. if (customer != null)
  18. {
  19. Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer));
  20. double dSRate = 0.05;
  21. if (customer.SRate != null)
  22. {
  23. dSRate = Convert.ToDouble(customer.SRate) / 100.00;
  24. }
  25. if (Totals > 0)
  26. {
  27. return (Convert.ToDouble(SCount) / Convert.ToDouble(Totals) > dSRate);
  28. }
  29. }
  30. return false;
  31. }
  32. public bool ExceedingALimit()
  33. {
  34. if (customer != null)
  35. {
  36. Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer));
  37. double dARate = 0.3;
  38. if (customer.ARate != null)
  39. {
  40. dARate = Convert.ToDouble(customer.ARate) / 100.00;
  41. }
  42. if (Totals > 0)
  43. {
  44. return (Convert.ToDouble(ACount + SCount) / Convert.ToDouble(Totals) > dARate);
  45. }
  46. }
  47. return false;
  48. }
  49. public bool isExceedingLimit()
  50. {
  51. if (customer != null)
  52. {
  53. Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer));
  54. double dARate = 0.3;
  55. double dSRate = 0.05;
  56. if (customer.ARate != null)
  57. {
  58. dARate = Convert.ToDouble(customer.ARate) / 100.00;
  59. }
  60. if (customer.SRate != null)
  61. {
  62. dSRate = Convert.ToDouble(customer.SRate) / 100.00;
  63. }
  64. if (Totals > 0)
  65. {
  66. return (Convert.ToDouble(ACount + SCount) / Convert.ToDouble(Totals) > dARate ||
  67. Convert.ToDouble(SCount) / Convert.ToDouble(Totals) > dSRate);
  68. }
  69. }
  70. return false;
  71. }
  72. }
  73. }