ForecourtConfig.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Dfs.WayneChina.IMisPlus.Models
  6. {
  7. /// <summary>
  8. /// Forecourt config
  9. /// </summary>
  10. public class ForecourtConfig
  11. {
  12. #region Constructor
  13. public ForecourtConfig()
  14. {
  15. Dispensers = new List<Dispenser>();
  16. Pumps = new List<Pump>();
  17. Tanks = new List<Tank>();
  18. Terminals = new List<Terminal>();
  19. Fuels = new List<Fuel>();
  20. }
  21. #endregion
  22. public bool IsConfigValid()
  23. {
  24. if (string.IsNullOrEmpty(CurrentVersion))
  25. return false;
  26. if (Terminals.Count == 0 || Pumps.Count == 0 || Pumps.Count > 0 && Pumps.Any(p => p.Nozzles.Count == 0))
  27. return false;
  28. return true;
  29. }
  30. public string CurrentVersion { get; set; }
  31. public IList<Dispenser> Dispensers { get; set; }
  32. public IList<Pump> Pumps { get; set; }
  33. public IList<Tank> Tanks { get; set; }
  34. public IList<Terminal> Terminals { get; set; }
  35. public IList<Fuel> Fuels { get; set; }
  36. }
  37. }