using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HBLConsole.MORKIC { internal enum GOODS_TYPE { NEITHER, COFFEE, ICECREAM, } internal enum BATCHING_CLASS { HOLDER, MAIN_MATERIAL, } internal class PolymerBatching { public static Dictionary GOODS_TYPES = new Dictionary() { {"1", GOODS_TYPE.COFFEE}, {"2", GOODS_TYPE.COFFEE}, {"3", GOODS_TYPE.COFFEE}, {"4", GOODS_TYPE.COFFEE}, {"5", GOODS_TYPE.COFFEE}, {"6", GOODS_TYPE.COFFEE}, {"7", GOODS_TYPE.COFFEE}, {"8", GOODS_TYPE.COFFEE}, {"9", GOODS_TYPE.COFFEE}, {"10",GOODS_TYPE.COFFEE}, {"11",GOODS_TYPE.COFFEE}, {"12",GOODS_TYPE.COFFEE}, {"13",GOODS_TYPE.COFFEE}, {"14",GOODS_TYPE.COFFEE}, {"15",GOODS_TYPE.COFFEE}, {"16",GOODS_TYPE.COFFEE}, {"17",GOODS_TYPE.COFFEE}, {"18",GOODS_TYPE.COFFEE}, {"19",GOODS_TYPE.COFFEE}, {"20",GOODS_TYPE.COFFEE}, {"21",GOODS_TYPE.COFFEE}, {"22",GOODS_TYPE.COFFEE}, {"23",GOODS_TYPE.COFFEE}, {"24",GOODS_TYPE.COFFEE}, {"25",GOODS_TYPE.COFFEE}, {"30",GOODS_TYPE.COFFEE}, {"51",GOODS_TYPE.ICECREAM}, {"52",GOODS_TYPE.ICECREAM}, {"53",GOODS_TYPE.ICECREAM}, }; 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 "30": case "51": case "52": 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; } } }