using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using ChuPiao.Common.Enums;

namespace ChuPiao.Common.Utils
{
    /// <summary>
    /// 彩票机类型hash表，方便根据彩票机类型编号查找对应的名称
    /// </summary>
    public class MachineTypeHashTable
    {
        static MachineTypeHashTable()
        {
            EnumDescription[] arr = EnumDescription.GetFieldTexts(typeof(MachineType));
            if (null != arr && arr.Length > 0)
            {
                foreach (EnumDescription des in arr)
                {
                    MachineTypeHashtable.Add(des.EnumValue, des.EnumDisplayText);
                }
            }
            
        }

        public static Hashtable MachineTypeHashtable = new Hashtable();

        /// <summary>
        /// 根据彩票机类型ID查找对应的名称
        /// </summary>
        /// <param name="MachineTypeID"></param>
        /// <returns></returns>
        public static string GetMachineTypeName(int MachineTypeID)
        {
            if (MachineTypeHashtable.Contains(MachineTypeID))
            {
                return MachineTypeHashtable[MachineTypeID].ToString();
            }
            else
            {
                return "";
            }
        }
    }
}
