CalCulationFormula.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 CalCulationFormula
  9. {
  10. /// <summary>
  11. /// 公式id
  12. /// </summary>
  13. public int formula_id { get; set; }
  14. /// <summary>
  15. /// 公式名
  16. /// </summary>
  17. public string formula_name { get; set; }
  18. /// <summary>
  19. /// 公式
  20. /// </summary>
  21. public string formula { get; set; }
  22. /// <summary>
  23. /// 转换后公式
  24. /// </summary>
  25. public string formula_transform { get; set; }
  26. /// <summary>
  27. /// 计算后值
  28. /// </summary>
  29. public object value { get; set; }
  30. public override bool Equals(object o)
  31. {
  32. if (this == o)
  33. {
  34. return true;
  35. }
  36. //内存地址不相等,就得比属性
  37. if (o is CalCulationFormula)
  38. {
  39. CalCulationFormula item = (CalCulationFormula)o;
  40. return formula_id == item.formula_id &&
  41. formula_name.Equals(item.formula_name);
  42. }
  43. return false;
  44. }
  45. public override int GetHashCode()
  46. {
  47. int hash = 17;
  48. hash = hash * 23 + formula_id.GetHashCode();
  49. hash = hash * 23 + formula_name.GetHashCode();
  50. return hash;
  51. }
  52. }
  53. }