CalCulationFormula.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace JLHHJSvr.Com.Model
  7. {
  8. public sealed class FormulaItem
  9. {
  10. /// <summary>
  11. /// 公式名
  12. /// </summary>
  13. public string formula_name { get; set; }
  14. /// <summary>
  15. /// 公式
  16. /// </summary>
  17. public string formula { get; set; }
  18. /// <summary>
  19. /// 转换后公式
  20. /// </summary>
  21. public string formula_transform { get; set; }
  22. /// <summary>
  23. /// 计算后值
  24. /// </summary>
  25. public decimal value { get; set; }
  26. /// <summary>
  27. /// 是否为常量
  28. /// </summary>
  29. public bool isConst { get; set; }
  30. /// <summary>
  31. /// 是否使用sql进行计算
  32. /// </summary>
  33. public bool isSql { get; set; }
  34. public override bool Equals(object o)
  35. {
  36. if (this == o)
  37. {
  38. return true;
  39. }
  40. //内存地址不相等,就得比属性
  41. if (o is FormulaItem)
  42. {
  43. FormulaItem item = (FormulaItem)o;
  44. return formula_name.Equals(item.formula_name);
  45. }
  46. return false;
  47. }
  48. public override int GetHashCode()
  49. {
  50. int hash = 17;
  51. hash = hash * 23 + formula_name.GetHashCode();
  52. return hash;
  53. }
  54. }
  55. }