Exemplo n.º 1
0
        /// <summary>
        /// 获得模板数据的超时时长
        /// </summary>
        /// <param name="chargeMode">计费方式</param>
        /// <returns>分钟数</returns>
        private static int TemplateDataTimeOut(BillingTemplateModel model, ILogger m_logger, ISerializer m_serializer)
        {
            int             timeOut   = 0;
            ITollCalculator tollModel = null;

            switch (model.ChargeMode)
            {
            case 1:
                tollModel = new TollCalculator_Hourly(m_logger, m_serializer);
                break;

            case 2:
                tollModel = new TollCalculator_Segment(m_logger, m_serializer);
                break;

            case 3:
                tollModel = new TollCalculator_ShenZheng(m_logger, m_serializer);
                break;

            case 4:
                tollModel = new TollCalculator_HalfHourly(m_logger, m_serializer);
                break;

            case 5:
                tollModel = new TollCalculator_SimpleSegment(m_logger, m_serializer);
                break;

            case 6:
                tollModel = new TollCalculator_SegmentHourly(m_logger, m_serializer);
                break;

            case 7:
                tollModel = new TollCalculator_SegmentNone(m_logger, m_serializer);
                break;

            case 8:
                tollModel = new TollCalculator_SegmentHalfHour(m_logger, m_serializer);
                break;

            case 9:
                tollModel = new TollCalculator_NewSegment(m_logger, m_serializer);
                break;

            case 10:
                tollModel = new TollCalculator_SegmentQuarterHour(m_logger, m_serializer);
                break;
            }
            if (tollModel != null)
            {
                timeOut = tollModel.GetLeaveTimeOut(model);
            }
            return(timeOut);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 模板数据进行格式化
        /// </summary>
        /// <param name="chargeMode">计费方式</param>
        /// <returns></returns>
        private ITollCalculator TemplateDataFormat(BillingTemplateModel model)
        {
            ITollCalculator tollModel = null;

            switch (model.ChargeMode)
            {
            case 1:
                tollModel = new TollCalculator_Hourly(m_logger, m_serializer);
                break;

            case 2:
                tollModel = new TollCalculator_Segment(m_logger, m_serializer);
                break;

            case 3:
                tollModel = new TollCalculator_ShenZheng(m_logger, m_serializer);
                break;

            case 4:
                tollModel = new TollCalculator_HalfHourly(m_logger, m_serializer);
                break;

            case 5:
                tollModel = new TollCalculator_SimpleSegment(m_logger, m_serializer);
                break;

            case 6:
                tollModel = new TollCalculator_SegmentHourly(m_logger, m_serializer);
                break;

            case 7:
                tollModel = new TollCalculator_SegmentNone(m_logger, m_serializer);
                break;

            case 8:
                tollModel = new TollCalculator_SegmentHalfHour(m_logger, m_serializer);
                break;

            case 9:
                tollModel = new TollCalculator_NewSegment(m_logger, m_serializer);
                break;

            case 10:
                tollModel = new TollCalculator_SegmentQuarterHour(m_logger, m_serializer);
                break;
            }
            return(tollModel);
        }