Exemplo n.º 1
0
        /// <summary>
        /// 获取按时计费策略表
        /// </summary>
        /// <param name="tempID"></param>
        /// <returns></returns>
        public JsonResult FindHourDetail(int tempID)
        {
            CWTariff         cwtariff = new CWTariff();
            HourChargeDetail policy   = cwtariff.FindHourChgDetail(hr => hr.TempChgID == tempID);

            if (policy == null)
            {
                List <HourChargeDetail> hourList = cwtariff.FindHourChgDetailList();
                if (hourList.Count > 0)
                {
                    policy = hourList[0];
                    if (policy != null)
                    {
                        policy.TempChgID = tempID;
                        cwtariff.UpdateHourChgDetail(policy);
                    }
                }
                else
                {
                    policy             = new HourChargeDetail();
                    policy.TempChgID   = tempID;
                    policy.StrideDay   = EnmStrideDay.Continue;
                    policy.CycleTime   = EnmCycleTime.Hour_24;
                    policy.CycleTopFee = 0;
                    cwtariff.AddHourChgDetail(policy);
                }
            }
            return(Json(policy, JsonRequestBehavior.AllowGet));
        }