using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.MorkTJuicer { internal enum GOODS_TYPE { /// /// 未知 /// NEITHER, /// /// 果汁 /// JUICE } internal enum BATCHING_CLASS { HOLDER, MAIN_MATERIAL, } internal class PolymerBatching { internal const string Juicer_MAIN_BATCHIN1_LOC = "52"; internal const string Juicer_MAIN_BATCHIN2_LOC = "53"; internal const string Juicer_MAIN_BATCHIN3_LOC = "54"; internal const string Juicer_MAIN_BATCHIN4_LOC = "55"; internal const string COFFEE_HOLDER_LOC = "30"; internal const string TEA_HOLDER_LOC = "51"; public static Dictionary GOODS_TYPES = new Dictionary() { {Juicer_MAIN_BATCHIN1_LOC,GOODS_TYPE.JUICE}, {Juicer_MAIN_BATCHIN2_LOC,GOODS_TYPE.JUICE}, {Juicer_MAIN_BATCHIN3_LOC,GOODS_TYPE.JUICE}, {Juicer_MAIN_BATCHIN4_LOC,GOODS_TYPE.JUICE}, }; public GOODS_TYPE GoodsType { get; set; } public BATCHING_CLASS BatchingClass { get; set; } private string loc; public string Loc { get { return loc; } set { loc = value; if (GOODS_TYPES.ContainsKey(loc)) GoodsType = GOODS_TYPES[loc]; switch (loc) { case COFFEE_HOLDER_LOC: case TEA_HOLDER_LOC: BatchingClass = BATCHING_CLASS.HOLDER; break; default: BatchingClass = BATCHING_CLASS.MAIN_MATERIAL; break; } } } internal static Dictionary BuildAll() { Dictionary temp = new Dictionary(); foreach (var item in GOODS_TYPES) { temp.Add(item.Key, new PolymerBatching() { Loc = item.Key }); } return temp; } } }