Ejemplo n.º 1
0
        public ActionResult ModifyTempRuleOfOrder()
        {
            Response resp = new Response();

            #region
            CWTariff cwtarff = new CWTariff();
            int      mainID  = 0;
            string   mID     = Request.Form["MID"];
            if (!string.IsNullOrEmpty(mID))
            {
                TempChargingRule rule = cwtarff.FindTempChgRule(Convert.ToInt32(mID));
                if (rule != null)
                {
                    string preID = Request.Form["PreID"];
                    string tType = Request.Form["TType"];

                    rule.TempChgType = (EnmTempChargeType)Convert.ToInt16(tType);
                    rule.PreChgID    = Convert.ToInt32(preID);

                    cwtarff.UpdateTempChgRule(rule);

                    mainID = rule.ID;
                }
            }

            string orderID = Request.Form["OrderID"];
            if (!string.IsNullOrEmpty(orderID))
            {
                string freetime = Request.Form["FreeTime"];
                string fee      = Request.Form["OrderFee"];

                if (orderID == "0")
                {
                    //添加新的
                    if (mainID != 0)
                    {
                        OrderChargeDetail odetail = new OrderChargeDetail()
                        {
                            TempChgID     = mainID,
                            OrderFreeTime = freetime,
                            Fee           = Convert.ToSingle(fee)
                        };
                        resp = cwtarff.AddOrderDetail(odetail);
                    }
                }
                else
                {
                    OrderChargeDetail order = cwtarff.FindOrderDetail(Convert.ToInt32(orderID));
                    if (order != null)
                    {
                        order.OrderFreeTime = freetime;
                        order.Fee           = Convert.ToSingle(fee);
                        cwtarff.UpdateOrderDetail(order);
                    }
                }
            }
            resp.Message = "修改数据成功";
            #endregion
            return(Json(resp));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取按次计费策略表
        /// </summary>
        public JsonResult FindOrderDetail(int tempID)
        {
            CWTariff          cwtariff    = new CWTariff();
            OrderChargeDetail orderDetail = cwtariff.FindOrderDetail(od => od.TempChgID == tempID);

            if (orderDetail == null)
            {
                orderDetail = new OrderChargeDetail
                {
                    TempChgID     = tempID,
                    OrderFreeTime = "00:00",
                    Fee           = 0
                };
                cwtariff.AddOrderDetail(orderDetail);
            }
            return(Json(orderDetail, JsonRequestBehavior.AllowGet));
        }