using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XYY.Service.Standard.Finance.Charging.Express
{
    public class ExpressFeeChangesException : Exception
    {
        /// <summary>
        /// 数据库连接错误
        /// </summary>
        public static readonly int DB_ConnectionError = 1000001;

        /// <summary>
        /// Redis连接错误
        /// </summary>
        public static readonly int Redis_ConnectionError = 1000002;

        /// <summary>
        /// 无匹配总报价
        /// </summary>
        public static readonly int Fee_NoQuotaion = 100003;

        /// <summary>
        /// 无匹配明细报价
        /// </summary>
        public static readonly int Fee_NoQuotaionDetail = 100004;


        private int code { get; set; }

        private static Dictionary<int, String> msgMap = new Dictionary<int, String>();
        static ExpressFeeChangesException()
        {
            msgMap[DB_ConnectionError] = "数据库连接错误";
            msgMap[Redis_ConnectionError] = "Redis连接错误";
            msgMap[Fee_NoQuotaion] = "无匹配总报价";
            msgMap[Fee_NoQuotaionDetail] = "无匹配明细报价"; 
        }


        public ExpressFeeChangesException(int exceptionCode) : base(msgMap[exceptionCode])
        {
            this.code = exceptionCode;
        }
    }
}
