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)); }