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

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

        private static Hashtable ErrorStatusHashtable = new Hashtable();

        public static string GetStringByCode(int code)
        {
            if (ErrorStatusHashtable.Contains(code))
            {
                return ErrorStatusHashtable[code].ToString();
            }
            else
            {
                return "";
            }
        }
        public static string GetStringByCode(string code)
        {
            return GetStringByCode(Convert.ToInt32(code));
        }
    }
}
