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

namespace ChuPiao.Common.Utils
{
    public class TicketStatusHashTable
    {
        static TicketStatusHashTable()
        {
            EnumDescription[] arr = EnumDescription.GetFieldTexts(typeof(TicketStatus));
            if (null != arr && arr.Length > 0)
            {
                foreach (EnumDescription Enum in arr)
                {
                    if (!TicketStatusHashtable.Contains(Enum.EnumValue))
                    {
                        TicketStatusHashtable.Add(Enum.EnumValue, Enum.EnumDisplayText);
                    }
                }
    
            }
        }

        private static Hashtable TicketStatusHashtable = new Hashtable();

        public static string GetStringByCode(int code)
        {
            if (TicketStatusHashtable.Contains(code))
            {
                return TicketStatusHashtable[code].ToString();
            }
            else
            {
                return "δ֪״̬";
            }
        }
        public static string GetStringByCode(string code)
        {
            return GetStringByCode(Convert.ToInt32(code));
        }
    }
}
