终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

78 строки
2.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace BPASmartClient.MorkTJuicer
  7. {
  8. internal enum GOODS_TYPE
  9. {
  10. /// <summary>
  11. /// 未知
  12. /// </summary>
  13. NEITHER,
  14. /// <summary>
  15. /// 果汁
  16. /// </summary>
  17. JUICE
  18. }
  19. internal enum BATCHING_CLASS
  20. {
  21. HOLDER,
  22. MAIN_MATERIAL,
  23. }
  24. internal class PolymerBatching
  25. {
  26. internal const string Juicer_MAIN_BATCHIN1_LOC = "52";
  27. internal const string Juicer_MAIN_BATCHIN2_LOC = "53";
  28. internal const string Juicer_MAIN_BATCHIN3_LOC = "54";
  29. internal const string Juicer_MAIN_BATCHIN4_LOC = "55";
  30. internal const string COFFEE_HOLDER_LOC = "30";
  31. internal const string TEA_HOLDER_LOC = "51";
  32. public static Dictionary<string, GOODS_TYPE> GOODS_TYPES = new Dictionary<string, GOODS_TYPE>() {
  33. {Juicer_MAIN_BATCHIN1_LOC,GOODS_TYPE.JUICE},
  34. {Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE},
  35. {Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE},
  36. {Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE},
  37. };
  38. public GOODS_TYPE GoodsType { get; set; }
  39. public BATCHING_CLASS BatchingClass { get; set; }
  40. private string loc;
  41. public string Loc
  42. {
  43. get { return loc; }
  44. set
  45. {
  46. loc = value;
  47. if (GOODS_TYPES.ContainsKey(loc))
  48. GoodsType = GOODS_TYPES[loc];
  49. switch (loc)
  50. {
  51. case COFFEE_HOLDER_LOC:
  52. case TEA_HOLDER_LOC:
  53. BatchingClass = BATCHING_CLASS.HOLDER;
  54. break;
  55. default:
  56. BatchingClass = BATCHING_CLASS.MAIN_MATERIAL;
  57. break;
  58. }
  59. }
  60. }
  61. internal static Dictionary<string, PolymerBatching> BuildAll()
  62. {
  63. Dictionary<string, PolymerBatching> temp = new Dictionary<string, PolymerBatching>();
  64. foreach (var item in GOODS_TYPES)
  65. {
  66. temp.Add(item.Key, new PolymerBatching() { Loc = item.Key });
  67. }
  68. return temp;
  69. }
  70. }
  71. }