NozzleExtraInfoConfiguration.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Edge.Core.Configuration
  8. {
  9. public class NozzleExtraInfoConfiguration
  10. {
  11. public List<NozzleExtraInfo> Mapping { get; set; }
  12. public override bool Equals(object obj)
  13. {
  14. if (obj == null) return false;
  15. if (!(obj is NozzleExtraInfoConfiguration target)) return false;
  16. else
  17. {
  18. if (this.Mapping.Count != target.Mapping.Count) return false;
  19. for (int i = 0; i < this.Mapping.Count; i++)
  20. if (!this.Mapping[i].Equals(target.Mapping[i])) return false;
  21. return true;
  22. }
  23. }
  24. }
  25. /// <summary>
  26. /// For holding extra data binding to a nozzle.
  27. /// </summary>
  28. public class NozzleExtraInfo
  29. {
  30. public int PumpId { get; set; }
  31. public int? SiteLevelNozzleId { get; set; }
  32. public int? TankNumber { get; set; }
  33. public int NozzleLogicalId { get; set; }
  34. public int ProductBarcode { get; set; }
  35. public string ProductName { get; set; }
  36. public string Description { get; set; }
  37. public override bool Equals(object obj)
  38. {
  39. if (obj == null) return false;
  40. if (!(obj is NozzleExtraInfo target)) return false;
  41. else
  42. {
  43. if (this.PumpId != target.PumpId
  44. || this.SiteLevelNozzleId != target.SiteLevelNozzleId
  45. || this.TankNumber != target.TankNumber
  46. || this.NozzleLogicalId != target.NozzleLogicalId
  47. || this.ProductBarcode != target.ProductBarcode)
  48. return false;
  49. return true;
  50. }
  51. }
  52. }
  53. }