コード例 #1
0
ファイル: RateBLL.cs プロジェクト: NickQi/TianheDemo
        /// <summary>
        /// 获取费率信息
        /// </summary>
        /// <param name="energyType"></param>
        /// <returns></returns>
        public ResultRatePriceList GetRateList(string energyType)
        {
            ResultRatePriceList modelList = new ResultRatePriceList();
            if (string.IsNullOrEmpty(energyType))
                return modelList;
            // 平价
            modelList.ParValueModel = _dal.GetParValueByTypeID(energyType);

            // 阶梯
            modelList.MultiStepList = _dal.GetMultiStepListByTypeID(energyType);

            List<Model.TB_TIME_PERIOD_SET> list = new List<TB_TIME_PERIOD_SET>();
            list = _dal.GetTimePeroidListByTypeID(energyType);
            // 分时
            modelList.PeroidList = list;

            if (list.Count > 0)
            {
                Model.TB_TIME_PERIOD_SET m1 = list.Where(a => a.TYPE == (int)RateType.尖).FirstOrDefault();
                if (m1 != null)
                    modelList.PriceJ = m1.PRICE;
                Model.TB_TIME_PERIOD_SET m2 = list.Where(a => a.TYPE == (int)RateType.峰).FirstOrDefault();
                if (m2 != null)
                    modelList.PriceF = m2.PRICE;
                Model.TB_TIME_PERIOD_SET m3 = list.Where(a => a.TYPE == (int)RateType.平).FirstOrDefault();
                if (m3 != null)
                    modelList.PriceP = m3.PRICE;
                Model.TB_TIME_PERIOD_SET m4 = list.Where(a => a.TYPE == (int)RateType.谷).FirstOrDefault();
                if (m4 != null)
                    modelList.PriceG = m4.PRICE;
            }

            return modelList;
        }
コード例 #2
0
ファイル: RateBLL.cs プロジェクト: NickQi/TianheDemo
 /// <summary>
 /// 获取费率信息
 /// </summary>
 /// <param name="energyType"></param>
 /// <returns></returns>
 public ResultRatePriceList GetRateInfoList(string energyType, string timeType, string rateType)
 {
     ResultRatePriceList modelList = new ResultRatePriceList();
     if (string.IsNullOrEmpty(energyType))
         return modelList;
     modelList.CommModel = _dal.GetCommPriceByEnergyCode(energyType);
     if (!string.IsNullOrEmpty(rateType))
     {
         modelList.RatePriceList = _dal.GetRatePriceByEnergyCodeType(energyType, rateType);
     }
     if (!string.IsNullOrEmpty(timeType))
     {
         modelList.PriceTimeList = _dal.GetTimePriceByEnergyCodeType(energyType, timeType);
         modelList.RuleTimeList = _dal.GetRuleTimeByEnergyCodeType(energyType, timeType);
     }
     return modelList;
 }