Exemplo n.º 1
0
        public ActionResult DeletePre(int ID)
        {
            CWTariff cwtariff = new CWTariff();
            //同时删除计费绑定的
            TempChargingRule temp = cwtariff.FindTempChgRule(tp => tp.PreChgID == ID);

            if (temp != null)
            {
                temp.PreChgID = 0;
                cwtariff.UpdateTempChgRule(temp);
            }
            FixChargingRule fix = cwtariff.FindFixCharge(fx => fx.PreChgID == ID);

            if (fix != null)
            {
                fix.PreChgID = 0;
                cwtariff.UpdateFixCharge(fix);
            }
            Response resp = cwtariff.DeletePreCharge(ID);

            return(Json(resp, JsonRequestBehavior.AllowGet));
        }